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

Ensure CMake finds CUDA libraries from host packages #24

Closed robertmaynard closed 1 year ago

robertmaynard commented 1 year ago

Checklist

Consider a conda recipe that looks like:

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - {{ compiler('cuda') }}
    - cmake >=3.26.4
    - sysroot_{{ target_platform }} 2.17
    - cuda-version =12.0
  host:
    - libcublas-dev
    - libcublas-static
    - cuda-version =12.0

We have placed the CUDA compiler in build as the compiler supports cross-compiling. We place the cublas libraries in host since it is only for the target platform we are building. Now since the compiler is in build it isn't aware of the host libraries and doesn't report those locations as implicit search dirs.

So for CMake to find the cublas libraries we need to extend CMAKE_FIND_ROOT_PATH to search $PREFIX/${targetsDir}.

conda-forge-webservices[bot] commented 1 year ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

jakirkham commented 1 year ago

cc @isuruf

jakirkham commented 1 year ago

Anything else needed here?