SciPy build error on macOS
Dear all, I have been trying to build SciPy following the online guide but keep running into a compilation error: ld: in /Users/mloning/.conda/envs/scipy-dev/lib/python3.7/site-packages/numpy/core/lib/libnpymath.a(npy_math.o), could not parse object file /Users/mloning/.conda/envs/scipy-dev/lib/python3.7/site-packages/numpy/core/lib/libnpymath.a(npy_math.o): 'Unknown attribute kind (61) (Producer: 'LLVM10.0.1' Reader: 'LLVM APPLE_1_1100.0.33.8_0')', using libLTO version 'LLVM version 11.0.0, (clang-1100.0.33.8)' for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) error: Command "gcc -bundle -undefined dynamic_lookup -L/Users/mloning/.conda/envs/scipy-dev/lib -arch x86_64 -L/Users/mloning/.conda/envs/scipy-dev/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.9-x86_64-3.7/scipy/spatial/src/distance_wrap.o -L/Users/mloning/.conda/envs/scipy-dev/lib/python3.7/site-packages/numpy/core/lib -Lbuild/temp.macosx-10.9-x86_64-3.7 -lnpymath -o scipy/spatial/_distance_wrap.cpython-37m-darwin.so" failed with exit status 1 Any idea how to fix this? A similar error has also been posted on SO here: https://stackoverflow.com/questions/63428079/scipy-build-fail-on-macos-becau... <https://stackoverflow.com/questions/63428079/scipy-build-fail-on-macos-becau...> The related PR that I’m working on is here: https://github.com/scipy/scipy/pull/11911 <https://github.com/scipy/scipy/pull/11911> Any help is much appreciated! Thanks Markus
On Sat, Dec 12, 2020 at 1:39 PM mloning <markus.loning@gmail.com> wrote:
Dear all,
I have been trying to build SciPy following the online guide but keep running into a compilation error:
ld: in /Users/mloning/.conda/envs/scipy-dev/lib/python3.7/site-packages/numpy/core/lib/libnpymath.a(npy_math.o), could not parse object file /Users/mloning/.conda/envs/scipy-dev/lib/python3.7/site-packages/numpy/core/lib/libnpymath.a(npy_math.o): 'Unknown attribute kind (61) (Producer: 'LLVM10.0.1' Reader: 'LLVM APPLE_1_1100.0.33.8_0')', using libLTO version 'LLVM version 11.0.0, (clang-1100.0.33.8)' for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) error: Command "gcc -bundle -undefined dynamic_lookup -L/Users/mloning/.conda/envs/scipy-dev/lib -arch x86_64 -L/Users/mloning/.conda/envs/scipy-dev/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.9-x86_64-3.7/scipy/spatial/src/distance_wrap.o -L/Users/mloning/.conda/envs/scipy-dev/lib/python3.7/site-packages/numpy/core/lib -Lbuild/temp.macosx-10.9-x86_64-3.7 -lnpymath -o scipy/spatial/_ distance_wrap.cpython-37m-darwin.so" failed with exit status 1
Any idea how to fix this?
I can reproduce this. It looks like it's caused by the XCode you have installed being older than the one with which libnpymath.a (shipped with the numpy installed in your conda env). Upgrading XCode should fix it. However, it looks like you can't upgrade XCode to a recent enough version unless you're at least on macOS 10.15 (Catalina). A workaround is to install an older numpy version to build against. 1.17.3 should work. This should work: conda create -n scipy-dev conda activate scipy-dev conda install numpy=1.17.3 cython pybind11 pytest python setup.py develop Cheers, Ralf
A similar error has also been posted on SO here: https://stackoverflow.com/questions/63428079/scipy-build-fail-on-macos-becau...
The related PR that I’m working on is here: https://github.com/scipy/scipy/pull/11911
Any help is much appreciated!
Thanks
Markus _______________________________________________ SciPy-Dev mailing list SciPy-Dev@python.org https://mail.python.org/mailman/listinfo/scipy-dev
participants (2)
-
mloning -
Ralf Gommers