conda-forge / cuda-nvcc-feedstock

A conda-smithy repository for cuda-nvcc.
BSD 3-Clause "New" or "Revised" License
1 stars 11 forks source link

Export include paths to CUDAFLAGS environment variable #18

Closed carterbox closed 1 year ago

carterbox commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

In addition to CFLAGS and CXXFLAGS, the activation script should also export CUDAFLAGS which is the environment variable checked by recent versions of CMAKE to add flags nvcc calls [1]. Something like:

export CUDAFLAGS="${CUDAFLAGS} ${CUDA_CFLAGS}"

CFLAGS and CXXFLAGS may not be applied when nvcc compiler is compiling .cu files, but external CUDA library headers are still needed. CMake adds CUDAFLAGS (CMAKE_CUDA_FLAGS) to these calls. I'm not sure if the linking flags are also needed.

[1] https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS.html

Installed packages

## Package Plan ##

  environment location: /home/conda/feedstock_root/build_artifacts/libmagma_1685576570416/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl

The following NEW packages will be INSTALLED:

    _libgcc_mutex:               0.1-conda_forge         conda-forge
    _openmp_mutex:               4.5-2_gnu               conda-forge
    cuda-cccl_linux-64:          12.0.90-ha770c72_1      conda-forge
    cuda-cudart:                 12.0.107-h59595ed_5     conda-forge
    cuda-cudart-dev:             12.0.107-h59595ed_5     conda-forge
    cuda-cudart-dev_linux-64:    12.0.107-h59595ed_5     conda-forge
    cuda-cudart-static:          12.0.107-h59595ed_5     conda-forge
    cuda-cudart-static_linux-64: 12.0.107-h59595ed_5     conda-forge
    cuda-cudart_linux-64:        12.0.107-h59595ed_5     conda-forge
    cuda-nvrtc:                  12.0.76-h59595ed_1      conda-forge
    cuda-version:                12.0-hffde075_2         conda-forge
    libblas:                     3.9.0-5_h92ddd45_netlib conda-forge
    libcublas:                   12.0.1.189-hcb278e6_2   conda-forge
    libcublas-dev:               12.0.1.189-hcb278e6_2   conda-forge
    libcusparse:                 12.0.0.76-hcb278e6_1    conda-forge
    libcusparse-dev:             12.0.0.76-hcb278e6_1    conda-forge
    libgcc-ng:                   12.2.0-h65d4601_19      conda-forge
    libgfortran-ng:              12.2.0-h69a702a_19      conda-forge
    libgfortran5:                12.2.0-h337968e_19      conda-forge
    libgomp:                     12.2.0-h65d4601_19      conda-forge
    liblapack:                   3.9.0-5_h92ddd45_netlib conda-forge
    libnvjitlink:                12.0.76-hcb278e6_1      conda-forge
    libstdcxx-ng:                12.2.0-h46fd767_19      conda-forge

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Reloading output folder: /home/conda/feedstock_root/build_artifacts
Reloading output folder: /home/conda/feedstock_root/build_artifacts

## Package Plan ##

  environment location: /home/conda/feedstock_root/build_artifacts/libmagma_1685576570416/_build_env

