occupancy_networks icon indicating copy to clipboard operation
occupancy_networks copied to clipboard

undefined symbol: cblas_sgemm_alloc

Open zergrisk1 opened this issue 2 years ago • 9 comments

When I tried python setup.py build_ext --inplace,It fails with the error: Traceback (most recent call last): File "setup.py", line 7, in <module> from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension File "/home/baichenghuan/anaconda3/envs/mesh_funcspace/lib/python3.6/site-packages/torch/__init__.py", line 84, in <module> from torch._C import * ImportError: /home/baichenghuan/anaconda3/envs/mesh_funcspace/lib/python3.6/site-packages/torch/lib/libmkldnn.so.0: undefined symbol: cblas_sgemm_alloc How to solve it?

zergrisk1 avatar Aug 01 '22 17:08 zergrisk1

I also triedconda install mkl -c anaconda and conda update -n base -c defaults conda but didn't work.

zergrisk1 avatar Aug 01 '22 17:08 zergrisk1

I had the same problem, and solved it by installing torch 1.0.1 !

jiyoonshincml avatar Aug 10 '22 04:08 jiyoonshincml

Oh it finally works !Thanks a lot !

zergrisk1 avatar Aug 10 '22 08:08 zergrisk1

HI, I also add the same issue, but after installing torch 1.0.1, when I run python setup.py build_ext --inplace it throws this error. Currently I am unable to solve it

building 'im2mesh.utils.libkdtree.pykdtree.kdtree' extension gcc -pthread -B /home/alphaar/anaconda3/envs/mesh_funcspace/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/alphaar/anaconda3/envs/mesh_funcspace/include/python3.6m -c im2mesh/utils/libkdtree/pykdtree/kdtree.c -o build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.o -std=c99 -O3 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=kdtree -D_GLIBCXX_USE_CXX11_ABI=0 im2mesh/utils/libkdtree/pykdtree/kdtree.c:525:10: fatal error: numpy/arrayobject.h: No such file or directory 525 | #include "numpy/arrayobject.h" | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1

Blessing92 avatar Aug 18 '22 12:08 Blessing92

Try sudo apt-get install python-numpy

jiyoonshincml avatar Aug 19 '22 01:08 jiyoonshincml

HI, I also add the same issue, but after installing torch 1.0.1, when I run python setup.py build_ext --inplace it throws this error. Currently I am unable to solve it

building 'im2mesh.utils.libkdtree.pykdtree.kdtree' extension gcc -pthread -B /home/alphaar/anaconda3/envs/mesh_funcspace/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/alphaar/anaconda3/envs/mesh_funcspace/include/python3.6m -c im2mesh/utils/libkdtree/pykdtree/kdtree.c -o build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.o -std=c99 -O3 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=kdtree -D_GLIBCXX_USE_CXX11_ABI=0 im2mesh/utils/libkdtree/pykdtree/kdtree.c:525:10: fatal error: numpy/arrayobject.h: No such file or directory 525 | #include "numpy/arrayobject.h" | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1

Did you figure this one out.

aalibasic avatar Sep 02 '22 14:09 aalibasic

Thanks, @jiyoonshincml it worked with your suggestion!

Blessing92 avatar Sep 02 '22 14:09 Blessing92

another method is useful: conda install mkl=2018 -c anaconda

SMY19999 avatar Sep 23 '22 14:09 SMY19999

HI, I also add the same issue, but after installing torch 1.0.1, when I run python setup.py build_ext --inplace it throws this error. Currently I am unable to solve it building 'im2mesh.utils.libkdtree.pykdtree.kdtree' extension gcc -pthread -B /home/alphaar/anaconda3/envs/mesh_funcspace/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/alphaar/anaconda3/envs/mesh_funcspace/include/python3.6m -c im2mesh/utils/libkdtree/pykdtree/kdtree.c -o build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.o -std=c99 -O3 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=kdtree -D_GLIBCXX_USE_CXX11_ABI=0 im2mesh/utils/libkdtree/pykdtree/kdtree.c:525:10: fatal error: numpy/arrayobject.h: No such file or directory 525 | #include "numpy/arrayobject.h" | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1

Did you figure this one out.

I solved by following the top answer: https://stackoverflow.com/questions/14657375/cython-fatal-error-numpy-arrayobject-h-no-such-file-or-directory there is a comment that:

Or, if you use cythonize() to make the ext_modules list,
include_dirs can be passed to setup()

follow that I add 'include_dirs' to setup, then it works

liubohan1998 avatar Nov 02 '22 02:11 liubohan1998