python module compilation fails on macos x
clang is the default compiler on macos x now, and it fails to compile the python module with errors like this:
shtns_numpy_wrap.c:3233:3: error: non-void function 'new_shtns_info' should return a value [-Wreturn-type] import_array(); // required by NumPy
shtns_numpy_wrap.c:3454:54: error: non-void function 'shtns_info_Xrotate90' should return a value [-Wreturn-type] throw_exception(SWIG_RuntimeError,0,msg_rot_err); return; ^
The workaround I found was to set
cargs = "-fopenmp -Wno-error=return-type"
in setup.py
Comments (8)
-
repo owner -
repo owner -
assigned issue to
- edited description
-
assigned issue to
-
repo owner - changed status to resolved
-
repo owner - changed status to open
-
Account Deleted Looks like version 3.1
[jeff-whitakers-imac-7:/fortran/gfs-dycore/src] jsw% clang -v Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn) Target: x86_64-apple-darwin12.2.0 Thread model: posix
I don't know if this version supports openmp.
-
repo owner - changed status to resolved
-
Account Deleted Still getting one error on the import_array() call:
shtns_numpy_wrap.c:3233:3: error: non-void function 'new_shtns_info' should return a value [-Wreturn-type] import_array(); required by NumPy ^
-
repo owner Arg! Missed that one. Uploaded a new v2.3 where it is fixed.
- Log in to comment
Thanks for reporting this. It will be fixed in next release (it should return NULL).
On my linux box, clang version 3.1 did not complain. What version of clang is it ? In addition, does it support openmp ? (here it does not).