当前位置:   article > 正文

tsdf-fusion

tsdf-fusion

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})







声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/883732
推荐阅读
  

闽ICP备14008679号