dockcross / dockcross

Cross compiling toolchains in Docker images
https://hub.docker.com/u/dockcross
MIT License
3.32k stars 409 forks source link

Add option to use more recent versions of GCC #171

Closed kaspermarstal closed 7 years ago

kaspermarstal commented 7 years ago

Hi

Compiling ITK 4.12.2 with the windows-x64 image fails with the following error:

In file included from /work/XRTK-windows-x64/CXX/XRTK-build/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/Templates/vnl_matrix+long_double-.cxx:1:0:
/work/XRTK-windows-x64/CXX/XRTK-build/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix.hxx: In constructor 'vnl_matrix<T>::vnl_matrix(const vnl_matrix<T>&, T, vnl_tag_mul) [with T = long double]':
/work/XRTK-windows-x64/CXX/XRTK-build/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix.hxx:287:1: internal compiler error: in expand_expr_addr_expr_1, at expr.c:7697
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Modules/ThirdParty/VNL/src/vxl/core/vnl/CMakeFiles/itkvnl.dir/build.make:2963: recipe for target 'Modules/ThirdParty/VNL/src/vxl/core/vnl/CMakeFiles/itkvnl.dir/Templates/vnl_matrix+long_double-.cxx.obj' failed
make[5]: *** [Modules/ThirdParty/VNL/src/vxl/core/vnl/CMakeFiles/itkvnl.dir/Templates/vnl_matrix+long_double-.cxx.obj] Error 1

The issue (or at least a very similar one) is discussed in this thread on the gcc bugtacker and fixed in gcc 5.0.0.

I understand that simply upgrading gcc might brake other peoples builds, but perhaps alternative versions of gcc could be provided via update-alternatives or similiar? Is this possible?

The add-apt-repository command is not available and modifying /etc/apt/sources* gives permission denied even when using sudo so it is difficult to upgrade gcc manually.

kaspermarstal commented 7 years ago

Perhaps #169 is related.

thewtex commented 7 years ago

Hi @kaspermarstal ,

internal compiler error: 

Most of the time these days, when you see this error, it indicates that the compiler ran out of memory. To avoid it, reduce the parallelism of the build by passing -j4 to make or ninja, etc.

I tried building ITK 4.12.2 with the current image, and it succeeded.

That said, #172 will update the toolchain to use GCC 5.4.0. I verified that ITK builds with this version, too.

kaspermarstal commented 7 years ago

Hi,

Thanks for the suggestion! It wasn't an out-of-memory error but using GCC 5.4.0 did the trick!

Kasper