-
Notifications
You must be signed in to change notification settings - Fork 407
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
Fix dedup of linker flags for shared libs on cmake <= 3.12 #3176
Conversation
Can you describe a situation where we run into problems, i.e., warnings or errors? Building
in the link step (using CMake 3.10.2). |
This happens in the build for kokkoscontainers. It gets double |
Su you get errors when building |
And the final output is:
|
OK, I am seeing
but no error with CUDA11 or CUDA9 and I can compile a dummy project with the options you posted.
As expected they only differ by the duplicated Even though I don't see the error with a current version, I am fine with this pull request. |
Testing is currently missing issues with shared library builds.
Because CMake <= 3.12 does not provide a 'target_link_options', you have to hack link options through
target_link_libraries
. These do not get effectively deduplicated. This leads to the same flag appearing multiple times on the link lines in certain cases. For the-arch=X
flag with nvcc, this causes an actual error.This only adds flags to kokkoscore avoiding the need for deduplication.