Building and Compiling with GCC 8.1

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

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?

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)?

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

@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.

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

1 Like

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

1 Like

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

I think this is it: 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.