Error out for all builds with RDC and BUILD_SHARED_LIBS
#8196
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using relocatable device code, the object that this code gets linked into has to be a static library. nvcc sneaks it into its example section via "Note that only static libraries are supported by the device linker." clang is even less vague and I had to dig through the issue trying to follow their discussion examples to find that their support for that in shared lib is still a long way to go.
FWICT this is not working in
nvcc
orclang
reliably. Thus I propose to error out in allRDC
builds that also requireBUILD_SHARED_LIBS
@tpadioleau this will need to be adapted in spack as I saw you did for cuda+rdc
For reference: if users want to build shared libs using device code in the end, they can link the part of their lib that uses device code/Kokkos as a static lib and integrate that into a shared lib later