Anaconda中虚拟环境安装g++和gcc相同版本
安装torchSDF的时候遇到的,这是g++和gcc版本不一致的问题
gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory compilation terminated.
查看gcc, g++版本
gcc --version | head -n1
g++ --version | head -n1
发现gcc的是anaconda中的,g++则是系统自带的:
gcc (Anaconda gcc) 11.2.0
g++ (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
直接运行以下命令即可
conda install -c conda-forge cxx-compiler
也可以查找某个具体的版本:
conda search -c conda-forge gxx_linux-64
比如需要安装 11.2.0
conda install -c conda-forge gxx_linux-64=11.2.0
conda install -c conda-forge cxx-compiler
我这里有个小bug
CondaVerificationError: The package for gcc located at xxx/pkgs/gcc-11.2.0-h702ea55_10
appears to be corrupted. The path 'bin/gcov-tool'
specified in the package manifest cannot be found.
去把 xxx/pkgs/gcc-11.2.0-h702ea55_10
删除即可。