# Building and Compiling with GCC 8.1

**URL:** https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934
**Category:** Beginner Questions
**Tags:** build
**Created:** [May 15, 2018, 3:29pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934 "2018-05-15T15:29:11Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![tubbytoad](https://discourse.itk.org/user_avatar/discourse.itk.org/tubbytoad/32/354_2.png) [@tubbytoad](https://discourse.itk.org/u/tubbytoad)
#### Post date: [May 15, 2018, 3:29pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934/1 "2018-05-15T15:29:12Z")

</div>

I am having an issue building and compiling ITK-4.13 with GCC 8.1.0. I managed to build ITK by temporarily downgrading my GCC version but now since I have upgraded again ITK won’t compile. Any guidance on this would be appreciated.

```
/usr/include/ITK-4.13/vcl_compiler.h:90:4: error: #error "Dunno about this gcc"
 # error "Dunno about this gcc"
    ^ ~~~~
make[2]: *** [CMakeFiles/ResampleOverlapMeasure.dir/build.make:63: CMakeFiles/ResampleOverlapMeasure.dir/resampleoverlapmeasure.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/ResampleOverlapMeasure.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
```

---

<div class="post-metadata">

### Author: ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)
#### Post date: [May 15, 2018, 3:51pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934/2 "2018-05-15T15:51:28Z")

</div>

Thanks for reporting this issue. I haven’t tested this myself, but this error seems like it should be expected. vcl\_compiler.h needs to be updated to support the newest compilers, such as GCC8.1. I thought that this file was generated automatically with a CMake macro, but I cannot find the information about this. @hjmjohnson: Do you know how `vcl_compiler.h` is generated?

---

<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: [May 15, 2018, 4:11pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934/3 "2018-05-15T16:11:24Z")

</div>

It might be generated by CMake, in which case CMake has to be aware of the compiler. @tubbytoad can you try using the newest CMake version (3.11.1)?

---

<div class="post-metadata">

### Author: ![tubbytoad](https://discourse.itk.org/user_avatar/discourse.itk.org/tubbytoad/32/354_2.png) [@tubbytoad](https://discourse.itk.org/u/tubbytoad)
#### Post date: [May 15, 2018, 4:23pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934/4 "2018-05-15T16:23:05Z")

</div>

I’m using CMake version 3.11.1 and still get the error.

---

<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: [May 15, 2018, 5:12pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934/5 "2018-05-15T17:12:13Z")

</div>

@fbudin The vcl\_compiler.h file has always been hand crafted. It “SHOULD” be created automatically with newer versions of cmake now that that capability is better defined.

It should at least provide better guessing in the case that the version does not match.

I’ve never been a fan of this file.

Perhaps you can make a pull request to VXL so that we canget the changes fixed upstream. I don’t have the bandwidth to work on this anytime soon.

---

<div class="post-metadata">

### Author: ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)
#### Post date: [May 15, 2018, 8:06pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934/6 "2018-05-15T20:06:40Z")

</div>

I am hitting this too, opening a PR to vxl just adding GCC 8 support to vcl\_compiler.h.

---

<div class="post-metadata">

### Author: ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)
#### Post date: [May 15, 2018, 8:26pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934/7 "2018-05-15T20:26:17Z")

</div>

> <https://github.com/vxl/vxl/pull/481>

---

<div class="post-metadata">

### Author: ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)
#### Post date: [May 16, 2018, 7:08pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934/8 "2018-05-16T19:08:55Z")

</div>

Thanks Pablo! Feel free to update this thread with the ITK PR once a PR has been created to update VXL in ITK.

---

<div class="post-metadata">

### Author: ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)
#### Post date: [May 16, 2018, 8:10pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934/9 "2018-05-16T20:10:54Z")

</div>

I am going to give it a try after reading: [https://github.com/InsightSoftwareConsortium/ITK/blob/aa57caf04732f8c0b56f575b65c532e107720e49/Documentation/UpdatingThirdParty.md](https://github.com/InsightSoftwareConsortium/ITK/blob/aa57caf04732f8c0b56f575b65c532e107720e49/Documentation/UpdatingThirdParty.md)

---

<div class="post-metadata">

### Author: ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)
#### Post date: [May 16, 2018, 8:47pm UTC](https://discourse.itk.org/t/building-and-compiling-with-gcc-8-1/934/10 "2018-05-16T20:47:05Z")

</div>

I think this is it: [http://review.source.kitware.com/#/c/23437/](http://review.source.kitware.com/#/c/23437/).

Gerrit gets two reviews (one per commit), but I guess the merge commit is the good one.

Thanks to @jcfr for the guidance using UpdateFromUpstream scripts.
