-
Notifications
You must be signed in to change notification settings - Fork 61
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 linker error for cuda shared builds #354
Conversation
I know a review wasn't requested from me, but LGTM. This is standard CMake for linking CUDA libs. There are other CMake targets available if you want to link against more / different libraries. https://cmake.org/cmake/help/latest/module/FindCUDAToolkit.html#cuda-runtime-library |
In general, this looks fine. I was going through the GPU build and I'm not sure I understand everything, but here some things I wanted to flag. (They may or many not be actual issues).
|
There are probably some other things that we should add related to CUDA: include(CheckLanguage)
check_language(CUDA) For if(NOT DEFINED CMAKE_CUDA_STANDARD)
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif() Then again, if we just call We should also probably co-locate the CUDA CMake code instead of having it a little scattered in
I think part of this would be aided by moving the compilation of some external dependencies to Spack, but let's not go down that rabbit hole for now (I have suggested doing this and still might). If we call
This is unclear to me. This depends on what headers/functionality you are using as a part of the Palace code. If you are having build issues / runtime issues and need more headers, then we would have to add more CUDA CMake targets.
I would hazard a guess that we will uncover a couple more things that need fixing along the way here, but that will require more testing apparatus. EDIT: I realized that we call |
|
Right, and don't we want that error in case something is wrong? I suppose if something's wrong, the error will happen at compile time anyway, not CMake configure time. |
I also added in a fix for some libceed/cuda includes that were causing issues elsewhere. |
When building with cuda on a shared build would fail with
Additionally address libceed issue with nvidia run time compiler identified in #343