Reputation: 1
The toolkit and items 1-6 of the NVIDIA_CUDA SDK have been installed and compiled , but when it gets to '6_Advanced/cdpLUDecomposition' the following error message appears.
/usr/local/cuda-5.0/bin/nvcc -m64 -Xcompiler -fopenmp -gencode arch=compute_35,code=sm_35 -o cdpLUDecomposition dlaswp.o dgetf2.o dgetrf.o cdp_lu.o cdp_lu_main.o -L/usr/local/cuda-5.0/lib64 -lcublas -lcublas_device -lcudadevrt -lgomp
/usr/local/cuda-5.0/lib64/libcublas.so: error: undefined reference to 'dlsym'
/usr/local/cuda-5.0/lib64/libcublas.so: error: undefined reference to 'dlopen'
/usr/local/cuda-5.0/lib64/libcublas.so: error: undefined reference to 'dlclose'
collect2: ld returned 1 exit status
make[1]: *** [cdpLUDecomposition] Error 1
I am new to both Ubuntu and Cuda, but did try adding LD_FLAGS=-ldl before the make which was no help, and set the PATH and LD_LIBRARY_PATH to the Nvidia recommendations. Also I updated all drivers and was able to get a valid result from the SDK deviceQuery Program.
Any help would be appreciated as everything else I have tried did not yet work.
Upvotes: 0
Views: 912
Reputation: 1941
Adding -ldl
should be sufficient. Enter in the directory of the sample (cd 6_Advanced/cdpLUDecomposition
) and check the build command with make
. On my machine it is
/usr/local/cuda-5.0/bin/nvcc -m64 -Xcompiler -fopenmp -gencode arch=compute_35,code=sm_35 -o cdpLUDecomposition dlaswp.o dgetf2.o dgetrf.o cdp_lu.o cdp_lu_main.o -L/usr/local/cuda-5.0/lib64 -lcublas -lcublas_device -lcudadevrt -lgomp
You can either
-ldl
, or-ldl
to the proper LDFLAGS (line 89), which is cleaner and safer for next rebuildsldd cdpLUDecomposition
then shows it is linked to /lib/x86_64-linux-gnu/libdl.so.2.
Upvotes: 1