新建conda环境
conda create -n da-faster python=3.6.7 #conda activate da-faster
2.安装合适的gcc版本,这里我选择的是4.8.5的
在anaconda库中选择合适的包,这里我选择的是这个版本
根据下方给出的语句进行安装
conda install -c conda-forge gcc
此时gcc还是默认的版本
gcc -vUsing built-in specs.COLLECT_GCC=gccCOLLECT_LTO_WRAPPER=/opt/ohpc/pub/compiler/gcc/7.3.0/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapperTarget: x86_64-pc-linux-gnuConfigured with: ../configure --disable-multilib --enable-languages=c,c++,fortran --prefix=/opt/ohpc/pub/compiler/gcc/7.3.0 --disable-static --enable-sharedThread model: posixgcc version 7.3.0 (GCC)
我们增加环境变量
vi ~/.bash_profile
在文件中增加
PATH=/home/yourpath/miniconda/envs/da-faster/bin:$PATH
执行`
source ~/.bash_profile
此时gcc就变为我们安装的版本了