conda install -c anaconda gcc_linux-64未使用 [英] conda install -c anaconda gcc_linux-64 not being used
问题描述
我想在没有root用户访问权限的服务器上安装gcc的更新版本.我试过了
conda install -c creditx gcc-7
这是行不通的.然后我发现
conda install -c anaconda gcc_linux-64
实际上安装了gccv7.3.但是成功安装后,conda环境仍在以下位置使用系统gcc
/usr/bin/gcc
I wanted to install updated version of gcc on a server where I do not have root access. I tried
conda install -c creditx gcc-7
which was not working. Then I found
conda install -c anaconda gcc_linux-64
in fact installs gccv7.3. But after the successful installation, the conda environment still uses the system gcc at
/usr/bin/gcc
请帮助我,以便我可以使用刚刚安装的gcc v7.3.
Please help me so that I can use the gcc v7.3 that I just installed.
推荐答案
如此处所述: 1)编译器软件包中的所有可执行文件都带有前缀".代替gcc,您使用的编译器的可执行文件名称将类似于x86_64-conda_cos6-linux-gnu-gcc
1) All of the executables in a compiler package are "prefixed." Instead of gcc, the executable name of the compiler you use will be something like x86_64-conda_cos6-linux-gnu-gcc
2)默认情况下,许多构建工具(例如make和CMake)都针对名为gcc的编译器进行搜索,因此我们设置了环境变量以将这些工具指向正确的编译器.
2) Many build tools such as make and CMake search by default for a compiler named simply gcc, so we set environment variables to point these tools to the correct compiler.
因此,如果您运行:
conda create -n cc_env gcc_linux-64
conda activate cc_env
ls $CONDA_PREFIX/bin
您将看到一堆带有前缀名称的编译器工具:
You will see a bunch of compiler tools with the prefixed name:
c89 x86_64-conda_cos6-linux-gnu-ct-ng.config x86_64-conda_cos6-linux-gnu-gcov-dump x86_64-conda_cos6-linux-gnu-objdump
c99 x86_64-conda_cos6-linux-gnu-dwp x86_64-conda_cos6-linux-gnu-gcov-tool x86_64-conda_cos6-linux-gnu-ranlib
x86_64-conda_cos6-linux-gnu-addr2line x86_64-conda_cos6-linux-gnu-elfedit x86_64-conda_cos6-linux-gnu-gprof x86_64-conda_cos6-linux-gnu-readelf
x86_64-conda_cos6-linux-gnu-ar x86_64-conda_cos6-linux-gnu-gcc x86_64-conda_cos6-linux-gnu-ld x86_64-conda_cos6-linux-gnu-size
x86_64-conda_cos6-linux-gnu-as x86_64-conda_cos6-linux-gnu-gcc-ar x86_64-conda_cos6-linux-gnu-ld.bfd x86_64-conda_cos6-linux-gnu-strings
x86_64-conda_cos6-linux-gnu-cc x86_64-conda_cos6-linux-gnu-gcc-nm x86_64-conda_cos6-linux-gnu-ld.gold x86_64-conda_cos6-linux-gnu-strip
x86_64-conda_cos6-linux-gnu-c++filt x86_64-conda_cos6-linux-gnu-gcc-ranlib x86_64-conda_cos6-linux-gnu-nm
x86_64-conda_cos6-linux-gnu-cpp x86_64-conda_cos6-linux-gnu-gcov x86_64-conda_cos6-linux-gnu-objcopy
这是可以的,因为诸如CC和CPP之类的环境变量指向要使用的编译器,并且使诸如make之类的命令知道要使用这些变量:
This is ok because environment variables like CC and CPP are pointing to the compiler to use, and commands like make know to use these variable:
$ echo $CC
/home/builder/anaconda3/envs/cc_env/bin/x86_64-conda_cos6-linux-gnu-cc
$ echo $CPP
/home/builder/anaconda3/envs/cc_env/bin/x86_64-conda_cos6-linux-gnu-cpp
有关可以了解哪些环境变量的更多信息,请参见: https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
For more info on what environment variables make is aware of see: https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
这篇关于conda install -c anaconda gcc_linux-64未使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!