# Minimum CMake version

**URL:** https://discourse.vtk.org/t/minimum-cmake-version/2867
**Category:** Development
**Created:** [March 23, 2020, 7:04pm UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867 "2020-03-23T19:04:13Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [March 23, 2020, 7:04pm UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/1 "2020-03-23T19:04:13Z")

</div>

Hi,

In order to support Intel MPI better, I’d like to bump the `FindMPI` in VTK to the version that is provided by CMake 3.17. However, some of this logic is only available in CMake 3.12 (namely the `SHELL:` syntax for linker flags). Does anyone have a problem with bumping VTK’s minimum CMake version to 3.12 on `master` only? This would include bumping it for consumers of VTK as well. VTK currently requires CMake 3.8.x as a minimum version. The last patch release for the 3.8 series was released in May 2017 and the 3.8.0 release was in April 2017.

Survey of Linux distro versions:

- Ubuntu 16.04 - 3.5 (already too old)
- Ubuntu 18.04 - 3.10 (would be out-of-date)
- Ubuntu 19.04 - 3.13 (OK)
- Debian oldstable - 3.7 (already too old; 3.13 in backports)
- Debian stable - 3.13 (OK)
- RHEL 6 - 2.8.12 (already too old)
- RHEL 7 - 2.8.12 (3.14 in EPEL)
- RHEL 8 - 3.11 (would be out-of-date)
- Fedora, Arch, etc. - Probably fine 🙂

A fallback option is to just hide MPI support if 3.12 is not available (we can message if it was requested though). Enabling MPI would make us have a 3.12 minimum for consumers then, 3.8 otherwise. I don’t know if that’s a nicer behavior or not; folks are going to end up just needing 3.12 in the general case anyways.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [March 24, 2020, 12:54am UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/2 "2020-03-24T00:54:51Z")

</div>

I have no problem with bumping CMake to 3.12 so +1 from me.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [March 25, 2020, 1:52pm UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/3 "2020-03-25T13:52:38Z")

</div>

Here’s a proof-of-concept for bumping the minimum: [https://gitlab.kitware.com/vtk/vtk/issues/17748](https://gitlab.kitware.com/vtk/vtk/issues/17748)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 7, 2020, 1:50pm UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/4 "2020-04-07T13:50:55Z")

</div>

Any objections to bumping on `master`? I’d like to merge this by the end of the week if not.

---

<div class="post-metadata">

### Author: ![seanm](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@seanm](https://discourse.vtk.org/u/seanm)
#### Post date: [April 7, 2020, 2:27pm UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/5 "2020-04-07T14:27:30Z")

</div>

I worried OpenBSD’s cmake might be older, but 6.6 has at least cmake 3.15.3.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [April 8, 2020, 2:05am UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/6 "2020-04-08T02:05:52Z")

</div>

Didn’t we see someone running cmake 3.9 here :

> [@9.0.0.rc1 CMake policy error (using CMake 3.9.3)](https://discourse.vtk.org/t/9-0-0-rc1-cmake-policy-error-using-cmake-3-9-3/2976):
>
> Linux, rhel7, CMake 3.9.3, I passed no args to CMake, and configure fails with this error: CMake Error at ThirdParty/hdf5/CMakeLists.txt:2 (cmake\_policy): Policy “CMP0074” is not known to this version of CMake.

Rhel7.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 8, 2020, 3:01am UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/7 "2020-04-08T03:01:17Z")

</div>

Listed in the main post; EPEL has 3.14 available. The base system is still 2.8 (!), so I don’t know where 3.9 comes from (a devtoolset maybe?).

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [April 8, 2020, 4:51am UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/8 "2020-04-08T04:51:53Z")

</div>

Ok, I’m fine with upgrading, but maybe not in VTK9 release.

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [April 8, 2020, 6:09am UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/9 "2020-04-08T06:09:00Z")

</div>

> Ok, I’m fine with upgrading, but maybe not in VTK9 release.

Upgrading sounds good to me too, but doing it in VTK 9 release would be problematic for us, as we still need to build packages for Ubuntu 18.04 for a while. We’ll eventually migrate to Ubuntu 20.04 (out in a couple of weeks), but the migration is going to take quite some time.

It would be awkward to have to carry patches to make VTK build with CMake 3.10.2. Not impossible of course, but it would be a problem.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 8, 2020, 12:04pm UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/10 "2020-04-08T12:04:31Z")

</div>

> [@mwestphal](#):
>
> Ok, I’m fine with upgrading, but maybe not in VTK9 release.

That was never proposed.

> [@ben.boeckel](#):
>
> Does anyone have a problem with bumping VTK’s minimum CMake version to 3.12 on `master` only?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [April 8, 2020, 12:05pm UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/11 "2020-04-08T12:05:51Z")

</div>

My bad. Thanks Ben.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 9, 2020, 5:04pm UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/12 "2020-04-09T17:04:36Z")

</div>

I’ll merge at the end of the day (in 4 hours or so) if I don’t hear any objections.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 9, 2020, 9:35pm UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/13 "2020-04-09T21:35:09Z")

</div>

And merged.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [April 10, 2020, 2:11am UTC](https://discourse.vtk.org/t/minimum-cmake-version/2867/14 "2020-04-10T02:11:30Z")

</div>

Builds Ok: VTk and VTKExamples on both Windows and Linux. No problems.

Andrew Maclean
