InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.43k stars 668 forks source link

Compilation error of v5.4.0 with GCC-13.2.0 - CastXML problem? #4911

Open pavelToman opened 3 weeks ago

pavelToman commented 3 weeks ago

Description

Hello! I am working for University Gent (UGent) and I am trying to install ITK 5.4.0 on our HPC to provide it to our researchers. We are using EasyBuild to build and install all the software.

There is a problem with compilation of ITK 5.4.0, while ITK 5.3.0 can be build and install.

Steps to Reproduce

Configure (cmake) command seems ok, but it failed on make step:

cmake
-DCMAKE_INSTALL_PREFIX=/software/ITK/5.4.0-foss-2023b -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DPYTHON_EXECUTABLE=/software/Python/3.11.5-GCCcore-13.2.0/bin/python -DPython3_EXECUTABLE=/software/Python/3.11.5-GCCcore-13.2.0/bin/python -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DModule_ITKReview=ON -DModule_ITKVtkGlue=ON -DModule_SimpleITKFilters=ON -DITK_WRAP_PYTHON:BOOL=ON -DPython_EXECUTABLE=/software/Python/3.11.5-GCCcore-13.2.0/bin/python -DSWIG_EXECUTABLE=$EBROOTSWIG/bin/swig -DSWIG_DIR=$EBROOTSWIG -DPY_SITE_PACKAGES_PATH=/software/ITK/5.4.0-foss-2023b/lib/python3.11/site-packages -DITK_USE_SYSTEM_CASTXML=ON -DITK_USE_SYSTEM_DOUBLECONVERSION=ON -DITK_USE_SYSTEM_EIGEN=ON -DITK_USE_SYSTEM_EXPAT=ON -DITK_USE_SYSTEM_FFTW=ON -DITK_USE_SYSTEM_HDF5=ON -DITK_USE_SYSTEM_JPEG=ON -DITK_USE_SYSTEM_PNG=ON -DITK_USE_SYSTEM_SWIG=ON -DITK_USE_SYSTEM_TIFF=ON -DITK_USE_SYSTEM_ZLIB=ON /tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/ITK-5.4.0/ -> exit 0

LC_ALL=C make -j 8 -> exit 2 Part of the error:

  Building C object Modules/ThirdParty/NrrdIO/src/NrrdIO/CMakeFiles/ITKNrrdIO.dir/accessors.c.o
  cd /tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/easybuild_obj/Modules/ThirdParty/NrrdIO/src/NrrdIO && /apps/gent/
  RHEL8/cascadelake-ib/software/GCCcore/13.2.0/bin/gcc -DITKNrrdIO_EXPORTS -DTEEM_BUILD -DTEEM_DIO=0 -DTEEM_QNANHIBIT=1 -
  DTEEM_ZLIB=1 -I/tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/easybuild_obj/Modules/ThirdParty/ZLIB/src -I/apps/gen
  t/RHEL8/cascadelake-ib/software/zlib/1.2.13-GCCcore-13.2.0/include -I/tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b
  /easybuild_obj/Modules/ThirdParty/NrrdIO/src/NrrdIO -I/tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/ITK-5.4.0/Modu
  les/ThirdParty/NrrdIO/src/NrrdIO -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC -std=c++17   -w -fno-strict-a
  liasing -O3 -DNDEBUG -fPIC -MD -MT Modules/ThirdParty/NrrdIO/src/NrrdIO/CMakeFiles/ITKNrrdIO.dir/accessors.c.o -MF CMak
  eFiles/ITKNrrdIO.dir/accessors.c.o.d -o CMakeFiles/ITKNrrdIO.dir/accessors.c.o -c /tmp/vsc47063/easybuild/build/ITK/5.4
  .0/foss-2023b/ITK-5.4.0/Modules/ThirdParty/NrrdIO/src/NrrdIO/accessors.c
  In file included from In file included from /tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/easybuild_obj/Wrapping/c
  astxml_inputs/itkPyImageFilter.cxx:1:
      In file included from /tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/ITK-5.4.0/Modules/Core/Common/include/itkComma
  nd.h:21:
  In file included from /tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/ITK-5.4.0/Modules/Core/Common/include/itkObjec
  t.h:31:
  In file included from /tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/ITK-5.4.0/Modules/Core/Common/include/itkLight
  Object.h:21:
  In file included from /tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/ITK-5.4.0/Modules/Core/Common/include/itkMacro
  .h:47:
  In file included from /kyukon/home/apps/RHEL8/cascadelake-ib/software/GCCcore/13.2.0/bin/../lib/gcc/x86_64-pc-linux-gnu
  /13.2.0/../../../../include/c++/13.2.0/string:42:
  In file included from /kyukon/home/apps/RHEL8/cascadelake-ib/software/GCCcore/13.2.0/bin/../lib/gcc/x86_64-pc-linux-gnu
  /13.2.0/../../../../include/c++/13.2.0/bits/char_traits.h:42:
  In file included from /kyukon/home/apps/RHEL8/cascadelake-ib/software/GCCcore/13.2.0/bin/../lib/gcc/x86_64-pc-linux-gnu
  /13.2.0/../../../../include/c++/13.2.0/bits/postypes.h:40:
  In file included from /kyukon/home/apps/RHEL8/cascadelake-ib/software/GCCcore/13.2.0/bin/../lib/gcc/x86_64-pc-linux-gnu
  /13.2.0/../../../../include/c++/13.2.0/cwchar:44:
  In file included from /usr/include/wchar.h:30:
  /usr/include/bits/floatn.h:86:20: error: typedef redefinition with different types ('__float128' vs 'struct __castxml_F
  loat128_s')
  /tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/easybuild_obj/Wrapping/castxml_inputs/itkPyCommand.cxx:1:
  In file included from /tmp/vsc47063/easybuild/build/ITK/5.4.0/foss-2023b/ITK-5.4.0/Modules/Core/Common/include/itkComma
  nd.h:21:
  In file included from    86 | typedef __float128 _Float128;
  ...
  In file included from /kyukon/home/apps/RHEL8/cascadelake-ib/software/GCCcore/13.2.0/bin/../lib/gcc/x86_64-pc-linux-gnu
  /13.2.0/../../../../include/c++/13.2.0/cwchar:44:
  In file included from /usr/include/wchar.h:30:
  /usr/include/bits/floatn.h:86:20: error: typedef redefinition with different types ('__float128' vs 'struct __castxml_Float128_s')
  :472:   19: note: expanded from macro '_Float128'
  86  472 | #define _Float128 __castxml_Float128
      |                   ^
  <built-in>:478:124: note: previous definition is here
  478 | typedef struct __castxml_Float128_s {   __float128 x;   operator __float128() const;   __castxml_Float128_s(__float128); } __castxml_Float128;
      |                                                                                                                            ^
  | typedef __float128 _Float128;
  ...
  In file included from /usr/include/wchar.h:30:
  In file included from /usr/include/bits/floatn.h:119:
  /usr/include/bits/floatn-common.h:214:15: error: typedef redefinition with different types ('float' vs 'struct __castxml_Float32_s')
  28
      |                   ^
  <built-in>214 | typedef float _Float32;
      |               ^
  <built-in>:478:124: note: previous definition is here
  :  468:18: note: expanded from macro '_Float32'
  478 | typedef struct __castxml_Float128_s {   __float128 x;   operator __float128() const;   __castxml_Float128_s(__float128); } __castxml_Float128;
      |                                                                                                                            ^
  468 | #define _Float32 __castxml_Float32
      |                  ^
  <built-in>:474:107: note: previous definition is here
  474 | typedef struct __castxml_Float32_In file included from s {   float x;   operator float() const;   __castxml_Float32_s(float); } __castxml_Float32;
  In file included from /usr/include/wchar.h:30:
  In file included from /usr/include/bits/floatn.h:119:
  /usr/include/bits/floatn-common.h:214:15: error: typedef redefinition with different types ('float' vs 'struct __castxml_Float32_s')
  251  214 | typedef float _Float32;
      |               ^
  <built-in> | typedef double _Float64;
      |                ^
  <built-in>:468:18: note: expanded from macro '_Float32'
  :470:18: note: expanded from macro '_Float64'
  468 | #define _Float32 __castxml_Float32
      |                  ^
  <built-in>470 | #define _Float64 __castxml_Float64
      |                  ^
  <built-in>:474:107: note: previous definition is here
  :  476:110: note: previous definition is here
  474  476 | typedef struct __castxml_Float64_s {   double x;   operator double() const;   __castxml_Float64_s(double); } __castxml_Float64;
      |                                                                                                              ^
  | typedeIn file included from f struct __castxml_Float32_s {   float x;   operator float() const;   __castxml_Float32_s(float); } __castxml_Float32;

Whole log with errors is there: https://github.com/vscentrum/vsc-software-stack/blob/wip/357_Synthcity/2023b_v0.2.11_new/log3.txt

Versions

ITK 5.4.0

Environment

RHEL 8.8, 4.18.0-477.43.1.el8_8.x86_64 GCC 13.2.0 + FlexiBLAS + FFTW + ScaLAPACK + OpenMPI ('CMake', '3.27.6'), ('Bison', '3.8.2'), ('Eigen', '3.4.0'), ('SWIG', '4.1.1'), ('Perl', '5.38.0'), ('git', '2.42.0'), ('Python', '3.11.5'), ('double-conversion', '3.3.0'), ('expat', '2.5.0'), ('HDF5', '1.14.3'), ('libjpeg-turbo', '3.0.1'), ('libpng', '1.6.40'), ('LibTIFF', '4.6.0'), ('VTK', '9.3.0'), ('zlib', '1.2.13'), ('CastXML', '0.6.5'),

Additional Information

For me it seems similar to this problem you already fix: https://github.com/InsightSoftwareConsortium/ITK/commit/d0275869d10dacee7bcf72ed2174f523d66c7df0#diff-e7b9b1d2d1251e3340d02c7aae095ff229a0490fad2ff108c71eadc011961deeR25

github-actions[bot] commented 3 weeks ago

Thank you for contributing an issue! 🙏

Welcome to the ITK community! 🤗👋☀️

We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜 Also, please check existing open issues and consider discussion on the ITK Discourse. 📖

This is an automatic message. Allow for time for the ITK community to be able to read the issue and comment on it.

dzenanz commented 3 weeks ago

Why not try the latest CastXML then? Or the bundled one, by setting -DITK_USE_SYSTEM_CASTXML=OFF?

thewtex commented 3 weeks ago

('CastXML', '0.6.5'),

Hi @pavelToman , does upgrading to CastXML 0.6.8 address the issue?

pavelToman commented 3 weeks ago

I let it build with bundled one - but it use precompiled binaries (not ideal for our system). And with bundled CastXML the errors are the same. So I try to replace it by CastXML builded on our system. I let the version be the same as the bundled one - thought it fits best for ITK 5.4.0. But I can try to build another version of CastXML and use it.

pavelToman commented 3 weeks ago

I build CastXML 0.6.8 and use it as dependency of ITK 5.4.0, but the errors during make step are the same

thewtex commented 3 weeks ago

@pavelToman thanks for the follow-up. To help identify the issue, do you get the same error: