使用pip命令安装两个子模块时分别遇到以下问题:
1.安装simple-knn
报错:error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
解决办法:报错的原因是我使用的是gcc12,降为gcc11即可
# 安装 GCC 11 和 G++ 11(系统级别)
sudo apt update
sudo apt install gcc-11 g++-11
# 进入conda环境
conda activate env
# 设置环境变量(只在这个环境中生效)
export CC=/usr/bin/gcc-11
export CXX=/usr/bin/g++-11
#加上一条验证命令确认输出是gcc11的版本信息。
$CC --version
2.安装xray_gaussian_rasterization_voxelization
报错:/submodules/xray-gaussian-rasterization-voxelization/cuda_rasterizer/rasterizer_impl.cu:23:10: fatal error: glm/glm.hpp: 没有那个文件或目录
23 | #include <glm/glm.hpp>
| ^~~~~~~~~~~~~
compilation terminated.
解决办法:报错的原因是因为找不到 glm/glm.hpp
—— 也就是说,缺少 GLM(OpenGL Mathematics)库的头文件,通过以下命令即可解决:
sudo apt-get install libglm-dev