ERROR:
使用mamba创建的虚拟环境安装编译Sophus库的时候会报以下错误
/home/alex/miniforge3/envs/ros_py39_env/lib/gcc/x86_64-conda-linux-gnu/12.3.0/include/xmmintrin.h:937:23: error: array subscript '__m128_u[0]' is partly outside array bounds of 'Sophus::Vector<float, 2, 0> [1]' {aka 'Eigen::Matrix<float, 2, 1> [1]'} [-Werror=array-bounds]
看报错感觉是gcc的问题,查看gcc版本(gcc -v)
gcc版本太高导致不兼容,将gcc版本降为9,终端输入
mamba install -c conda-forge cxx-compiler=1.2.0 -y
//如果使用conda环境的话,用conda install
//conda install -c conda-forge cxx-compiler=1.2.0 -y
上面的代码重新安装1.2.0 版本的cxx-compiler
,这个这个版的cxx-compiler
包含了GCC 9。
装完之后查看gcc版本
再安装编译,就可以通过了。