conda-forge / ctng-compiler-activation-feedstock

A conda-smithy repository for ctng-compiler-activation.
BSD 3-Clause "New" or "Revised" License
13 stars 22 forks source link

Installing gcc does not add it in the PATH of the conda environment #52

Closed jerkstorecaller closed 3 years ago

jerkstorecaller commented 3 years ago

Issue: After installing gcc11 using the commands below, the gcc invoked when the conda environment is activated is not the one from your packages, but the system gcc. Is this appropriate? The user has to set their own environment variables to make your gcc packages callable. Seems to me this goes counter to the benefit of creating a conda environment.

conda create --name gcc11
conda activate gcc11
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install gcc_linux-64   (installs gcc11)
gcc --version (prints 9.3, my system gcc, since it's calling /usr/bin/gcc)
~/miniconda3/envs/gcc11/libexec/gcc/x86_64-conda-linux-gnu/11.1.0/gcc --version (prints 11.1)

Specifically:

(gcc11) user@ubuntu2004:~$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

(gcc11) user@ubuntu2004:~$ $ ~/miniconda3/envs/gcc11/libexec/gcc/x86_64-conda-linux-gnu/11.1.0/gcc --version
gcc (GCC) 11.1.0


Environment (conda list):

(gcc11) user@ubuntu2004:~$ conda list
# packages in environment at /home/user/miniconda3/envs/gcc11:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
binutils_impl_linux-64    2.36.1               h193b22a_2    conda-forge
binutils_linux-64         2.36                 hf3e587d_0    conda-forge
gcc_impl_linux-64         11.1.0               h6b5115b_8    conda-forge
gcc_linux-64              11.1.0               h97fdae6_0    conda-forge
kernel-headers_linux-64   2.6.32              he073ed8_14    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libgcc-devel_linux-64     11.1.0               h80e7780_8    conda-forge
libgcc-ng                 11.1.0               hc902ee8_8    conda-forge
libgomp                   11.1.0               hc902ee8_8    conda-forge
libsanitizer              11.1.0               h56837e0_8    conda-forge
libstdcxx-ng              11.1.0               h56837e0_8    conda-forge
sysroot_linux-64          2.12                he073ed8_14    conda-forge


Details about conda and system ( conda info ):

``` (gcc11) user@ubuntu2004:~$ conda info active environment : gcc11 active env location : /home/user/miniconda3/envs/gcc11 shell level : 2 user config file : /home/user/.condarc populated config files : /home/user/.condarc conda version : 4.10.3 conda-build version : not installed python version : 3.9.5.final.0 virtual packages : __linux=5.4.0=0 __glibc=2.31=0 __unix=0=0 __archspec=1=x86_64 base environment : /home/user/miniconda3 (writable) conda av data dir : /home/user/miniconda3/etc/conda conda av metadata url : None channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/user/miniconda3/pkgs /home/user/.conda/pkgs envs directories : /home/user/miniconda3/envs /home/user/.conda/envs platform : linux-64 user-agent : conda/4.10.3 requests/2.25.1 CPython/3.9.5 Linux/5.4.0-80-generic ubuntu/20.04.2 glibc/2.31 UID:GID : 1000:1000 netrc file : None offline mode : False ```
isuruf commented 3 years ago

Use compilers package.

isuruf commented 3 years ago

Or gcc=11

jerkstorecaller commented 3 years ago

"Use gcc=11"

I'm not sure what you mean by this. As you can see in the issue description, I already installed gcc 11.1.0 using your gcc_linux-64 package, the issue I'm reporting is that it's not in PATH when the environment is activated, so the environment keeps using the system gcc unless the user creates custom tweaks to the conda environment's environment variables.

"Use compilers package."

Reading the description, this installs the compilers used by conda-forge to build the packages that get downloaded by users. How does that help end-users use one of your compiler packages in their environment? Does it matter which compiler you used to create the packages we download?

I'm new to Conda so I might be missing something here, but I think you misunderstood the issue I was reporting.

Anyway, I decided to stop using conda, because it's so fragile I can't rely on it. Package installation randomly freezes/takes forever while "collecting package metadata", and cleaning caches doesn't always fix it. I couldn't even "conda install compilers" today to try what you said. Even after nuking everything and starting over, Miniconda3-latest-Linux-x86_64.sh can't install anymore due to "KeyError('pkgs_dirs')". And this is on Ubuntu 20.04, I can't imagine what it's like on less popular distros. I'll wait a few years until conda is a bit more stable and you ironed out the mistakes. Cheers.