Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

How to force Conda to use gcc found at /usr/bin/gcc?

Writer Matthew Barrera

On Ubuntu 18.04 I run which gcc and the output is as expected.

ubuntu@USER1:~$ which gcc
/usr/bin/gcc

However when I activate my conda environment and run which gcc I get:

(tensorflow_p36) ubuntu@USER1:~$ which gcc
/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/gcc

This location seems strange to me. I wan to use the normal system wide gcc.

I know this is not default behaviour as in my other Ubuntu instance when I run which gcc the output is correct:

(tensorflow_p36) ubuntu@USER2:~$ which gcc
/usr/bin/gcc

How can I get conda to use the default gcc as shown with USER2?


EDIT:

USER1 instance: conda 4.5.12

(tensorflow_p36) ubuntu@USER1:~$ gcc -v
Reading specs from /home/ubuntu/anaconda3/envs/tensorflow_p36/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.5/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.5/lto-wrapper
Target: x86_64-unknown-linux-gnu
Thread model: posix
gcc version 4.8.5 (GCC)

but

ubuntu@USER1:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Thread model: posix
gcc version 8.3.0 (Ubuntu 8.3.0-6ubuntu1~18.04.1) 

1 Answer

According to ,

Anaconda 5.0 switched from OS-provided compiler tools to our own toolsets. This allows improved compiler capabilities, including better security and performance. This page describes how to use these tools and enable these benefits.

You will have to remove the gcc provided by conda. to do so, use conda remove gcc_linux-64. to verify use To confirm that a package has been removed: conda list Now, close the terminal and re-check

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy