Closed fzeiser closed 5 years ago
Comment by magneg Thursday Aug 29, 2019 at 11:29 GMT
Fabio: Seems like -fopenmp was missing.
Can be installed with brew install libomp
, but gcc seems to need to get an extra flag for MAC, -Xpreprocessor -fopenmp
.
For a possible fix in the setup.py
, see
https://github.com/GalacticDynamics-Oxford/Agama/blob/master/setup.py
Comment by magneg Thursday Aug 29, 2019 at 11:30 GMT
I also checked that it compiles if I manually add the -Xpreprocessor
flag and it works.
Comment by magneg Thursday Aug 29, 2019 at 11:37 GMT
Hotfix:
Extension("decomposition",
["ompy/decomposition.pyx"],
extra_compile_args=["-O3", "-ffast-math", "-march=native",
"-Xpreprocessor", "-fopenmp"],
extra_link_args=["-Xpreprocessor", "-fopenmp"],
include_dirs=[numpy.get_include()]
),
But the next error after installing is:
magneg@fysmac-kef12.uio.no:ompy>python3
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 16:52:21)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ompy as om
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Applications/ompy/ompy/__init__.py", line 4, in <module>
from .rebin import *
ModuleNotFoundError: No module named 'ompy.rebin'
Comment by fzeiser Thursday Aug 29, 2019 at 17:23 GMT
It might be nice to be able to run it on mac directly, but I'll anyhow create a docker image
Comment by fzeiser Thursday Aug 29, 2019 at 17:42 GMT
Potentially the above fixed the fpenmp isse and the rest is just something that is borken at the current commit of rhosig, see #31: "Build" broken in current rhosig branch
Comment by magneg Friday Aug 30, 2019 at 11:09 GMT
Installing with conda gcc gives:
(ompy) magneg@fysmac-kef12.uio.no:ompy>python setup.py build_ext --inplace
running build_ext
building 'ompy.decomposition' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/magneg/miniconda3/envs/ompy/include -arch x86_64 -I/Users/magneg/miniconda3/envs/ompy/include -arch x86_64 -I/Users/magneg/miniconda3/envs/ompy/lib/python3.7/site-packages/numpy/core/include -I/Users/magneg/miniconda3/envs/ompy/include/python3.7m -c ompy/decomposition.c -o build/temp.macosx-10.9-x86_64-3.7/ompy/decomposition.o -O3 -ffast-math -march=native -Xpreprocessor -fopenmp
In file included from /Users/magneg/miniconda3/envs/ompy/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/syslimits.h:7:0,
from /Users/magneg/miniconda3/envs/ompy/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:34,
from /Users/magneg/miniconda3/envs/ompy/include/python3.7m/Python.h:11,
from ompy/decomposition.c:32:
/Users/magneg/miniconda3/envs/ompy/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
#include_next <limits.h> /* recurse down to the real one */
^
compilation terminated.
error: command 'gcc' failed with exit status 1
and installing with macs inbuild gcc works, but the import gives:
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ompy
^[[B^[[AMatplotlib is building the font cache using fc-list. This may take a moment.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Applications/ompy/ompy/__init__.py", line 6, in <module>
from .fit_rho_T import *
File "/Applications/ompy/ompy/fit_rho_T.py", line 35, in <module>
from . import rhosig as rsg
File "ompy/rhosig.pyx", line 32, in init rhosig
File "/Applications/ompy/ompy/matrix.py", line 47, in <module>
from .decomposition import index
ImportError: dlopen(/Applications/ompy/ompy/decomposition.cpython-37m-darwin.so, 2): Symbol not found: ___kmpc_barrier
Referenced from: /Applications/ompy/ompy/decomposition.cpython-37m-darwin.so
Expected in: flat namespace
in /Applications/ompy/ompy/decomposition.cpython-37m-darwin.so
Issue by magneg Thursday Aug 29, 2019 at 11:14 GMT Originally opened as https://github.com/oslocyclotronlab/ompy/issues/30
I get following error during the installation: