-
Notifications
You must be signed in to change notification settings - Fork 202
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
Update CMakeLists to support newer CMake versions #1077
base: master
Are you sure you want to change the base?
Conversation
Thank you very much but can you make the pull request compatible with older versions of CMake? |
CUDAToolkit was added in 3.10, and distributions as far back as RHEL/CentOS 7 all have at least 3.10 available in their repos. A user would need to be running RHEL 6 or older (which don't even support cmake 3.0) to not have CUDAToolkit support in their cmake install. This pr essentially makes the requirement cmake 3.10 instead of cmake 3.0. |
Isn't it just adding if-else with CMake version checks? |
@Qiangong2, as @biochem-fan said, I would suggest suggest:
|
Thanks to @FilipeMaia for the if/else statement
Added in the if/else statement as requested. I can verify it builds and runs without issue. |
Thank you very much.
Did you test on versions both before and after 3.10? |
I don't have a machine old enough to test if it works before 3.10, but since the if statement would use FIND_PACKAGE(CUDA) if it returned true, I believe it is functional. |
In I looked at FindCUDA documentation:
None of the pages linked from here mention |
FIND_PACKAGE(CUDA) was deprecated starting with cmake 3.10 and flat out removed in cmake 3.27. For machines in environments with strict update requirements, this breaks compilation on newer systems.
FIND_PACKAGE(CUDAToolkit) works the exact same way, and is supported by cmake.
Thanks to the NERSC team for identifying the issue.