How can I make Conda find cc1plus?

Viewed 1417

When I am compiling a package on Ubuntu, I am getting this error

x86_64-conda_cos6-linux-gnu-cc: error trying to exec 'cc1plus': execvp: No such file or directory

All my necessary libraries are in a conda environment named CUSENV

Diagnosis

After conda environment activation:

  1. find /usr -name "cc1plus"

/usr/lib/gcc/x86_64-linux-gnu/7/cc1plus

  1. I can also see this executable: /home/ms/anaconda3/envs/CUSENV/libexec/gcc/x86_64-unknown-linux-gnu/4.8.5/cc1plus

  2. echo $PATH

/home/ms/anaconda3/envs/CUSENV/bin:/home/ms/anaconda3/bin:/home/ms/anaconda3/bin:/home/ms/anaconda3/bin:/home/ms/anaconda3/bin:/home/ms/anaconda3/condabin:/home/ms/anaconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

How can I connect this cc1plus correctly?

1 Answers

you should first install g++

conda install -c conda-forge gxx_linux-64

then

cd /home/ms/anaconda3/envs/CUSENV/bin
ln -s /home/ms/anaconda3/envs/CUSENV/bin/x86_64-conda_cos6-linux-gnu-g++ g++
Related