The following NEW packages will be INSTALLED:

    _libgcc_mutex:                        0.1-conda_forge            conda-forge
    _openmp_mutex:                        4.5-2_gnu                  conda-forge
    _sysroot_linux-64_curr_repodata_hack: 3-h69a702a_13              conda-forge
    binutils_impl_linux-64:               2.39-he00db2b_1            conda-forge
    binutils_linux-64:                    2.39-h5fc0e48_13           conda-forge
    bzip2:                                1.0.8-h7f98852_4           conda-forge
    c-ares:                               1.19.1-hd590300_0          conda-forge
    ca-certificates:                      2023.5.7-hbcca054_0        conda-forge
    cmake:                                3.26.4-hcfe8598_0          conda-forge
    cuda-cccl_linux-64:                   12.0.90-ha770c72_1         conda-forge
    cuda-cudart:                          12.0.107-h59595ed_5        conda-forge
    cuda-cudart-dev:                      12.0.107-h59595ed_5        conda-forge
    cuda-cudart-dev_linux-64:             12.0.107-h59595ed_5        conda-forge
    cuda-cudart-static:                   12.0.107-h59595ed_5        conda-forge
    cuda-cudart-static_linux-64:          12.0.107-h59595ed_5        conda-forge
    cuda-cudart_linux-64:                 12.0.107-h59595ed_5        conda-forge
    cuda-driver-dev_linux-64:             12.0.107-h59595ed_5        conda-forge
    cuda-nvcc-dev_linux-64:               12.0.76-ha770c72_0         conda-forge
    cuda-nvcc-impl:                       12.0.76-h59595ed_0         conda-forge
    cuda-nvcc-tools:                      12.0.76-h59595ed_0         conda-forge
    cuda-nvcc_linux-64:                   12.0.76-hba56722_5         conda-forge
    cuda-version:                         12.0-hffde075_2            conda-forge
    expat:                                2.5.0-hcb278e6_1           conda-forge
    gcc_impl_linux-64:                    12.2.0-hcc96c02_19         conda-forge
    gcc_linux-64:                         12.2.0-h4798a0e_13         conda-forge
    gxx_impl_linux-64:                    12.2.0-hcc96c02_19         conda-forge
    gxx_linux-64:                         12.2.0-hb41e900_13         conda-forge
    kernel-headers_linux-64:              3.10.0-h4a8ded7_13         conda-forge
    keyutils:                             1.6.1-h166bdaf_0           conda-forge
    krb5:                                 1.20.1-h81ceb04_0          conda-forge
    ld_impl_linux-64:                     2.39-hcc3a1bd_1            conda-forge
    libcurl:                              8.1.2-h409715c_0           conda-forge
    libedit:                              3.1.20191231-he28a2e2_2    conda-forge
    libev:                                4.33-h516909a_1            conda-forge
    libexpat:                             2.5.0-hcb278e6_1           conda-forge
    libffi:                               3.4.2-h7f98852_5           conda-forge
    libgcc-devel_linux-64:                12.2.0-h3b97bd3_19         conda-forge
    libgcc-ng:                            12.2.0-h65d4601_19         conda-forge
    libgomp:                              12.2.0-h65d4601_19         conda-forge
    libnghttp2:                           1.52.0-h61bc06f_0          conda-forge
    libnsl:                               2.0.0-h7f98852_0           conda-forge
    libsanitizer:                         12.2.0-h46fd767_19         conda-forge
    libsqlite:                            3.42.0-h2797004_0          conda-forge
    libssh2:                              1.10.0-hf14f497_3          conda-forge
    libstdcxx-devel_linux-64:             12.2.0-h3b97bd3_19         conda-forge
    libstdcxx-ng:                         12.2.0-h46fd767_19         conda-forge
    libuuid:                              2.38.1-h0b41bf4_0          conda-forge
    libuv:                                1.44.2-h166bdaf_0          conda-forge
    libzlib:                              1.2.13-h166bdaf_4          conda-forge
    make:                                 4.3-hd18ef5c_1             conda-forge
    ncurses:                              6.3-h27087fc_1             conda-forge
    ninja:                                1.11.1-h924138e_0          conda-forge
    openssl:                              3.1.1-hd590300_1           conda-forge
    python:                               3.10.11-he550d4f_0_cpython conda-forge
    readline:                             8.2-h8228510_1             conda-forge
    rhash:                                1.4.3-h166bdaf_0           conda-forge
    sysroot_linux-64:                     2.17-h4a8ded7_13           conda-forge
    tk:                                   8.6.12-h27826a3_0          conda-forge
    tzdata:                               2023c-h71feb2d_0           conda-forge
    xz:                                   5.2.6-h166bdaf_0           conda-forge
    zlib:                                 1.2.13-h166bdaf_4          conda-forge
    zstd:                                 1.5.2-h3eb15da_6           conda-forge

Environment info

libmagma-feedstock
bdice commented 1 year ago

Thanks for filing @carterbox! I ran into this issue as well. I can help file a PR tomorrow, unless someone else has bandwidth to do so first.