conda-forge / compilers-feedstock

A conda-smithy repository for compilers.
BSD 3-Clause "New" or "Revised" License
9 stars 17 forks source link

Deactivation script for gfortran does not unset all variables set by activation script on macOS #20

Closed phil-blain closed 4 years ago

phil-blain commented 4 years ago

Issue: the deactivation script for gfortran does not unset all variables set by the activation script on macOS. These variables stay defined:

Also, the deactivation script has a verbose output:

$ conda deactivate 
INFO: deactivate-gfortran_osx-64.sh made the following environmental changes:
-DEBUG_FFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/Philippe/Logiciels/miniconda3/envs/cice/include -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments
-DEBUG_FORTRANFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/Philippe/Logiciels/miniconda3/envs/cice/include -march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments
-F95=/Users/Philippe/Logiciels/miniconda3/envs/cice/bin/x86_64-apple-darwin13.4.0-gfortran
-FC=/Users/Philippe/Logiciels/miniconda3/envs/cice/bin/x86_64-apple-darwin13.4.0-gfortran
-FFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/Philippe/Logiciels/miniconda3/envs/cice/include
-FORTRANFLAGS=-march=nocona -mtune=core2 -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/Philippe/Logiciels/miniconda3/envs/cice/include
-GFORTRAN=/Users/Philippe/Logiciels/miniconda3/envs/cice/bin/x86_64-apple-darwin13.4.0-gfortran


Environment (conda list | grep -e compiler -e gfortran -e clang -e binutils -e ld):

``` $ conda list | grep -e compiler -e gfortran -e clang -e binutils -e ld # Name Version Build Channel binutils-meta 1.0.4 0 conda-forge c-compiler 1.0.4 h1239861_0 conda-forge clang 9.0.1 default_hf57f61e_0 conda-forge clang_osx-64 9.0.1 h05bbb7f_0 conda-forge clangxx 9.0.1 default_hf57f61e_0 conda-forge clangxx_osx-64 9.0.1 h05bbb7f_0 conda-forge compiler-rt 9.0.1 h6a512c6_3 conda-forge compiler-rt_osx-64 9.0.1 h99342c6_3 conda-forge compilers 1.0.4 0 conda-forge cxx-compiler 1.0.4 h707564b_0 conda-forge fortran-compiler 1.0.4 he991be0_0 conda-forge gfortran_impl_osx-64 7.3.0 hf4212f2_2 conda-forge gfortran_osx-64 7.3.0 h22b1bf0_7 conda-forge ld64 450.3 h3c32e8a_4 conda-forge libgfortran 4.0.0 2 conda-forge ```


Details about conda and system ( conda info ):

``` $ conda info active environment : cice active env location : /Users/Philippe/Logiciels/miniconda3/envs/cice shell level : 1 user config file : /Users/Philippe/.condarc populated config files : /Users/Philippe/.condarc conda version : 4.8.2 conda-build version : 3.18.11 python version : 3.7.6.final.0 virtual packages : __osx=10.11.6 base environment : /Users/Philippe/Logiciels/miniconda3 (writable) channel URLs : https://conda.anaconda.org/conda-forge/osx-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/osx-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/osx-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /Users/Philippe/Logiciels/miniconda3/pkgs /Users/Philippe/.conda/pkgs envs directories : /Users/Philippe/Logiciels/miniconda3/envs /Users/Philippe/.conda/envs platform : osx-64 user-agent : conda/4.8.2 requests/2.22.0 CPython/3.7.6 Darwin/15.6.0 OSX/10.11.6 UID:GID : 502:20 netrc file : None offline mode : False ```
chrisburr commented 4 years ago

Thanks for the report @phil-blain.

If you're able to take a look at fixing it, the issue is probably in gfortran_osx-64-feedstock.

If not, @conda-forge/gfortran_osx-64 can you take a look?

beckermr commented 4 years ago

LDFLAGS and HOST are set by more than one compiler and so it is not clear if they are related to gfortran. The other two were missed and can be added.

beckermr commented 4 years ago

https://github.com/conda-forge/gfortran_osx-64-feedstock/pull/13

phil-blain commented 4 years ago

@chrisburr, @beckermr also I noticed none of the compiler activation/deactivation scripts have csh versions, would that be easy to add ?

beckermr commented 4 years ago

This is a bigger ask. They are spread across multiple feedstocks. Do you have a list of what is needed?

phil-blain commented 4 years ago

I'm only working on mac and linux, and on these platforms an environment created with conda create -c conda-forge -n compilers compilers has these scripts: on Linux:

$ ls -1 $CONDA_PREFIX/etc/conda/activate.d
activate-binutils_linux-64.sh
activate-gcc_linux-64.sh
activate-gfortran_linux-64.sh
activate-gxx_linux-64.sh

on macOS:

$ ls -1 $CONDA_PREFIX/etc/conda/activate.d
activate-gfortran_osx-64.sh
activate_clang_osx-64.sh
activate_clangxx_osx-64.sh

(the deactivation scripts are the same)

isuruf commented 4 years ago

Should be fixed now