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

Add host prefix to NVCC_PREPEND_FLAGS when using conda-build #19

Merged
merged 11 commits into from
Jun 7, 2023
13 changes: 11 additions & 2 deletions recipe/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ else
CUDA_LDFLAGS="${CUDA_LDFLAGS} -L${CONDA_PREFIX}/${targetsDir}/lib"
CUDA_LDFLAGS="${CUDA_LDFLAGS} -L${CONDA_PREFIX}/${targetsDir}/lib/stubs"
fi

export CFLAGS="${CFLAGS} ${CUDA_CFLAGS} ${CUDA_LDFLAGS}"
export CPPFLAGS="${CPPFLAGS} ${CUDA_CFLAGS} ${CUDA_LDFLAGS}"
export CXXFLAGS="${CXXFLAGS} ${CUDA_CFLAGS} ${CUDA_LDFLAGS}"
export LDFLAGS="${LDFLAGS} ${CUDA_LDFLAGS}"

if [ -z "${CXX+x}" ]; then
echo 'cuda-nvcc: Please add the `compiler("c")` and `compiler("cxx")` packages to the environment.'
ERROR=true
Expand All @@ -35,7 +35,16 @@ else
then
export NVCC_PREPEND_FLAGS_BACKUP="${NVCC_PREPEND_FLAGS}"
fi
export NVCC_PREPEND_FLAGS="${NVCC_PREPEND_FLAGS} -ccbin=${CXX}"
NVCC_PREPEND_FLAGS="${NVCC_PREPEND_FLAGS} -ccbin=${CXX}"
# For conda-build we add the host requirements prefix to the include- and
# link-paths for nvcc because it is separate from the build prefix where
# nvcc is installed.
if [ "${CONDA_BUILD:-0}" = "1" ]; then
NVCC_PREPEND_FLAGS="${NVCC_PREPEND_FLAGS} -I${PREFIX}/${targetsDir}/include"
NVCC_PREPEND_FLAGS="${NVCC_PREPEND_FLAGS} -L${PREFIX}/${targetsDir}/lib"
NVCC_PREPEND_FLAGS="${NVCC_PREPEND_FLAGS} -L${PREFIX}/${targetsDir}/lib/stubs"
fi
export NVCC_PREPEND_FLAGS
fi

# Exit with unclean status if there was an error
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ source:
sha256: 5db25d4fd138013b563f9a3d1d87f7de7df1dac014fd4cccdfbb3435a5cff761

build:
number: 5
number: 6
skip: true # [osx or win]
skip: true # [target_platform != "linux-64" and target_platform != cross_target_platform]

Expand Down