cf-units
cf-units copied to clipboard
Error building from source
🐛 Bug Report
Cannot currently build cf-units from source on Met Office machine with python 3.12. Everything is fine if I pin python=3.11.
How to Reproduce
Steps to reproduce the behaviour:
- Create conda environment from
requirements/cf-units.yml python -m pip install -v .
Error:
In file included from cf_units/_udunits2.c:20448:0:
/.../conda_envs/cf-units-dev/include/python3.12/internal/pycore_frame.h: In function '_PyFrame_Initialize':
/.../conda_envs/cf-units-dev/include/python3.12/internal/pycore_frame.h:132:5: error: 'for' loop initial declarations are only allowed in C99 mode
for (int i = null_locals_from; i < code->co_nlocalsplus; i++) {
^
/.../conda_envs/cf-units-dev/include/python3.12/internal/pycore_frame.h:132:5: note: use option -std=c99 or -std=gnu99 to compile your code
error: command '/usr/bin/gcc' failed with exit code 1
error: subprocess-exited-with-error
Expected Behaviour
cf-units builds without error
Environment
- OS & Version: RHEL7
- cf-units Version:
main
Additional Context
Click to expand this section...
Please add additional verbose information in this section e.g., code, output, tracebacks, screenshots etc
@rcomer Thanks for raising this issue.
I suspect that we need to make some minor tweaks to cf-units to use cython 3.x and build correctly for py312.
I'm keen to make a fix for this and force a release of cf-units soon.
I cannot reproduce the problem on Ubuntu 22.04.
I think we have now fixed this.