python module compilation fails on macos x

Issue #7 resolved
Former user created an issue

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)

  1. Nathanaël Schaeffer repo owner

    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).

  2. Former user 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.

  3. Former user 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 ^

  4. Log in to comment