Undefined reference to `dsyev_' and friends when compiling from source
akastrin opened this issue · 2 comments
akastrin commented
I try to compile tsne-cuda
from source using the following procedure:
export PATH=/opt/cuda-9.0/bin:$PATH
export LD_LIBRARY_PATH=/opt/cuda-9.0/lib64:$LD_LIBRARY_PATH
git clone https://github.com/CannyLab/tsne-cuda.git
git submodule init
git submodule update
cd ./build
cmake .. -DBUILD_PYTHON=TRUE -DWITH_MKL=FALSE -DCMAKE_C_COMPILER=gcc-6 -DCMAKE_CXX_COMPILER=g++-6
make -j10
However, the process stops with the following error:
Scanning dependencies of target tsne
[ 89%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/GpuResources.cpp.o
[ 89%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/GpuAutoTune.cpp.o
[ 90%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/IndexProxy.cpp.o
[ 90%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/StandardGpuResources.cpp.o
[ 90%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/GpuClonerOptions.cpp.o
[ 90%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/impl/RemapIndices.cpp.o
[ 91%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/utils/DeviceMemory.cpp.o
[ 91%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/utils/DeviceUtils.cpp.o
[ 91%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/utils/MemorySpace.cpp.o
[ 92%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/utils/StackDeviceMemory.cpp.o
[ 92%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/utils/Timer.cpp.o
[ 92%] Building CXX object CMakeFiles/tsne.dir/third_party/faiss/gpu/utils/WorkerThread.cpp.o
[ 92%] Linking CXX executable tsne
ld: lib/libfaiss.so: undefined reference to `dsyev_'
ld: lib/libfaiss.so: undefined reference to `sgeqrf_'
ld: lib/libfaiss.so: undefined reference to `sorgqr_'
ld: lib/libfaiss.so: undefined reference to `sgesvd_'
make[2]: *** [CMakeFiles/tsne.dir/build.make:1574: tsne] Error 1
make[1]: *** [CMakeFiles/Makefile2:249: CMakeFiles/tsne.dir/all] Error 2
make: *** [Makefile:171: all] Error 2]
I use Arch Linux with CUDA 9.0, CMake 3.18; further details are provided here and here.
Any advice is appreciated. Thanks.
DavidMChan commented
It looks like FAISS is not linking correctly against lapack/openblas (probably because you have a newer version than the older FAISS code). You can try the version on the develop/ branch (which should be more up to date), or try to track down the LAPACK linking errors.
DavidMChan commented
This should be resolved as of the new installation instructions in 3.0.0!