Skip to content

Commit

Permalink
Merge pull request #22 from robertmaynard/bug/use_nvcc_append_flags_f…
Browse files Browse the repository at this point in the history
…or_includes_and_link_dirs

Move implicit include and link dirs to end of compile line.
  • Loading branch information
adibbley authored Jun 28, 2023
2 parents df7b04f + f8820f2 commit 6a3beef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
19 changes: 14 additions & 5 deletions recipe/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,24 @@ else
export NVCC_PREPEND_FLAGS_BACKUP="${NVCC_PREPEND_FLAGS}"
fi
NVCC_PREPEND_FLAGS="${NVCC_PREPEND_FLAGS} -ccbin=${CXX}"
export NVCC_PREPEND_FLAGS

if [[ ! -z "${NVCC_APPEND_FLAGS+x}" ]]
then
export NVCC_APPEND_FLAGS_BACKUP="${NVCC_APPEND_FLAGS}"
fi
# 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.
# nvcc is installed. We do this using `NVCC_APPEND_FLAGS` so that it
# goes last on the compiler/link line. This ensures that these flags
# match the behavior of the other implicit flags of the compiler, allowing
# for user overrides.
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"
NVCC_APPEND_FLAGS="${NVCC_APPEND_FLAGS} -I${PREFIX}/${targetsDir}/include"
NVCC_APPEND_FLAGS="${NVCC_APPEND_FLAGS} -L${PREFIX}/${targetsDir}/lib"
NVCC_APPEND_FLAGS="${NVCC_APPEND_FLAGS} -L${PREFIX}/${targetsDir}/lib/stubs"
fi
export NVCC_PREPEND_FLAGS
export NVCC_APPEND_FLAGS
fi

# Exit with unclean status if there was an error
Expand Down
6 changes: 6 additions & 0 deletions recipe/deactivate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ then
export NVCC_PREPEND_FLAGS="${NVCC_PREPEND_FLAGS_BACKUP}"
unset NVCC_PREPEND_FLAGS_BACKUP
fi

if [[ ! -z "${NVCC_APPEND_FLAGS_BACKUP+x}" ]]
then
export NVCC_PREPEND_FLAGS="${NVCC_APPEND_FLAGS_BACKUP}"
unset NVCC_APPEND_FLAGS_BACKUP
fi
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: 7
number: 8
skip: true # [osx or win]
skip: true # [target_platform != "linux-64" and target_platform != cross_target_platform]

Expand Down

0 comments on commit 6a3beef

Please sign in to comment.