# Minimum CMake version update

**URL:** <https://discourse.itk.org/t/minimum-cmake-version-update/585>\
**Category:** Engineering\
**Created:** [January 12, 2018, 5:26pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585 "2018-01-12T17:26:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [January 12, 2018, 5:26pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/1 "2018-01-12T17:26:24Z")

</div>

During today’s confab meeting ([notes](https://docs.google.com/document/d/1I6DHtiGsA5sIPxr9ae683j-vyBpdfFeUpaLWyEVcSSg/edit?ts=5a58e292#heading=h.nmktxu3rhm0l)), we decided to update the minimum required CMake version in ITK master from 2.8.12 to 3.8.2. The change will occur at the end of next week. Meanwhile, all dashboard build machines need to have their CMake upgraded to 3.8.2 or newer.

The plan it to switch the C++ standard to 11 the week after that. This is part of big changes of [version 5](https://discourse.itk.org/t/gearing-up-for-itk5/515/).

@hjmjohnson @zivy @jhlegarreta @Niels_Dekker

---

<div class="post-metadata">

**Author:** ![Niels\_Dekker](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)\
**Post date:** [January 12, 2018, 7:51pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/2 "2018-01-12T19:51:49Z")

</div>

Thank you bringing this update to my attention, @dzenanz

One of the ITK dependent projects I’m involved with, [https://github.com/SuperElastix/SuperElastix](https://github.com/SuperElastix/SuperElastix) still has CMake 3.5.1 on the continuous build machine (running gcc-5.4.0 on linux). Are you planning to use some specific CMake features that are not yet available in CMake 3.5.1?

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [January 12, 2018, 8:07pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/3 "2018-01-12T20:07:12Z")

</div>

ITKv5 is going to require C++11. CMake 3.8.2 is required so that `try_compiles` are aware of the CMAKE\_CXX\_STANDARD variable.

[https://cmake.org/cmake/help/v3.8/release/3.8.html](https://cmake.org/cmake/help/v3.8/release/3.8.html)

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [January 12, 2018, 8:29pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/4 "2018-01-12T20:29:29Z")

</div>

CMake 2.8.12 was released in Oct 2013, so the requirement upgrade looks fair to me to make ITK an even more modern toolkit.

I guess we’ll need to grep for all `cmake_minimum_required(VERSION 2.X)` appearances (e.g. examples, remote modules, etc.), and change them.

Also potential references to the CMake minimum version in the SW Guide.

Is this already being addressed or shall I take this on me for the SW Guide, then the examples, then see if it all goes OK with the latter, and then try the remote modules?

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [January 12, 2018, 8:40pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/5 "2018-01-12T20:40:00Z")

</div>

> [@jhlegarreta](#):
>
> Is this already being addressed or shall I take this on me for the SW Guide, then the examples, then see if it all goes OK with the latter, and then try the remote modules?

That would be amazing, Jon!

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [January 12, 2018, 9:25pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/6 "2018-01-12T21:25:51Z")

</div>

OK. Will submit the corresponding PRs during the weekend.

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [January 15, 2018, 7:34pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/7 "2018-01-15T19:34:25Z")

</div>

As discussed at the confab, we should use the version available with the Ubuntu Long-Term-Support distribution at the time of the release (this will be 18.04 - Bionic Beaver). This version [is currently](https://packages.ubuntu.com/bionic/cmake) CMake 3.9.5. It may change in the future. Since Windows developers download the latest version from [cmake.org](http://cmake.org) and macOS developers download from [cmake.org](http://cmake.org) or use Homebrew (which tracks latest CMake), there is not a reason to use a lower version in these cases.

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [January 16, 2018, 2:18pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/8 "2018-01-16T14:18:38Z")

</div>

Our previous conversations have resulted in agreement that CMake 3.8.2 would be the require version. If there is a feature/bug encountered that requires a newer version of CMake we could consider a newer version. I am not sure what to install on my systems now, with the confusion.

I am not sure why just Debian/Ubuntu would dictate the version of CMake required. Centos/Redhat is also a very popular flavor of Linux, but they only have 3.6.3 available in the [EPEL](https://www.rpmfind.net/linux/RPM/epel/7/x86_64/Packages/c/cmake3-3.6.3-1.el7.x86_64.html). And these Linux flavors usually have the longest running support. There are easy options to get newer versions of CMake installed on Linux systems too. Again, I am confused on this proposed specification/requirement.

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [January 16, 2018, 2:28pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/9 "2018-01-16T14:28:10Z")

</div>

> [@blowekamp](#):
>
> Our previous conversations have resulted in agreement that CMake 3.8.2 would be the require version

No, we agreed to use the version released with Ubuntu 18.04. See the [notes from the 2017-12-08 discussion](https://docs.google.com/document/d/1I6DHtiGsA5sIPxr9ae683j-vyBpdfFeUpaLWyEVcSSg/edit#). This was also the discussed approach on 2018-01-12.

> [@blowekamp](#):
>
> If there is a feature/bug encountered that requires a newer version of CMake we could consider a newer version.

Newer CMake versions generally contain more bug fixes. We should use the latest version of CMake available, which has the most bug fixes and the most features, that is not burdensome for developers to obtain.

> [@blowekamp](#):
>
> I am not sure what to install on my systems now, with the confusion.

Install the latest released version of CMake, 3.10.1.

> [@blowekamp](#):
>
> I am not sure why just Debian/Ubuntu would dictate the version of CMake required.

Other versions of Linux should be considered, also. Ubuntu is the most popular developer edition, so it holds a lot of weight.

> [@blowekamp](#):
>
> Centos/Redhat is also a very popular flavor of Linux, but they only have 3.6.3 available in the EPEL.

3.6.3 is below the required 3.8.2 for good C++11 support, so it should not be used as a minimum version since we are moving to C++11.

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [January 16, 2018, 4:05pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/10 "2018-01-16T16:05:58Z")

</div>

Looks like things have changed recently. 😅

Specifically from the TCON notes:

> require \> CMake 3.8.4, CMake version released with Ubuntu 18.04 LTS

And Hans’ previous patch was spec’d to [“3.8.2”](https://github.com/InsightSoftwareConsortium/ITK/pull/36/commits/9f43fd31c9ef4227c8dba821b4da674066bd0e16)

> [@matt.mccormick](#):
>
> I am not sure why just Debian/Ubuntu would dictate the version of CMake required.
> 
> Other versions of Linux should be considered, also. Ubuntu is the most popular developer edition, so it holds a lot of weight.

Do you have a reference for Ubuntu being the most popular assertion?

I have always been surprised about which ones are [popular](https://www.lifewire.com/top-linux-distributions-of-all-time-4084559).

😁

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [January 16, 2018, 4:10pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/11 "2018-01-16T16:10:57Z")

</div>

> [@blowekamp](#):
>
> CMake 3.8.4

This version does not exist, 3.8.2 was meant there.

And it was 3.8.2 or the one in Ubuntu 18.04, whichever is newer.

---

<div class="post-metadata">

**Author:** ![tim-evain](https://discourse.itk.org/user_avatar/discourse.itk.org/tim-evain/32/220_2.png) [@tim-evain](https://discourse.itk.org/u/tim-evain)\
**Post date:** [January 16, 2018, 4:15pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/12 "2018-01-16T16:15:33Z")

</div>

> [@blowekamp](#):
>
> I have always been surprised about which ones are popular.

If I read well, your link is stating that the current top 3 distributions are :  
1 Mint  
2 Debian  
3 Ubuntu  
so Debian-like distributions seem a reasonable indicator ?

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [January 16, 2018, 5:48pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/13 "2018-01-16T17:48:48Z")

</div>

> [@tim-evain](#):
>
> If I read well, your link is stating that the current top 3 distributions are :
> 
> 1 Mint
> 
> 2 Debian
> 
> 3 Ubuntu
> 
> so Debian-like distributions seem a reasonable indicator ?

Also, note that Mint uses the Ubuntu packages.

For AWS EC2, by far the largest cloud provider, the [distribution by “platform”](http://thecloudmarket.com/stats#/by_platform_definition) is:

- ubuntu: 209.5k
- linux: 88.5k
- windows: 29.2k
- redhat: 17.8k
- centos: 13.7k

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [January 17, 2018, 6:17pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/14 "2018-01-17T18:17:51Z")

</div>

PRs with `3.9.5` as the required minimum version done for

- [ITKSoftwareGuide](https://github.com/InsightSoftwareConsortium/ITKSoftwareGuide)
- [ITKExamples](https://github.com/InsightSoftwareConsortium/ITKExamples)
- Remote Modules
  - [ITKAnalyzeObjectMap](https://github.com/InsightSoftwareConsortium/itkAnalyzeObjectMap/pull/4)
  - [ITKAnisotropicDiffusionLBR](https://github.com/InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR)
  - [ITKBioCell](https://github.com/InsightSoftwareConsortium/ITKBioCell)
  - [ITKBridgeNumPy](https://github.com/InsightSoftwareConsortium/ITKBridgeNumPy)
  - [ITKCuberille](https://github.com/InsightSoftwareConsortium/ITKCuberille)
  - [itkFDFImageIO](https://github.com/InsightSoftwareConsortium/itkFDFImageIO)
  - [ITKFixedPointInverseDisplacementField](https://github.com/InsightSoftwareConsortium/ITKFixedPointInverseDisplacementField)
  - [ITKGenericLabelInterpolator](https://github.com/InsightSoftwareConsortium/ITKGenericLabelInterpolator)
  - [ITKIOTransformDCMTK](https://github.com/InsightSoftwareConsortium/ITKIOTransformDCMTK)
  - [ITKMinimalPathExtraction](https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction)
  - [ITKNeuralNetworks](https://github.com/InsightSoftwareConsortium/ITKNeuralNetworks)
  - [ITKPerformanceBenchmarking](https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking)
  - [ITKPolarTransform](https://github.com/InsightSoftwareConsortium/ITKPolarTransform)
  - [ITKPrincipalComponentsAnalysis](https://github.com/InsightSoftwareConsortium/ITKPrincipalComponentsAnalysis)
  - [ITKSTLMeshIO](https://github.com/InsightSoftwareConsortium/ITKSTLMeshIO)
  - [ITKStrain](https://github.com/KitwareMedical/ITKStrain)
  - [ITKTBBImageToImageFilter](https://github.com/InsightSoftwareConsortium/ITKTBBImageToImageFilter)
  - [ITKTextureFeatures](https://github.com/InsightSoftwareConsortium/ITKTextureFeatures)
  - [ITKTwoProjectionRegistration](https://github.com/InsightSoftwareConsortium/ITKTwoProjectionRegistration)
  - [ITKWikiExamples](https://github.com/InsightSoftwareConsortium/ITKWikiExamples)
  - [ITKIsotropicWavelets](https://github.com/phcerdan/ITKIsotropicWavelets)

In case ISC’s was a clone, I assumed that rather than doing a PR to the original repo and waiting for the anser we wanted to PR to ISC/KitwareMedical’s repos (except for @phcerdan 's [ITKIsotropicWavelets](https://github.com/phcerdan/ITKIsotropicWavelets)).

The remote module’s list here is not exhaustive, so some are still missing the update.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [January 17, 2018, 8:13pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/15 "2018-01-17T20:13:50Z")

</div>

Good work Jon!

> [@jhlegarreta](#):
>
> PRs with 3.9.5 as the required minimum version

Let’s wait with merging until ITK master gets the minimum version bumped (planned for Friday).

We will probably have to do another round of CMake minimum version bumping, as we expect for Ubuntu 18.04 to be released with CMake 3.11 (or 3.10.1 or something).

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [January 19, 2018, 7:03am UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/16 "2018-01-19T07:03:43Z")

</div>

Seems reasonable. Given that `ITKv5 RC1` is planned for April 27th, and `Ubuntu LTS 18.04`'s final release for April, 26th, I guess we’ll need to bump the new version for `RC1`, so bordering the feature freeze.

Another bunch of **remotes** PR’ed for CMake minimum version update:

- [DVMeshNoise](https://github.com/DVigneault/DVMeshNoise) @DVigneault
- [itkMGHImageIO](https://github.com/Slicer/itkMGHImageIO.git) @lassoan
- [ITKMorphologicalContourInterpolation](https://github.com/KitwareMedical/ITKMorphologicalContourInterpolation.git)
- [LesionSizingToolkit](https://github.com/InsightSoftwareConsortium/LesionSizingToolkit.git)
- [MultipleImageIterator](https://github.com/KitwareMedical/MultipleImageIterator.git)
- [ITKRLEImage](https://github.com/KitwareMedical/ITKRLEImage.git)
- [scifio-imageio](https://github.com/scifio/scifio-imageio.git) @matt.mccormick, @blowekamp, @fbudin,@jcfr
- [ITKSimpleITKFilters](https://github.com/SimpleITK/ITKSimpleITKFilters.git) @blowekamp, @zivy
- [ITKSplitComponents/](https://github.com/thewtex/ITKSplitComponents/) @matt.mccormick

BTW, I have not checked whether other changes may be necessary (or recommended, e.g. using `cookiecutter`/remote module template) in the code itself of the remotes to be adapted to `ITKv5` :-S

---

<div class="post-metadata">

**Author:** ![jcfr](https://discourse.itk.org/user_avatar/discourse.itk.org/jcfr/32/2526_2.png) [@jcfr](https://discourse.itk.org/u/jcfr)\
**Post date:** [January 19, 2018, 1:47pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/17 "2018-01-19T13:47:18Z")

</div>

Thanks @jhlegarreta

Regarding `itkMGHImageIO` and `scifio-imageio`, I will check if it also make sense to bump the minimum version of Slicer to CMake 3.9.5.

See [https://discourse.slicer.org/t/updating-minimum-required-version-of-cmake-to-3-9-5/1873](https://discourse.slicer.org/t/updating-minimum-required-version-of-cmake-to-3-9-5/1873)

---

<div class="post-metadata">

**Author:** ![hjmjohnson](https://discourse.itk.org/user_avatar/discourse.itk.org/hjmjohnson/32/23_2.png) [@hjmjohnson](https://discourse.itk.org/u/hjmjohnson)\
**Post date:** [January 19, 2018, 2:15pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/18 "2018-01-19T14:15:36Z")

</div>

[http://review.source.kitware.com/#/c/23016/](http://review.source.kitware.com/#/c/23016/)

READY TO MERGE!

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [January 19, 2018, 11:04pm UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/19 "2018-01-19T23:04:06Z")

</div>

Patch to update remote modules:  
[http://review.source.kitware.com/#/c/23036/](http://review.source.kitware.com/#/c/23036/)

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [January 27, 2018, 11:46am UTC](https://discourse.itk.org/t/minimum-cmake-version-update/585/20 "2018-01-27T11:46:41Z")

</div>

Both [UpdateToCMAKE3.9.5](http://review.source.kitware.com/#/c/23016/) and [BumpRemotes](http://review.source.kitware.com/#/c/23036/) topics that @hjmjohnson and @dzenanz initiated have been merged.

As for the remotes, still pending:

- ITKSplitComponents: ongoing [Review](http://review.source.kitware.com/#/c/23096/).

- [itkMGHImageIO](https://github.com/Slicer/itkMGHImageIO)  
@jcfr Can the [ISC fork](https://github.com/InsightSoftwareConsortium/itkMGHImageIO) be updated without further changes required upstream for ITKv5?

- [SimpleITK/ITKSimpleITKFilters](https://github.com/SimpleITK/ITKSimpleITKFilters)  
@blowekamp Can the hash be updated without further changes required for ITKv5?
