cuda 9.1 和 eigen手动适配

计算机视觉应用中,经常用到eigen库,也会用到cuda库,因为eigen库没有及时follow cuda的更新,导致cuda 9.0和9.1最新的版本,会出eigen兼容问题,报错如下:
note:如果使用cmake build,注意下面的顺序,一定放到include_directories开始

include_directories(${CUDA_INCLUDE_DIRS})

include_directories(${EIGEN3_INCLUDE_DIRS})

因为eigen是头文件自包含的lib;对于装有多个eigen版本,或者使用其他版本eigen的库,一样会有问题

In file included from /usr/local/cuda/include/common_functions.h:50:0,
                 from /usr/local/cuda/include/cuda_runtime.h:115,
                 from <command-line>:0:
/usr/local/cuda/include/crt/common_functions.h:64:24: error: token ""__CUDACC_VER__ is no longer supported.  Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."" is not valid in preprocessor expressions
 #define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported.  Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."
                        ^
/usr/include/eigen3/Eigen/src/Core/util/Macros.h:364:33: note: in expansion of macro ‘__CUDACC_VER__’
 #if defined(__CUDACC_VER__) &&  __CUDACC_VER__ >= 70500 && __cplusplus > 199711L
                                 ^
In file included from /usr/local/cuda/include/common_functions.h:50:0,
                 from /usr/local/cuda/include/cuda_runtime.h:115,
                 from <command-line>:0:
/usr/local/cuda/include/crt/common_functions.h:64:24: error: token ""__CUDACC_VER__ is no longer supported.  Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."" is not valid in preprocessor expressions
 #define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported.  Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."
                        ^
/usr/include/eigen3/Eigen/src/Core/util/Macros.h:364:33: note: in expansion of macro ‘__CUDACC_VER__’
 #if defined(__CUDACC_VER__) &&  __CUDACC_VER__ >= 70500 && __cplusplus > 199711L
                                 ^
CMake Error at cuda_compile_1_generated_estimate.cu.o.cmake:219 (message):
  Error generating
  /home/chengxiang/cainiao/workspace/cudaICP/build/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_estimate.cu.o


CMake Error at cuda_compile_1_generated_pyrdown.cu.o.cmake:219 (message):
  Error generating
  /home/chengxiang/cainiao/workspace/cudaICP/build/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_pyrdown.cu.o
  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值