1、配置国防科大的ROSEFusion项目出现:
fatal error: math_functions.hpp: 没有那个文件或目录
开始以为是eigen3的原因,通过这篇文章知道其实不是。
真正的原因是我的CUDA 11.2, math_functions.hpp 在cuda/include/crt/math_functions.hpp, 而不是在原来的位置 cuda/include/math_functions.hpp 然后就报错了,只要重新建立软链接即可。
解决方案:
sudo ln -s /usr/local/cuda/include/crt/math_functions.hpp /usr/local/cuda/include/math_functions.hpp
2、解决了问题1随之而来的又是CUDACC_VER不支持的问题:
usr/local/cuda-11.2/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.”
网上有人说是Eigen版本的问题,重装Eigen就能解决,我嫌麻烦没去尝试(大家不嫌麻烦可以尝试一下),后来从这篇文章中找到了答案。
解决方案:
cd /usr/local/cuda-11.3/include/crt
sudo gedit common_functions.h
将第74行对应内容直接注释
重新make,出现新的问题:
/usr/include/eigen3/Eigen/src/Core/arch/CUDA/Half.h(596): error: no suitable constructor exists to convert from “float” to “Eigen::half”
不是Eigen的问题!!!照做
cd /usr/include/eigen3/Eigen/src/Core/arch/CUDA
sudo gedit Half.h
将596行直接注释
make,成功!