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

remove duplication in compiler flag variables #992

Closed
psychocoderHPC opened this issue Apr 29, 2020 · 5 comments
Closed

remove duplication in compiler flag variables #992

psychocoderHPC opened this issue Apr 29, 2020 · 5 comments

Comments

@psychocoderHPC
Copy link
Member

psychocoderHPC commented Apr 29, 2020

Alpaka appends options to CUDA_NVCC_FLAGS, CMAKE_CXX_FLAGS, ...
In the case where the user is using a third party library which depends e.g. on CUDA and is also appending CUDA_NVCC_FLAGS it could be we pass options multiple times to the compiler.

IMO we should clean (remove duplicated options) CUDA_NVCC_FLAGS in our cmake macro alpaka_add_executable and alpaka_add_library. #991 provides the needs to use list(REMOVE_DUPLICATES LIST)

Currently alpaka is using a workaround for duplicated flags in CUDA_NVCC_FLAGS by removing the previous state.
The workaround as the issue that all flags provided by a third party cmake module will be removed when those are processed by cmake before alpaka.

I opened this PR for discussions about side effects I maybe missed if we fix the above described issues by using list(REMOVE_DUPLICATES LIST)

CC-ing: @alpaka-group/alpaka-maintainers

@BenjaminW3
Copy link
Member

@psychocoderHPC Do you still want to do something in alpaka about this?

@psychocoderHPC
Copy link
Member Author

Yes, to avoid side effects with other libraries but due to much work this has a low priority on my todo list.

@ax3l
Copy link
Member

ax3l commented May 27, 2020

Ideally, Alpaka does not add/modify to CMAKE_... flags unless it's the root CMake project.

With CUDA, luckily the next release will allow to set device link flags on targets and potentially also add Clang CUDA support, so we should be able to get rid of many hacks.

@j-stephan
Copy link
Member

The way we handle CUDA has changed over the past months. Is this still an issue?

@j-stephan
Copy link
Member

AFAIK we are assigning all flags to targets in our current CMake build system. This way CMake de-duplicates the flags by default. I'm closing this as completed; feel free to reopen if you think this still matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants