Open edisongustavo opened 4 years ago
cc: @jjhelmus
The GCC activation packages are build from this recipe in the AnacondaRecipes/aggregate repository. Adding activation script for the fish shell would be a welcome addition but are not something that are a high priority for the Anaconda team.
any workaround for fish users in the meantime?
@rishabh-ranjan Here is my temporary script for now. This probably won't work for you out of the box, but just tweak it a bit yourself. The most important variables are of course the first three lines. From there, I encountered an issue where it says #include <stdio.h>
not found (on a dummy c file I tested). To debug that, do $CC a.c -v
, and see where it's searching. Next, start another session that uses a normal shell (not sure what the terminology is, but I think it's called "UNIX-compatible") that works with the activate.sh
files, then activate your conda environment, and run the same command $CC a.c -v
. Then, look at env | grep ...
and copy out the relevant environment variables, which in my case is SDKROOT
, though I imagine it'll be different on non-Mac systems. Just repeat the process until you get all the environment variables. Looking at the activation source files at $CONDA_PREFIX/etc/conda/activate.d
will also help, seeing what environment variables are set. I will see if I have time to port the files to .fish
later.
#!/bin/bash
set -gx CC $CONDA_PREFIX/bin/x86_64-apple-darwin13.4.0-clang
set -gx CXX $CONDA_PREFIX/bin/x86_64-apple-darwin13.4.0-clang++
set -gx FC $CONDA_PREFIX/bin/x86_64-apple-darwin13.4.0-gfortran
set -gx SDKROOT "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
set -gx CXXFLAGS_USED "-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem $CONDA_PREFIX/include"
set -gx DEBUG_CXXFLAGS_USED "-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -Og -g -Wall -Wextra -isystem $CONDA_PREFIX/include"
set -gx CFLAGS_USED "-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem $CONDA_PREFIX/include"
set -gx DEBUG_CFLAGS_USED "-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -Og -g -Wall -Wextra -isystem $CONDA_PREFIX/include"
set -gx LDFLAGS_USED "-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
set -gx LDFLAGS_LD_USED "-pie -headerpad_max_install_names -dead_strip_dylibs -rpath $CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
set -gx CPPFLAGS_USED "-D_FORTIFY_SOURCE=2 -isystem $CONDA_PREFIX/include"
set -gx CMAKE_PREFIX_PATH_USED "$CMAKE_PREFIX_PATH:$CONDA_PREFIX"
set -gx CFLAGS "-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem $CONDA_PREFIX/include"
For me it worked after executing this:
set -gx CONDA_BUILD_SYSROOT $CONDA_PREFIX/x86_64-conda-linux-gnu/sysroot
Would be useful to have conda working with fish natively though
Actual Behavior
My shell is set to fish shell.
When using the compiler tools (
gcc_linux-64
orgxx_linux-64
) the environment variables required to use these compilers are not set when using a fish shell:This differs from what happens when using bash where all the environment variables are correctly set.
This happens because the package
gcc_linux-64
only provides 1 activation file:etc/conda/activate.d/activate-gcc_linux-64.sh
and not a fish version.Expected Behavior
The environment variables are correctly set.
Steps to Reproduce
Grab environment variables in fish:
Grab environment variables in bash:
Now the diff:
Anaconda or Miniconda version:
Operating System:
cat ~/.config/fish/config.fish
conda info
conda list --show-channel-urls