Open defjaf opened 3 years ago
This is an awesome tipp, thank you Andrew!
And for what it's worth, my anecdotal evidence is that clang on macOS is a little bit faster than gcc.
Great. In the next minor revision 3.0.2, will plan to document this in the Makefile and in the wiki section devoted to installation.
Thank you for the tip ! (it works perfectly for mac os x 11.4 with Apple clang version 12.0.0)
I just want to add an additional comment for classy
. I don't know if it obvious, but it can maybe help some one else.
I got the following error:
from classy import Class
ImportError: dlopen(/usr/local/anaconda3/lib/python3.7/site-packages/classy.cpython-37m-darwin.so, 2): Symbol not found: ___kmpc_barrier
The problem comes from the path of openMP lib which is not correctly set in python/setup.py
. To solve it, I modify extra_link_args=['-lgomp']
to extra_link_args=['-lomp']
(which is the lib that it is used here during the compilation). Then make clean
, make
and classy works.
Contrary to what is stated in the docs, it is actually not difficult to compile with clang and OpenMP:
clang
(even the Apple-supplied version) has actually supported working with OpenMP for several versions, but you have to have thelibomp
libraries. You can get these (for example) with homebrew, so all you have to do is:brew install libomp
(once only!)-Xclang -fopenmp
(nb. not just-fopenmp
so non-standard)-lomp
.So in the Makefile, you need lines like the following: