赞
踩
https://github.com/andyzeng/tsdf-fusion.git
compile.sh -> CMakeLists.txt
compile.sh
#!/bin/bash
export PATH=$PATH:/usr/local/cuda/bin
if uname | grep -q Darwin; then
CUDA_LIB_DIR=/usr/local/cuda/lib
elif uname | grep -q Linux; then
CUDA_LIB_DIR=/usr/local/cuda/lib64
fi
nvcc -std=c++11 -O3 -o demo demo.cu -I/usr/local/cuda/include -L$CUDA_LIB_DIR -lcudart -lcublas -lcurand -D_MWAITXINTRIN_H_INCLUDED `pkg-config --cflags --libs opencv`
CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
find_package(CUDA QUIET REQUIRED)
# Pass options to NVCC
list(APPEND CUDA_NVCC_FLAGS "-std=c++11 -O3")
#set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11 -O3")
message(${CUDA_NVCC_FLAGS})
# Specify include directories
include_directories(
/usr/local/cuda/include
)
# Specify library paths
link_directories(
/usr/local/cuda/lib64
)
link_libraries(
-lcudart
-lcublas
-lcurand
)
find_package(OpenCV REQUIRED COMPONENTS core imgproc highgui)
# For compilation ...
# Specify target & source files to compile it from
cuda_add_executable( demo
demo.cu
)
target_link_libraries(demo
${OpenCV_LIBS})
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。