全网最新最简单的vs2019 cuda编译操作指南(笑
我的配置:
Cuda 11.0
Visual studio 2019 community
PCL 1.11.1
flann 1.9.1
需要严格按照这个配置来,因为CUDA windows上面的有BUG,CUDA10.1 和10.2均无法完美编译
同时这个编译不带VTK的(我不用显示)
首先编译flann
可以不选cuda
编译生成flann_s_cpp.lib
过后下载PCL all in one( 利用里面的eigen和boost,有需要的话vtk也可以用)
需要手动配置一下boost,flann和eigen, boost添加进环境变量,flann和eigen配置好路径
大概长这样
然后准备配置CUDA,勾选CUDA和GPU,选择一下架构,我的卡是10系列的,所以只选6.0 6.1
然后生成即可
最后编译的时候,eigen的half.h会出错
EIGEN_STRONG_INLINE __device__ half operator + (const half& a, const half& b) {
return __hadd(a, b);
}
需要改成:
EIGEN_STRONG_INLINE __device__ half operator + (const half& a, const half& b) {
#if defined(EIGEN_CUDACC_VER) && EIGEN_CUDACC_VER >= 90000
return __hadd(::__half(a), ::__half(b));
#else
return __hadd(a, b);
#endif
}
编译即完成了,编译出的dll如下
OpenNI2.dll
OpenNI2.jni.dll
pcl_common.dll
pcl_commond.dll
pcl_cuda_features.dll
pcl_cuda_featuresd.dll
pcl_cuda_sample_consensus.dll
pcl_cuda_sample_consensusd.dll
pcl_cuda_segmentation.dll
pcl_cuda_segmentationd.dll
pcl_features.dll
pcl_featuresd.dll
pcl_filters.dll
pcl_filtersd.dll
pcl_gpu_containers.dll
pcl_gpu_containersd.dll
pcl_gpu_features.dll
pcl_gpu_featuresd.dll
pcl_gpu_octree.dll
pcl_gpu_octreed.dll
pcl_gpu_segmentation.dll
pcl_gpu_segmentationd.dll
pcl_gpu_utils.dll
pcl_gpu_utilsd.dll
pcl_io.dll
pcl_iod.dll
pcl_io_ply.dll
pcl_io_plyd.dll
pcl_kdtree.dll
pcl_kdtreed.dll
pcl_keypoints.dll
pcl_keypointsd.dll
pcl_ml.dll
pcl_mld.dll
pcl_octree.dll
pcl_octreed.dll
pcl_peopled.dll
pcl_recognition.dll
pcl_recognitiond.dll
pcl_registration.dll
pcl_registrationd.dll
pcl_sample_consensus.dll
pcl_sample_consensusd.dll
pcl_search.dll
pcl_searchd.dll
pcl_segmentation.dll
pcl_segmentationd.dll
pcl_stereo.dll
pcl_stereod.dll
pcl_surface.dll
pcl_surfaced.dll
pcl_tracking.dll
pcl_trackingd.dll