Skip to content

Commit

Permalink
BUG: Set CUDAToolkit_ROOT to the cross-compile root (#102)
Browse files Browse the repository at this point in the history
automerged PR by conda-forge/automerge-action
  • Loading branch information
github-actions[bot] authored Oct 9, 2023
2 parents 008491c + 5fcc5b1 commit c015995
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 54 deletions.
53 changes: 8 additions & 45 deletions .azure-pipelines/azure-pipelines-win.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .scripts/logging_utils.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 112 additions & 0 deletions .scripts/run_win_build.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion recipe/linux/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,20 @@ fi

if [[ "${CONDA_BUILD_CROSS_COMPILATION:-0}" == "1" ]]; then
if [[ "${target_platform:-}" == "linux-aarch64" ]]; then
TARGET_ROOT=/targets/sbsa-linux
LIBCUDA_STUB_FILE="${CUDA_HOME}/targets/sbsa-linux/lib/stubs/libcuda.so"
CUDA_INCLUDE_DIR="${CUDA_HOME}/targets/sbsa-linux/include"
elif [[ "${target_platform:-}" == "linux-ppc64le" ]]; then
TARGET_ROOT=/targets/ppc64le-linux
LIBCUDA_STUB_FILE="${CUDA_HOME}/targets/ppc64le-linux/lib/stubs/libcuda.so"
CUDA_INCLUDE_DIR="${CUDA_HOME}/targets/ppc64le-linux/include"
elif [[ "${target_platform:-}" == "linux-64" ]]; then
TARGET_ROOT=/targets/x86_64-linux
LIBCUDA_STUB_FILE="${CUDA_HOME}/targets/x86_64-linux/lib/stubs/libcuda.so"
CUDA_INCLUDE_DIR="${CUDA_HOME}/targets/x86_64-linux/include"
fi
else
TARGET_ROOT=""
LIBCUDA_STUB_FILE="${CUDA_HOME}/lib64/stubs/libcuda.so"
CUDA_INCLUDE_DIR="${CUDA_HOME}/include"
fi
Expand Down Expand Up @@ -95,7 +99,7 @@ export CXXFLAGS="${CXXFLAGS} -isystem ${CUDA_INCLUDE_DIR}"
# CMake looks up components in CUDA_PATH, not CUDA_HOME
export CUDA_PATH="${CUDA_HOME}"
# New-style CUDA integrations in CMake
CMAKE_ARGS="${CMAKE_ARGS:-} -DCUDAToolkit_ROOT=${CUDA_HOME}"
CMAKE_ARGS="${CMAKE_ARGS:-} -DCUDAToolkit_ROOT=${CUDA_HOME}${TARGET_ROOT}"
# Old-style CUDA integrations in CMake
## See https://github.com/conda-forge/nvcc-feedstock/pull/58#issuecomment-752179349
CMAKE_ARGS+=" -DCUDA_TOOLKIT_ROOT_DIR=${CUDA_HOME}"
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "nvcc" %}
{% set number = 22 %}
{% set number = 23 %}

{% if cuda_compiler_version in (None, "None", True, False) %}
{% set cuda_major = 0 %}
Expand Down

0 comments on commit c015995

Please sign in to comment.