Hi,
I need to link cuda nppi static library (libnppi_static.a) to my runtime of the code. Currently I’m using the shared libraries but when linked to static library it’s very fast, which I have experienced in Nsight editor. But I’m developing this in Ubuntu 14.04, cuda 7.0 and cmake.
I have attached my CmakeLists.txt herewith.
cmake_minimum_required(VERSION 2.8)
project(libSGM)
find_package(CUDA REQUIRED)
#set(CUDA_ARCH "arch=compute_50,code=sm_50" CACHE STRING "Value of the NVCC -arch option.")
set(CUDA_ARCH "-arch=sm_50" CACHE STRING "Value of the NVCC -arch option.")
SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${CUDA_ARCH}")
#option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON)
find_package(OpenCV REQUIRED core)
if(OpenCV_VERSION VERSION_LESS 3.0)
find_package(OpenCV REQUIRED core highgui imgproc) # 2.x
else()
find_package(OpenCV REQUIRED core highgui imgproc imgcodecs videoio calib3d objdetect photo) # 3.x
endif()
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(include)
SET(STEREOSRCS
src/census.cu
src/matching_cost.cu
src/scan_scost.cu
src/winner_takes_all.cu
src/median_filter.cu
src/check_consistency.cu
src/cuda_utils.cu
)
CUDA_ADD_LIBRARY(sgm src/stereo_sgm.cpp ${STEREOSRCS} STATIC)
CUDA_ADD_EXECUTABLE(stereo_test src/stereosgm_image.cpp ${CUDA_SRC})
TARGET_LINK_LIBRARIES(stereo_test sgm ${CUDA_LIBRARIES} ${CUDA_nppi_LIBRARY} ${OpenCV_LIBS})
I have tried so many options to change the CmakeLists.txt to link to static nppi library.
It is very much appreciated if you can help me out of this situation.