cudnn - Cmake not using user configured lib for linking -
i using cmake (3.5.0) compile c++ probject on ubuntu 14.04, depends on nvidia cudnn. seems cmake not provide correct paths of cudnn linker although have configured paths.
file findcudnn.cmake:
find_path(cudnn_include_dir name "cudnn.h" paths "$env{cmake_include_path}") find_library(cudnn_libraries name "libcudnn.so" paths "$env{cmake_library_path}") include(findpackagehandlestandardargs) find_package_handle_standard_args(cudnn default_msg cudnn_include_dir cudnn_libraries) mark_as_advanced(cudnn_include_dir cudnn_libraries)
cmakelists.txt:
find_package(cudnn required) list(append linker_libs ${cudnn_libraries}) ... add_library(myobjects object ${mysources}) add_library(mylib shared $<target_objects:myobjects> ${cuda_objs}) target_link_libraries(mylib ${linker_libs})
cmake_include_path, cmake_library_path
exported paths of cudnn5 in home folder. after cmake ..
, paths in cmakecache.txt set cudnn5. however, linker (and link.txt) uses -lcudnn
without paths cudnn5. consequently, links cudnn4 in system folder, i.e. /usr/local/cuda/lib64
.
note: if there no cudnn4 in system folder, fine. link.txt file , output of make verbose=1
use absolute paths of cudnn 5 during linking.
Comments
Post a Comment