-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
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 ( |
@conda-forge-admin, please rerender |
…nda-forge-pinning 2023.06.02.16.26.35
recipe/activate.sh
Outdated
@@ -27,6 +27,7 @@ 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}" | |||
export CUDAFLAGS="${CUDAFLAGS} ${CUDA_CFLAGS}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want the LDFLAGS
too or just CFLAGS
?
export CUDAFLAGS="${CUDAFLAGS} ${CUDA_CFLAGS}" | |
export CUDAFLAGS="${CUDAFLAGS} ${CUDA_CFLAGS} ${CUDA_LDFLAGS}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the library paths are needed because NVCC isn't being used as a linker? For example, the libmagma feedstock (which has separable compilation off for linux) uses GCC to link all of the generated object files as the last step, not NVCC. The library paths are only needed at link-time, the headers are only needed at compile time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if people ever use the NVCC CLI for linking or whether NVCC accepts / passes these args down to the host compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CUDA_LDFLAGS
should only be in LDFLAGS. I don't know why CUDA_LDFLAGS
was added to CXXFLAGS
and friends. That's clearly wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should go in a separate issue or PR? Doesn't seem related to Daniel's initial request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored this part of the PR to match upstream. Some else can fix the LDFLAGS issue if they feel strongly about it.
Thanks Daniel! 🙏 Had a question above 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think it would be reasonable to handle the LDFLAGS
changes in a separate PR as that was not part of the original changes here
That said, if the OP wants to include them here, the CUDA_*
variables likely need other updates (to include library search paths)
recipe/activate.sh
Outdated
@@ -27,6 +27,7 @@ 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}" | |||
export CUDAFLAGS="${CUDAFLAGS} ${CUDA_CFLAGS}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should go in a separate issue or PR? Doesn't seem related to Daniel's initial request
The complementary part of this PR is found in conda-forge/cuda-nvcc-impl-feedstock#2
…nda-forge-pinning 2023.06.06.09.57.57
The complementary part exists in conda-forge/cuda-nvcc-feedstock#19
I don't think we should introduce new env variables into the mix. Better to use |
…nda-forge-pinning 2023.06.06.09.57.57
I tested this on a local build of the magma-feedstock. It seems to work, but silently. i.e. The args don't appear in the build logs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Daniel! 🙏
This seems reasonable. Had a couple follow up questions
Maybe we should considering adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested these changes locally and can confirm it fixes the issues I saw in the conda build process for nvcc in the build environment to search the host environment.
This is the one, people. Let's get this patch out before the CUDA 12 migration is too far along. 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Daniel! 🙏
If it's ok, would set -ccbin
first (included a suggestion)
Otherwise agree. Let's merge after that 🙂
Thanks Daniel for the PR and everyone for reviewing! 🙏 Let's get this change out. We can follow up on anything else separately |
I wanted to use a different env variable and inject into |
Adds the host requirements prefix include-paths and linking-search-paths to the NVCC_PREPEND_FLAGS for conda-build (because those two prefixes are separate) by using an activation script only when conda-build is active.
Outside of the conda-build context, these paths are not needed because nvcc would share a prefix with all the cuda libs.
I didn't do anything for Windows because it's skipped.
Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)Closes #18
Closes conda-forge/libcublas-feedstock#11
Requires conda-forge/cuda-nvcc-impl-feedstock#2