ssc-oscar / oscar.py

Python interface for OSCAR data
GNU General Public License v3.0
4 stars 10 forks source link

fix:set c99 flag so gcc will compile cython code #42

Closed cbogart closed 3 years ago

cbogart commented 3 years ago

Got compile errors when compiling with python3 setup.py build_ext --inplace. This seems to fix the problem by directing gcc to use c99 mode.

audrism commented 3 years ago

Building master gives the following error: da4:~/oscar.py>python3 setup.py build_ext --inplace

lib/tchdb.c: In function 'tchdblockallrecords': lib/tchdb.c:4944:3: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = 0; i <= UINT8_MAX; i++){ ^ lib/tchdb.c: In function 'tchdbunlockallrecords': lib/tchdb.c:4965:3: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = UINT8_MAX; i >= 0; i--){ ^ error: command 'gcc' failed with exit status 1

Adding extra_compile_args=['-std=c99'] fixes it. Perhaps defaults for gcc on rhel are different, but -std=c99 should not hurt