I was trying to pip install a simple package that contained wheels that needed to be compiled with both GCC and G++. Of course, without using SUDO (i.e., yum install gcc) meant that I needed to rely on my good friend, Conda:

conda install gcc_linux-64
conda install gxx_linux-64



Now, we aren’t done yet! According to the conda documentation, the compilers are found in /path/to/anaconda/bin but the gcc and g++executables are prefixed with something like x86_64-conda-cos6-linux-gnu-gcc. So, we’ll need to create some symbolic links to these executables:

ln -s /path/to/anaconda/bin/x86_64-conda-cos6-linux-gnu-gcc /path/to/anaconda/bin/gcc
ln -s /path/to/anaconda/bin/x86_64-conda-cos6-linux-gnu-g++ /path/to/anaconda/bin/g++



Alternatively, you can avoid the symbolic link by setting your environment variables accordingly

export CC=/path/to/anaconda/bin/x86_64-conda_cos6-linux-gnu-gcc
export CXX=/path/to/anaconda/bin/x86_64-conda_cos6-linux-gnu-g++



Now, my pip install command is able to compile the wheel successfully!


Published

Jan 17, 2019