I am trying to build my project but it keep giving me an error. I tried to include the /usr/local/cuda-10.0/lib64//libcublas.so.10.0 path, but it does not work.
My cmake file is given below:
- cmake_minimum_required(VERSION 2.8)
project(testssd)
find_package(PkgConfig REQUIRED)
pkg_search_module(GST REQUIRED gstreamer-1.0>=1.4
gstreamer-sdp-1.0>=1.4
gstreamer-video-1.0>=1.4
gstreamer-app-1.0>=1.4)find_package(CUDA REQUIRED)
message(“-- CUDA version: ${CUDA_VERSION}”)set(
CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-O3
-gencode arch=compute_62,code=sm_62
)if(CUDA_VERSION_MAJOR GREATER 9)
message(“-- CUDA ${CUDA_VERSION_MAJOR} detected, enabling SM_62”)set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}; -gencode arch=compute_62,code=sm_62 ) # OpenCV used for findHomography() and decomposeHomography() # OpenCV version >= 3.0.0 required for decomposeHomography() find_package(OpenCV 3.0.0 COMPONENTS core calib3d REQUIRED)
endif()
find_package(CUDA)
find_package(Qt4)
find_package( OpenCV REQUIRED )include(${QT_USE_FILE})
include_directories(/usr/include/gstreamer-1.0 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/include /usr/include/glib-2.0 /usr/include/libxml2 /usr/lib/aarch64-linux-gnu/glib-2.0/include/ /usr/local/cuda-10.0/lib64/)add_definitions(${QT_DEFINITIONS})
cuda_add_executable(testssd testssd.cpp)#link_directories(/usr/local/cuda-10.0/lib64/)
target_link_libraries(testssd jetson-inference)
target_include_directories(testssd PRIVATE ${GST_INCLUDE_DIRS})
target_link_libraries(testssd ${GST_LIBRARIES})
target_link_libraries( testssd ${OpenCV_LIBS} )
target_link_libraries( testssd nvinfer_plugin )
target_link_libraries( testssd nvinfer )
The error while building :
nvidia@nvidia:~/Desktop/test/build$ make
[ 50%] Linking CXX executable testssd
/usr/bin/ld: CMakeFiles/testssd.dir/testssd.cpp.o: undefined reference to symbol ‘cublasScopy_v2@@libcublas.so.10.0’
/usr/local/cuda-10.0/lib64/libcublas.so.10.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/testssd.dir/build.make:119: recipe for target ‘testssd’ failed
make[2]: *** [testssd] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/testssd.dir/all’ failed
make[1]: *** [CMakeFiles/testssd.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2
All i can understand from " undefined reference to symbol ‘cublasScopy_v2@@libcublas.so.10.0’ " that the program is not able to link libcublas.so.10.0 but cant solve it.