# Drop support for GCC 4.x?

**URL:** https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874
**Category:** Engineering
**Created:** [February 16, 2021, 6:50pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874 "2021-02-16T18:50:13Z")
**Posts on this page:** 11
**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: [February 16, 2021, 6:50pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/1 "2021-02-16T18:50:13Z")

</div>

[PR2231](https://github.com/InsightSoftwareConsortium/ITK/pull/2231) caused a lot of [build errors on a nightly machine with GCC 4.8.4](https://open.cdash.org/build/7045073). GCC 4.8.4 does not seem to support C++11 well enough for the latest GTest to compile.

Should we upgrade the compiler on this machine and say that ITK requires GCC 5.x and later? Correspondingly update [ITKSoftwareGuide](https://github.com/InsightSoftwareConsortium/ITKSoftwareGuide/blob/master/SoftwareGuide/Latex/Introduction/Installation.tex#L36). Or maybe revert the PR?

So far, @hjmjohnson supported updating compiler requirements in a private email exchange.

---

<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: [February 17, 2021, 2:20pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/2 "2021-02-17T14:20:24Z")

</div>

CentOS 7’s default compiler is GCC 4.8.5. It will have full updates until 2020-08-06. I am currently running nightly valgrind and coverages for ITK on this OS. And use it for SimpleITK CI with a variety of different compilers. However, with the change in direction of CentOS, another Linux distribution will likely be used in the near future.

Redhat 7 is corresponding version for CentOS 7 also has GCC 4.8.5. Redhat is rather notorious for long enterprise support. It use used on all the cluster I work with. Redhat 7 EOL date is 6/30/2024.

I do not propose we support the compiler until this date, but it is a sensible upper bound in this discussion.

It would be nice to have a table to common Linux distro’s, gcc versions and EOL dates. I don’t have time to continue the search. This would provide some additional reasoning for the change is supported compilers on a minor change of the toolkit.

~~Dropping less than (but not) 4.8.5 would not cause a problem with anything I am using right now.~~

\*EDIT: Dzenan pointed out that the valgrind and coverage builds are failing on the dashboard.

---

<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: [February 17, 2021, 3:03pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/3 "2021-02-17T15:03:02Z")

</div>

I see that Valgrind build runs into the [same errors](https://open.cdash.org/viewBuildError.php?buildid=7047625). So revert [PR2231](https://github.com/InsightSoftwareConsortium/ITK/pull/2231)?

---

<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: [February 17, 2021, 3:10pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/4 "2021-02-17T15:10:01Z")

</div>

Having this type of braking change occurring after the second release candidate for 5.2 is not be expected.

So certainly for 5.2, IMHO.

---

<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: [February 17, 2021, 3:35pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/5 "2021-02-17T15:35:55Z")

</div>

Sounds good. So after 5.2.0 final we will bump both minimum CMake version and minimum GCC version.

---

<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: [March 4, 2021, 2:26pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/6 "2021-03-04T14:26:08Z")

</div>

I have created a new nightly build running CentOS5 with devtools 8 ( gcc 8 ) and valgrind:  
[https://open.cdash.org/build/7077815](https://open.cdash.org/build/7077815)

It has different valgrind defects that need to be triaged.

---

<div class="post-metadata">

### Author: ![mihail.isakov](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mihail.isakov](https://discourse.itk.org/u/mihail.isakov)
#### Post date: [March 4, 2021, 4:58pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/7 "2021-03-04T16:58:21Z")

</div>

Looks like [CentOS Valgrind 8 build](https://open.cdash.org/viewDynamicAnalysis.php?buildid=7077815) has less failed test as [CentOS Valgrind build](https://open.cdash.org/viewDynamicAnalysis.php?buildid=7077806) for some reason. Hopefully tomorrow both builds will have fewer defects (15+) after [PR 2347](https://github.com/InsightSoftwareConsortium/ITK/pull/2347).

---

<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: [March 4, 2021, 5:04pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/8 "2021-03-04T17:04:39Z")

</div>

> [@mihail.isakov](#):
>
> Looks like [CentOS Valgrind 8 build](https://open.cdash.org/viewDynamicAnalysis.php?buildid=7077815) has less failed test as [CentOS Valgrind build](https://open.cdash.org/viewDynamicAnalysis.php?buildid=7077806) for some reason.

The tests are failing because the executables do not exist do to [compilation errors](https://open.cdash.org/viewBuildError.php?buildid=7077806):

```auto
/tmp/bld/ITK/Modules/Filtering/Path/test/itkContourExtractor2DImageFilterTest.cxx: In function 'void showImage(itk::Image<unsigned char, 2u>::ConstPointer)':
bld/ITK/Modules/Filtering/Path/test/itkContourExtractor2DImageFilterTest.cxx:480:58: error: cannot convert 'const SizeType {aka const itk::Size<2u>}' to 'itk::Size<2u>::SizeValueType {aka long unsigned int}' in initialization
   const SizeType toshowSize{ toshowRegion.GetSize() };
                                                          ^
In file included from bld/ITK/Modules/Filtering/Path/include/itkContourExtractor2DImageFilter.h:329:0,
                 from bld/ITK/Modules/Filtering/Path/test/itkContourExtractor2DImageFilterTest.cxx:20:
/tmp/bld/ITK/Modules/Filtering/Path/include/itkContourExtractor2DImageFilter.hxx: In instantiation of 'void itk::ContourExtractor2DImageFilter<TInputImage>::GenerateDataForLabels() [with TInputImage = itk::Image<unsigned char, 2u>]':
bld/ITK/Modules/Filtering/Path/include/itkContourExtractor2DImageFilter.hxx:52:5: required from 'void itk::ContourExtractor2DImageFilter<TInputImage>::GenerateData() [with TInputImage = itk::Image<unsigned char, 2u>]'
bld/ITK/Modules/Filtering/Path/test/itkContourExtractor2DImageFilterTest.cxx:704:1: required from here
bld/ITK/Modules/Filtering/Path/include/itkContourExtractor2DImageFilter.hxx:298:5: error: no matching function for call to 'std::vector<unsigned char, std::allocator<unsigned char> >::erase(const const_iterator&, std::vector<unsigned char, std::allocator<unsigned char> >::iterator)'

```

These error need to be fixed before the release.

---

<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: [March 19, 2021, 1:24pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/9 "2021-03-19T13:24:53Z")

</div>

I have also created a new nightly build “CentOS Coverage 8” with devtools 8 ( gcc 8 ) for coverage. I can stop the other builds after the 5.2.0 release.

However for 5.2.x patch releases, there is some concern that problems with gcc 4 may be re-introduced so some additional considerations or testing may be needed for the release branch.

---

<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: [March 19, 2021, 1:54pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/10 "2021-03-19T13:54:29Z")

</div>

Can you change the CentOS7 valgrind build to target `release` branch?

---

<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: [March 19, 2021, 2:27pm UTC](https://discourse.itk.org/t/drop-support-for-gcc-4-x/3874/11 "2021-03-19T14:27:29Z")

</div>

I could. But that branch will not be updated often, so I’m not sure it is worth it to run every night.
