3

I'm using a Linux system (in which I don't have sudo access) which already had gcc installed.

I have to run some software, which requires stuff like cmake, bison and flex, and I installed them with Anaconda.

Since the cmake version I need also required a more recent version of gcc (the one on the system is gcc 4.8?), I also installed this with Anaconda.

I installed: gcc_linux-64 and gxx_linux-64

However, when I try to compile my software, I always get errors from the cmake:

cmake: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by cmake)
cmake: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by cmake)
cmake: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by cmake)
cmake: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by cmake)

However, as can be seen, even though I installed a new version of gcc and g++ with anaconda, cmake still fetches the libraries from the old system installation.

I tried deactivating and activating the environment again, restarting bash, but the behaviour is the same.

I also tried:

$ which gcc
/usr/bin/gcc

but when I do

$ printenv | grep CXX

CXXFLAGS=-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe
CXXFILT=/home/myuseraccount/bulk/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++filt
DEBUG_CXXFLAGS=-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-all -fno-plt -Og -g -Wall -Wextra -fvar-tracking-assignments -pipe
CXX=/home/myuseraccount/bulk/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++


$ printenv | grep GCC

GCC_NM=/home/myuseraccount/bulk/anaconda3/bin/x86_64-conda_cos6-linux-gnu-gcc-nm
GCC_RANLIB=/home/myuseraccount/bulk/anaconda3/bin/x86_64-conda_cos6-linux-gnu-gcc-ranlib
GCC=/home/myuseraccount/bulk/anaconda3/bin/x86_64-conda_cos6-linux-gnu-gcc
GCC_AR=/home/myuseraccount/bulk/anaconda3/bin/x86_64-conda_cos6-linux-gnu-gcc-ar

... which appears to be right?

Any help appreciated!

Kelthar
  • 33
  • 1
  • 3
  • Those environment variables apply to the `anaconda` version of `gcc` whereas you are using the system `gcc` located at `/usr/bin/gcc`. If you need a later version and you don't have `sudo` then you can build it from source in your `/home/myuseraccount` directory and then prepend the `bin` and `lib64` directories to your respective `PATH` and `LD_LIBRARY_PATH` and then start a new shell session. – Nasir Riley Apr 06 '19 at 16:56
  • 1
    You don't have to build from source, you just need to make sure the right GCC is detected on your PATH first. See: https://unix.stackexchange.com/a/3820 – Niayesh Isky Apr 06 '19 at 18:54
  • 2
    What I'm surprised is: isn't this what anaconda should do when I run 'conda activate'? I thought that changed (while active) the path variables to the ones in conda, and I do have the anaconda version of gcc already installed. In this case, shouldn't running 'conda activate' replace the gcc command to run the conda gcc version? – Kelthar Apr 06 '19 at 19:52
  • I have the same impression @Kelthar – User 10482 Jun 08 '21 at 14:24

0 Answers0