Skip to content

cmake: update minimum_required cmake version #4848

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

Merged
merged 5 commits into from
Oct 25, 2024

Conversation

haampie
Copy link
Contributor

@haampie haampie commented Aug 7, 2024

It's better to enable https://cmake.org/cmake/help/latest/policy/CMP0042.html#policy:CMP0042 than to explicitly set CMAKE_MACOSX_RPATH, since users may want to set the latter from the command line.

@martin-frbg
Copy link
Collaborator

Thanks - I'm always a bit hesitant when it comes to tightening minimum version requirements, as at least "historically" some users were unable to update the systems they worked on. The original CMakeLists.txt under lapack-netlib are not used when building LAPACK as a part of OpenBLAS, so I think this can be deferred to 0.3.29 (?)

@martin-frbg martin-frbg added this to the 0.3.29 milestone Aug 7, 2024
@haampie
Copy link
Contributor Author

haampie commented Aug 7, 2024

Ah, I saw some add_subdirectory and assumed that's how it worked, sorry for the misunderstanding.

In that case let me use the most conservative option: cmake_policy(SET CMP0042 NEW)

@haampie haampie changed the title require cmake 3.6 cmake: set CMP0042 to NEW Aug 7, 2024
@conradsnicta
Copy link

@martin-frbg @haampie I'd suggest to bump the min version of CMake, rather than messing around with policies.

Using ancient versions of CMake adds to the technical debt and increases the maintenance burden.

CMake 2.8.5 (currently required by OpenBLAS) is truly prehistoric, released circa 2010.
Cmake 3.0 (released in 2014) is generally known as the starting point for "modern" CMake.

A good indicator of the oldest allowable version of CMake would be across old mainstream long-term linux distros (Red Hat, Ubuntu, Debian) that are still within their normal support period:

  • RHEL 8 has CMake 3.26.5
  • Debain 11 has CMake 3.18.4
  • Ubuntu 20.04 LTS has 3.16.3

This suggests CMake 3.16 as the oldest baseline version. Anything older than that has a rapidly diminishing number of users.

(Similar comment applies to ancient versions of GCC and Clang. In my view, the required workarounds for out-of-support compilers are simply not worth it.)

@martin-frbg
Copy link
Collaborator

turns out that updating the minimum required cmake version (or adding even more cmp... policies) is also necessary for cross-compilations with the current Android NDK (r27), so I've finally hacked conradsnicta's suggestion into your PR branch

@haampie
Copy link
Contributor Author

haampie commented Oct 25, 2024

great

@martin-frbg martin-frbg changed the title cmake: set CMP0042 to NEW cmake: update minimum_required cmake version Oct 25, 2024
@martin-frbg martin-frbg merged commit a8bb105 into OpenMathLib:develop Oct 25, 2024
81 of 84 checks passed
@haampie haampie deleted the fix/cmake-min-version branch February 18, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants