Closed jschueller closed 2 years ago
@jschueller I think the changes look good, I propose adding changelog before merging this.
done
This actually breaks building on mac, would require an extra if to get the old behavior for platform == 'mac'
what's the error ? I actually got this error and fixed it for mac specifically
what's the error ? I actually got this error and fixed it for mac specifically
It looks like this removes the flag -pthread to gcc
build/src.macosx-10.15-x86_64-3.9/assimulo/thirdparty/hairer/dopri5module.c:84:10: fatal error: threads.h: No such file or directory
84 | #include <threads.h>
| ^~~~~~~~~~~
compilation terminated.
When I compare the gcc command, the flag -pthread is no longer there.
maybe you passed -pthread
via --extra-fortran-compile-flags
, in that case indeed it should be passed via --extra-c-flags
extra-fortran-compile-flags
Looked at this more in detail I noticed I don't pass pthread
at all but this is how I usually invoke the build on mac
python setup.py bdist_wheel --superlu-home=<a local path>/superlu_install --sundials-home=<a local path>/sundials --sundials-with-superlu=True --blas-home=<a local path>/blas --lapack-home=<a local path>/lapack --extra-fortran-compile-flags="-DF2PY_THREAD_LOCAL_DECL=__thread -std=legacy" --with_openmp=True
But I cant see why your changes make the build system unable to find pthread
its the F2PY_THREAD_LOCAL_DECL define, it should be passed via c flags now
You are correct, thanks! Changing it on our end fixes the issue.
Avoid including fortran flags into c flags It fixes compilation with clang which does not know how to ignore the gcc fortran flags and returns an error.