Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework warning when compiler is installed in environment but activation scripts aren't #26

Open
1 task done
kkraus14 opened this issue Aug 10, 2023 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@kkraus14
Copy link

kkraus14 commented Aug 10, 2023

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

Currently, if you use the cuda-nvcc_{platform} package in an environment, it will try to detect if you don't have host compilers installed and warn you. This happens here:

if [ -z "${CXX+x}" ]; then
echo 'cuda-nvcc: Please add the `compiler("c")` and `compiler("cxx")` packages to the environment.'
ERROR=true
.

This makes sense when in the context of a conda build but not for a user in an environment. For a user in an environment, we should probably point them towards the c-compiler and cxx-compiler packages to maintain the current behavior.

Additionally, I intentionally avoid the c-compiler and cxx-compiler packages in my development environment because they set a bunch of compiler flags that I don't necessarily want (see https://github.com/conda-forge/ctng-compiler-activation-feedstock/blob/main/recipe/conda_build_config.yaml and https://github.com/conda-forge/ctng-compiler-activation-feedstock/blob/main/recipe/activate-gcc.sh). I do have the gcc and gxx packages installed which give me a set of host compilers to use.

I've worked around this for now by setting the CXX and CC environment variables to an activation script in my environment with something that looks like:

export CC=`which gcc`
export CXX=`which g++`

Installed packages

n/a

Environment info

n/a
@kkraus14 kkraus14 added the bug Something isn't working label Aug 10, 2023
@jakirkham
Copy link
Member

Thanks for raising this Keith! 🙏

Since this was opened, we added cuda-compiler for this purpose, which depends on c-compiler and cxx-compiler

Alternatively there is a lighter weight cuda-nvcc, which includes the host C and C++ compilers. This may be closer to your workflow

Please let us know what you think of these options 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants