-
Notifications
You must be signed in to change notification settings - Fork 39
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
CMake AnyNewerVersion
-> SameMajorVersion
#1188
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we conditionally us a version range when cmake is recent enough and we defer the actual update of our cmake minimum requirement?
This means that users cannot support both 1.x and 2.x versions in their own code. That's going to be a pain. |
For the current CMake, we switch to
|
I want to be able to require a minimum version because older versions did not have ray tracing. |
Why not require ArborX 2.0? Though, that would likely only work for something small like Adamantine. Not sure about deal.II. |
Yes, I could live with |
According to the standard ([cpp.cond].11)
This reads to me that for I tested it and it indeed seems to work. |
So, we have three ways to proceed:
In 2, if we start requiring CMake 3.19 in ArborX, this would essentially tell users what CMake to use implicitly. I think option 3 is a mistake, as it break unsuspecting user's codes during compilation instead of configuration. We need to move forward somehow. |
The current status quo, that is option 3, is clearly not viable. I think that bumping our minimum cmake version requirement is not an issue. For reference, Trilinos is currently requiring 3.23. On the Kokkos side, we will likely wait until next summer and the release of 5.0. |
Let's go with option 2. It expresses better what is our current requirement, Option 1 and 2 are currently equivalent. They will only differ when we get to version 3 and at that time we can still decide to use option 1. |
So, bump CMake (to 3.19?) and go with option 2? |
Yes, let's do that |
For the record, CMake 3.16 was released November 2019, CMake 3.19 November 2020, and CMake 3.22 November 2021. Default versions: |
d6e47a3
to
e48e04b
Compare
Configuration errors in the Windows build:
Weird. It used to be a warning in the Windows build. Did updating CMake made it an error? |
Frontier has a 3.27.9 module. I would require 3.22 |
Why 3.22? And what's Kokkos plan for CMake version update? |
Arbitrary, based on the 22.04 LTS. |
e48e04b
to
ba2667d
Compare
project(ArborX CXX) | ||
|
||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.30.0) | ||
message(STATUS "Setting policy CMP0167 to use FindBoost module") | ||
cmake_policy(SET CMP0167 OLD) | ||
cmake_policy(SET CMP0167 NEW) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite get that change. Please explain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Admittedly, drive-by change. Instead of retaining old behavior, switch to the new one for finding boost modules. This allows to test both ways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the right way to do this is unconditionally setting the policy to new.
That is
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,8 @@
cmake_minimum_required(VERSION 3.16)
project(ArborX CXX)
-if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.30.0)
- message(STATUS "Setting policy CMP0167 to use FindBoost module")
- cmake_policy(SET CMP0167 OLD)
-endif()
+# FindBoost module removed in version 3.30
+cmake_policy(SET CMP0167 NEW)
# use gnu standard install directories
include(GNUInstallDirs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do that, you will get warnings for older versions of CMake
Policy "CMP0167" is not known to this version of CMake.
Windows build still fails. |
What about explicitly building for
? |
I think we would rather need to specify the configuration when building |
We are not backwards compatible for version 2.0. Allowing users' 1.x code to build against 2.0 is almost 100% would lead to build failures. Would rather prevent that during configuration.
Switching to
SameMajorVersion
would likely be temporary, for a few 2.x releases, after which we would switch back.An alternative to switching to
SameMajorVersion
would be to update CMake requirements to at least 3.19 (release 11/18/2020, so about a year older than CMake we are using right now) and doThis has a benefit of not having to revisit this again later.
Note:
AnyNewerVersion
was introduced in #984.