/usr/bin/ld: warning: libcudnn.so.7, needed by .../lib/libsunergy_gpu.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libcudnn.so.7, needed by .../lib/libsunergy_gpu.so, not found (try using -rpath or -rpath-link)
1. /usr/bin/ld: warning: libcudnn.so.7, needed by /home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so, not found (try using -rpath or -rpath-link)
23:07:31 **** Build of configuration Debug for project body_pose ****
make all
Building file: ../src/body_pose.cpp
Invoking: GCC C++ Compiler
g++ -std=c++0x -I/usr/local/include -I/usr/local/cuda-10.0/include -I"/home/strong/eclipse-work/body_pose/lib/moonergy/include" -I"/home/strong/eclipse-work/body_pose/lib/sunergy/include/track" -I/usr/local/include/opencv4/opencv2 -I"/home/strong/eclipse-work/body_pose/lib/sunergy/include" -I/usr/local/include/opencv4 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/body_pose.d" -MT"src/body_pose.o" -o "src/body_pose.o" "../src/body_pose.cpp"
Finished building: ../src/body_pose.cpp
Building file: ../src/human_pose.cpp
Invoking: GCC C++ Compiler
g++ -std=c++0x -I/usr/local/include -I/usr/local/cuda-10.0/include -I"/home/strong/eclipse-work/body_pose/lib/moonergy/include" -I"/home/strong/eclipse-work/body_pose/lib/sunergy/include/track" -I/usr/local/include/opencv4/opencv2 -I"/home/strong/eclipse-work/body_pose/lib/sunergy/include" -I/usr/local/include/opencv4 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/human_pose.d" -MT"src/human_pose.o" -o "src/human_pose.o" "../src/human_pose.cpp"
Finished building: ../src/human_pose.cpp
Building target: body_pose
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -L/usr/local/cuda-10.0/lib64 -L/home/strong/eclipse-work/body_pose/lib/sunergy/lib -Wl,-rpath='$ORIGIN/../lib/sunergy/lib' -o "body_pose" ./src/body_pose.o ./src/human_pose.o -lopencv_core -lcudnn -lcurand -lcuda -lcudart -lcudadevrt -lsunergy_gpu -lopencv_imgproc -lopencv_img_hash -lopencv_flann -lopencv_features2d -lopencv_imgcodecs -lopencv_shape -lopencv_calib3d -lopencv_dnn -lopencv_bioinspired -lopencv_highgui -lopencv_videoio -lopencv_datasets -lopencv_text -lopencv_ml -lopencv_cvv -lopencv_dnn_objdetect -lopencv_video -lopencv_aruco
/usr/bin/ld: warning: libcudnn.so.7, needed by /home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so, not found (try using -rpath or -rpath-link)
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
makefile:45: recipe for target 'body_pose' failed
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
/home/strong/eclipse-work/body_pose/lib/sunergy/lib/libsunergy_gpu.so: undefined reference to `[email protected]'
collect2: error: ld returned 1 exit status
make: *** [body_pose] Error 1
23:07:34 Build Finished (took 3s.139ms)
2. GCC C++ Compiler and GCC C++ Linker
GCC C++ Compiler
Includes -> Include paths(-l):
/usr/local/cuda-10.0/include
GCC C++ Linker
Libraries -> Library search path (-L):
cudnn
curand
cuda
cudart
cudadevrt
Libraries -> Libraries(-l):
/usr/local/cuda-10.0/lib64
3. libcudnn.so.7 => /usr/local/cuda-10.0/lib64/libcudnn.so.7 (0x00007f27880dc000)
strong@foreverstrong:~/eclipse-work/body_pose/lib/sunergy/lib$ pwd
/home/strong/eclipse-work/body_pose/lib/sunergy/lib
strong@foreverstrong:~/eclipse-work/body_pose/lib/sunergy/lib$
strong@foreverstrong:~/eclipse-work/body_pose/lib/sunergy/lib$ sudo ldconfig /usr/local/cuda-10.0/lib64/
[sudo] password for strong:
strong@foreverstrong:~/eclipse-work/body_pose/lib/sunergy/lib$
strong@foreverstrong:~/eclipse-work/body_pose/lib/sunergy/lib$ ll /usr/local/cuda-10.0/lib64/libcudnn*
lrwxrwxrwx 1 root root 13 Oct 15 20:32 /usr/local/cuda-10.0/lib64/libcudnn.so -> libcudnn.so.7*
lrwxrwxrwx 1 root root 17 Oct 15 20:32 /usr/local/cuda-10.0/lib64/libcudnn.so.7 -> libcudnn.so.7.4.2*
-rwxr-xr-x 1 root root 349141232 Oct 15 20:28 /usr/local/cuda-10.0/lib64/libcudnn.so.7.4.2*
-rw-r--r-- 1 root root 346085818 Oct 15 20:28 /usr/local/cuda-10.0/lib64/libcudnn_static.a
strong@foreverstrong:~/eclipse-work/body_pose/lib/sunergy/lib$
strong@foreverstrong:~/eclipse-work/body_pose/lib/sunergy/lib$ ldd ./libsunergy_gpu.so
linux-vdso.so.1 => (0x00007ffc32b2d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f279d6d9000)
libpython3.5m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f279d052000)
libcudnn.so.7 => /usr/local/cuda-10.0/lib64/libcudnn.so.7 (0x00007f27880dc000)
libcurand.so.10.0 => /usr/local/cuda-10.0/lib64/libcurand.so.10.0 (0x00007f2783f75000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2783d71000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f2783b69000)
libnvidia-ml.so.1 => /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 (0x00007f278351e000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f278319c000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2782f86000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2782d69000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f278299f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f27a0163000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f2782776000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f278255c000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f2782359000)
strong@foreverstrong:~/eclipse-work/body_pose/lib/sunergy/lib$
4. -Wl,-rpath='$$ORIGIN/../lib/sunergy/lib' -Wl,-rpath='/usr/local/cuda-10.0/lib64'
-Wl,-rpath
的作用:
- 用于编译时指定间接引用的库位置,作用同
-Wl,-rpath-link
。 - 用于运行时指定所有引用库的位置,作用同修改环境变量
LD_LIBRARY_PATH
,库路径引用优先级高于LD_LIBRARY_PATH
。
Project -> Properties -> C/C++ Build -> Settings -> GCC C++ Linker -> Miscellaneous -> Linker flags
-Wl,-rpath='$$ORIGIN/../lib/sunergy/lib' -Wl,-rpath='/usr/local/cuda-10.0/lib64'
5. Build Finished
23:32:03 **** Build of configuration Debug for project body_pose ****
make all
Building file: ../src/body_pose.cpp
Invoking: GCC C++ Compiler
g++ -std=c++0x -I/usr/local/include -I/usr/local/cuda-10.0/include -I"/home/strong/eclipse-work/body_pose/lib/moonergy/include" -I"/home/strong/eclipse-work/body_pose/lib/sunergy/include/track" -I/usr/local/include/opencv4/opencv2 -I"/home/strong/eclipse-work/body_pose/lib/sunergy/include" -I/usr/local/include/opencv4 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/body_pose.d" -MT"src/body_pose.o" -o "src/body_pose.o" "../src/body_pose.cpp"
Finished building: ../src/body_pose.cpp
Building file: ../src/human_pose.cpp
Invoking: GCC C++ Compiler
g++ -std=c++0x -I/usr/local/include -I/usr/local/cuda-10.0/include -I"/home/strong/eclipse-work/body_pose/lib/moonergy/include" -I"/home/strong/eclipse-work/body_pose/lib/sunergy/include/track" -I/usr/local/include/opencv4/opencv2 -I"/home/strong/eclipse-work/body_pose/lib/sunergy/include" -I/usr/local/include/opencv4 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/human_pose.d" -MT"src/human_pose.o" -o "src/human_pose.o" "../src/human_pose.cpp"
Finished building: ../src/human_pose.cpp
Building target: body_pose
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -L/usr/local/cuda-10.0/lib64 -L/home/strong/eclipse-work/body_pose/lib/sunergy/lib -Wl,-rpath='$ORIGIN/../lib/sunergy/lib' -Wl,-rpath='/usr/local/cuda-10.0/lib64' -o "body_pose" ./src/body_pose.o ./src/human_pose.o -lopencv_core -lcudnn -lcurand -lcuda -lcudart -lcudadevrt -lsunergy_gpu -lopencv_imgproc -lopencv_img_hash -lopencv_flann -lopencv_features2d -lopencv_imgcodecs -lopencv_shape -lopencv_calib3d -lopencv_dnn -lopencv_bioinspired -lopencv_highgui -lopencv_videoio -lopencv_datasets -lopencv_text -lopencv_ml -lopencv_cvv -lopencv_dnn_objdetect -lopencv_video -lopencv_aruco
Finished building target: body_pose
23:32:06 Build Finished (took 3s.434ms)