Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation problems on Ubuntu 20.04 after SuperBuild rebuild #443

Closed
Ede1994 opened this issue Nov 16, 2020 · 21 comments
Closed

compilation problems on Ubuntu 20.04 after SuperBuild rebuild #443

Ede1994 opened this issue Nov 16, 2020 · 21 comments

Comments

@Ede1994
Copy link

Ede1994 commented Nov 16, 2020

Actually I only wanted to enable OpenMP afterwards, but since then I get several error messages when rebuilding. Recently I did the following:

cmake ../Source \
        -DCMAKE_INSTALL_PREFIX=${SIRF_INSTALL_PATH} \
        -U\*_URL -U\*_TAG \
        -DUSE_SYSTEM_SWIG=ON \
        -DUSE_SYSTEM_Boost=OFF \
        -DUSE_SYSTEM_Armadillo=ON \
        -DUSE_SYSTEM_FFTW3=ON \
        -DUSE_SYSTEM_HDF5=ON \
        -DBUILD_siemens_to_ismrmrd=OFF \
        -DUSE_ITK=ON \
        -DDEVEL_BUILD=ON \
        -DBUILD_CIL_LITE=OFF \
        -DNIFTYREG_USE_CUDA=OFF \
        -DBUILD_GADGETRON:BOOL=OFF \
        -DBUILD_TESTING_ISMRMRD:BOOL=OFF

After make -j 1 2>&1 | tee error_msg.txt I get the following error (detailed log is in the attached txt-file):

/home/eric/SIRF-SuperBuild/Source/sources/ITK/Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h:101:4: error: #error "Dunno about this gcc"
  101 | #  error "Dunno about this gcc"
      |    ^~~~~
make[5]: *** [Modules/ThirdParty/VNL/src/vxl/vcl/CMakeFiles/itkvcl.dir/build.make:63: Modules/ThirdParty/VNL/src/vxl/vcl/CMakeFiles/itkvcl.dir/vcl_deprecated.cxx.o] Fehler 1
make[4]: *** [CMakeFiles/Makefile2:5635: Modules/ThirdParty/VNL/src/vxl/vcl/CMakeFiles/itkvcl.dir/all] Fehler 2
make[3]: *** [Makefile:152: all] Fehler 2
make[2]: *** [CMakeFiles/ITK.dir/build.make:113: builds/ITK/stamp/ITK-build] Fehler 2
make[1]: *** [CMakeFiles/Makefile2:209: CMakeFiles/ITK.dir/all] Fehler 2
make: *** [Makefile:95: all] Fehler 2

error_msg.txt

@KrisThielemans KrisThielemans changed the title Error message after SuperBuild rebuild ITK Error message after SuperBuild rebuild Nov 16, 2020
@KrisThielemans
Copy link
Member

Ubuntu 20.04? Which is the default compiler used? (if just using the default, cc --version)

Possibly it is too recent for the ITK version that we default to. Checking vcl_compiler.h on my machine they go up to gcc 8.3.

Either downgrade your compiler, or upgrade ITK. I believe -DITK_TAG=v5.1.1 could do the trick as I'm not aware of any incompatibilities introduced that matter to us, but please run all tests. One way to do that is to create a PR on the superbuild that modifies version_config.cmake.

By the way, I cannot believe that this is "just" a rebuild. I strongly suspect you updated your system somewhere in between.

@Ede1994
Copy link
Author

Ede1994 commented Nov 17, 2020

Yes, Ubuntu 20.04. I have now switched my compiler from gcc-9 to gcc-8, then the ITK build ran through. But now I have another error:

/home/eric/SIRF-SuperBuild/Install/include/sirf/NiftyMoMo/BSplineTransformation.h:41:7: note: ‘class NiftyMoMo::BSplineTransformation’ defined here
 class BSplineTransformation :public Transformation
       ^~~~~~~~~~~~~~~~~~~~~
make[5]: *** [src/Registration/NiftyMoMo/CMakeFiles/NiftyMoMo.dir/build.make:82: src/Registration/NiftyMoMo/CMakeFiles/NiftyMoMo.dir/BSplineTransformation.cpp.o] Fehler 1
make[4]: *** [CMakeFiles/Makefile2:523: src/Registration/NiftyMoMo/CMakeFiles/NiftyMoMo.dir/all] Fehler 2
make[3]: *** [Makefile:160: all] Fehler 2
make[2]: *** [CMakeFiles/SIRF.dir/build.make:138: builds/SIRF/stamp/SIRF-build] Fehler 2
make[1]: *** [CMakeFiles/Makefile2:232: CMakeFiles/SIRF.dir/all] Fehler 2
make: *** [Makefile:114: all] Fehler 2

error_msg.txt

@KrisThielemans
Copy link
Member

KrisThielemans commented Nov 17, 2020

You missed the important bit from the error message

[  6%] Building CXX object src/Registration/NiftyMoMo/CMakeFiles/NiftyMoMo.dir/BSplineTransformation.cpp.o
/home/eric/SIRF-SuperBuild/Source/sources/SIRF/src/Registration/NiftyMoMo/BSplineTransformation.cpp:1340:39: error: no declaration matches ‘NiftyMoMo::BSplineTransformation::PrecisionType* NiftyMoMo::BSplineTransformation::GetDVFGradientWRTTransformationParameters(nifti_image*)’
 BSplineTransformation::PrecisionType* BSplineTransformation::GetDVFGradientWRTTransformationParameters( nifti_image* denseDVFIn )
                                       ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/eric/SIRF-SuperBuild/Source/sources/SIRF/src/Registration/NiftyMoMo/BSplineTransformation.cpp:21:
/home/eric/SIRF-SuperBuild/Install/include/sirf/NiftyMoMo/BSplineTransformation.h:90:49: note: candidate is: ‘virtual NiftyMoMo::BSplineTransformation::PrecisionType* NiftyMoMo::BSplineTransformation::GetDVFGradientWRTTransformationParameters(nifti_image*, nifti_image*)’
   virtual BSplineTransformation::PrecisionType* GetDVFGradientWRTTransformationParameters( nifti_image* denseDVFIn, nifti_image* sourceImage );
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/eric/SIRF-SuperBuild/Source/sources/SIRF/src/Registration/NiftyMoMo/BSplineTransformation.cpp:21:
/home/eric/SIRF-SuperBuild/Install/include/sirf/NiftyMoMo/BSplineTransformation.h:41:7: note: ‘class NiftyMoMo::BSplineTransformation’ defined here
 class BSplineTransformation :public Transformation

I believe this is SyneRBI/SIRF#659. Current solution:

rm -rf /home/eric/SIRF-SuperBuild/Install/include/
make

@KrisThielemans
Copy link
Member

I've edited https://github.com/SyneRBI/SIRF/wiki/Rebuilding-after-upgrades to make this clearer. Feel free to improve on that text!

@Ede1994
Copy link
Author

Ede1994 commented Nov 17, 2020

Okay. That helped. Now, next error:

/usr/bin/ld: cgadgetron.cpp:(.text.startup+0x36): undefined reference to `boost::system::generic_category()'
/usr/bin/ld: cgadgetron.cpp:(.text.startup+0x3b): undefined reference to `boost::system::system_category()'
/usr/bin/ld: cgadgetron.cpp:(.text.startup+0x40): undefined reference to `boost::system::system_category()'
collect2: error: ld returned 1 exit status
make[5]: *** [src/xGadgetron/cGadgetron/tests/CMakeFiles/MR_TESTS_CPLUSPLUS.dir/build.make:444: src/xGadgetron/cGadgetron/tests/MR_TESTS_CPLUSPLUS] Fehler 1
make[4]: *** [CMakeFiles/Makefile2:870: src/xGadgetron/cGadgetron/tests/CMakeFiles/MR_TESTS_CPLUSPLUS.dir/all] Fehler 2
make[3]: *** [Makefile:160: all] Fehler 2
make[2]: *** [CMakeFiles/SIRF.dir/build.make:138: builds/SIRF/stamp/SIRF-build] Fehler 2
make[1]: *** [CMakeFiles/Makefile2:201: CMakeFiles/SIRF.dir/all] Fehler 2
make: *** [Makefile:114: all] Fehler 2

I've tried to USE_SYSTEM_BOOST ON and OFF. Both created the same error.
error_msg.txt

@KrisThielemans
Copy link
Member

oh well. weird that you're getting this now of course. Sort of sounds like it's still picking up mixed boost versions, but I'm not sure. Can you try the following:

  1. change sources/SIRF/CMakeLists.txt by added the following line
add_definitions(-DBOOST_SYSTEM_NO_DEPRECATED)

after L99 (where it adds BOOST_ALL_NO_LIB).

  1. do cmake -DDISABLE_GIT_CHECKOUT:BOOL=ON .; make -j4
  2. If that doesn't work, repeat after adding
add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY)

If that doesn't work,

rm builds/SIRF/build/CMakeFiles/MR_TESTS_CPLUSPLUS.dir/mrtests.cpp.o
make VERBOSE=ON >& verbose.log

and send us that one.

@KrisThielemans
Copy link
Member

By the way, your log file contained a lot of ugly things like

   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.

seems that vtk-7.1 has its own problems! Luckily they don't seem to have affected you (yet)

@Ede1994
Copy link
Author

Ede1994 commented Nov 18, 2020

Sooooo...same error.
builds/SIRF/build/CMakeFiles/MR_TESTS_CPLUSPLUS.dir/mrtests.cpp.o doesn't exist.
I found only builds/SIRF/build/src/xGadgetron/cGadgetron/tests/CMakeFiles/MR_TESTS_CPLUSPLUS.dir/mrtests.cpp.o. I've deleted this, but without any success.
verbose.log

@KrisThielemans KrisThielemans changed the title ITK Error message after SuperBuild rebuild compilation problems on Ubuntu 20.04 after SuperBuild rebuild Nov 18, 2020
@KrisThielemans
Copy link
Member

in your log file, I see

cd /home/eric/SIRF-SuperBuild/Build/builds/SIRF/build/src/xGadgetron/cGadgetron/tests && /usr/bin/c++  -DBOOST_ALL_NO_LIB -DSIRF_VTK -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/common -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/common/include -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/iUtilities -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/iUtilities/include -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/Synergistic/cSyn -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/Synergistic/cSyn/include -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/xGadgetron/cGadgetron -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/xGadgetron/cGadgetron/include -I/usr/include/hdf5/serial -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/xSTIR/cSTIR/include -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/xSTIR/cSTIR -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/Registration/cReg/include -I/usr/include/vtk-7.1 -I/home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/Registration/NiftyMoMo/include -isystem /home/eric/SIRF-SuperBuild/Install/include -isystem /home/eric/SIRF-SuperBuild/Install/include/ismrmrd -isystem /usr/include/ITK-4.13 -isystem /usr/include/gdcm-3.0  -O3 -DNDEBUG -fPIE   -fopenmp -std=gnu++11 -o CMakeFiles/MR_TESTS_CPLUSPLUS.dir/mrtests.cpp.o -c /home/eric/SIRF-SuperBuild/Build/sources/SIRF/src/xGadgetron/cGadgetron/tests/mrtests.cpp

This means that the boost-related modifications (with add_definitions) were not taken on board for some reason. If you do have it in the files, then I guess I'd remove builds/SIRF, redo the cmake and make again.

Otherwise, we can force it without the SuperBuild for now (but it'll come and bite you later)

cd builds/SIRF/build
cmake . -DCMAKE_CXX_FLAGS="-DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_NO_DEPRECATED"
make -j4 install

However, once you start doing this, any build from the SuperBuild main directory will likely overwrite whatever you did in the SIRF build directory.

If it still doesn't work, remove the mrtests.cpp.o again, do the verbose make, and check if the compilation flags now include the above.

@KrisThielemans
Copy link
Member

hmmm. checking my own installation, I see that those flags are there. In fact, we have

# Avoid linking problems with boost system, specifically
# boost::system::detail::generic_category_instance
# by forcing Boost to use an inline variable, as opposed to
# the instantiated variable in the library
# See https://github.com/SyneRBI/SIRF-SuperBuild/issues/161
set(Boost_CMAKE_ARGS ${Boost_CMAKE_ARGS}
-DCMAKE_CXX_FLAGS:STRING=-DBOOST_ERROR_CODE_HEADER_ONLY\ -DBOOST_SYSTEM_NO_DEPRECATED)

So... what version of the SuperBuild are you using?

@Ede1994
Copy link
Author

Ede1994 commented Nov 19, 2020

HAHA! It works! I just did this steps again:

rm builds/SIRF
  1. change sources/SIRF/CMakeLists.txt by added the following line
add_definitions(-DBOOST_SYSTEM_NO_DEPRECATED)
add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY)
make

I don't know why it didn't work the first time, but it worked the second time. SO I'm happy :)
Thank you so much!!!!!!

@KrisThielemans
Copy link
Member

😄

Could you please confirm your SuperBuild version, and in particular if you have the above quoted lines in your SuperBuild/External_Boost.cmake. If so, we need to think why you still needed to add these variables by hand.

If you do have them, I'd like to ask you to restart this process, which you could do via

mv sources/SIRF sources/SIRF-that-worked
mv builds/SIRF builds/SIRF-that-worked
cmake -DDISABLE_GIT_CHECKOUT:BOOL=OFF .
make -j4

If that works, it was a case of existing files messing everything up (and downgrading to gcc8)

@Ede1994
Copy link
Author

Ede1994 commented Nov 19, 2020

I hope that is the correct way to confirm the SuperBuild version: DEFAULT_SIRF_TAG v2.2.0 ? Or should I use a special command?

Could you please confirm your SuperBuild version, and in particular if you have the above quoted lines in your SuperBuild/External_Boost.cmake. If so, we need to think why you still needed to add these variables by hand.

I can't find any indicator in SuperBuild/External_Boost.cmake

mv sources/SIRF sources/SIRF-that-worked
mv builds/SIRF builds/SIRF-that-worked
cmake -DDISABLE_GIT_CHECKOUT:BOOL=OFF .
make -j4

-> same error message occurs

error_msg.txt

@Ede1994
Copy link
Author

Ede1994 commented Nov 19, 2020

I hope that is the correct way to confirm the SuperBuild version: DEFAULT_SIRF_TAG v2.2.0 ? Or should I use a special command?

I can't find any indicator in SuperBuild/External_Boost.cmake

mv sources/SIRF sources/SIRF-that-worked
mv builds/SIRF builds/SIRF-that-worked
cmake -DDISABLE_GIT_CHECKOUT:BOOL=OFF .
make -j4

-> same error message occurs

error_msg.txt

@Ede1994 Ede1994 closed this as completed Nov 19, 2020
@Ede1994 Ede1994 reopened this Nov 19, 2020
@KrisThielemans
Copy link
Member

ok,

cd ~/devel/SIRF-SuperBuild # or wherever your source is
git checkout master

that'll help!

@Ede1994
Copy link
Author

Ede1994 commented Nov 19, 2020

cd ~/devel/SIRF-SuperBuild # or wherever your source is
git checkout master

Delivered:

Already on 'master
Your branch is on the same level as 'origin/master'.

(own translation, because I use linux in german)

@KrisThielemans
Copy link
Member

KrisThielemans commented Nov 19, 2020

I forgot git pull

@Ede1994
Copy link
Author

Ede1994 commented Nov 19, 2020

Okay. git pull:

remote: Counting objects: 100% (94/94), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 121 (delta 83), reused 90 (delta 81), pack-reused 27
Empfange Objekte: 100% (121/121), 26.43 KiB | 1.65 MiB/s, Fertig.
Löse Unterschiede auf: 100% (83/83), abgeschlossen mit 26 lokalen Objekten.
Von https://github.com/SyneRBI/SIRF-SuperBuild
   d05907b..0365a51  master                 -> origin/master
 * [neuer Branch]    build_Gadgetron_master -> origin/build_Gadgetron_master
 * [neuer Branch]    stir_build_swig        -> origin/stir_build_swig
 * [neuer Branch]    update_cil_master      -> origin/update_cil_master
Aktualisiere d05907b..0365a51
Fast-forward
 .travis.yml                                    | 78 +++++++++++++++++++----------------------------
 CMake/SetGitTagAndRepo.cmake                   | 18 ++++++-----
 SuperBuild/External_Armadillo.cmake            |  1 +
 SuperBuild/External_Boost.cmake                |  8 +++++
 SuperBuild/External_CCPi-Framework.cmake       |  3 ++
 SuperBuild/External_FFTW3.cmake                | 19 +++++++++---
 SuperBuild/External_FFTW3double.cmake          |  4 ---
 SuperBuild/External_FFTW_build.cmake           |  0
 SuperBuild/External_FFTW_configure.cmake       |  0
 SuperBuild/External_FFTWdouble_build.cmake     |  0
 SuperBuild/External_FFTWdouble_configure.cmake |  0
 SuperBuild/External_Gadgetron.cmake            |  1 +
 SuperBuild/External_HDF5.cmake                 |  1 +
 SuperBuild/External_ISMRMRD.cmake              |  1 +
 SuperBuild/External_ITK.cmake                  | 18 +++++++++++
 SuperBuild/External_SIRF.cmake                 |  1 +
 SuperBuild/External_STIR.cmake                 | 21 ++++++++-----
 version_config.cmake                           |  2 +-
 18 files changed, 104 insertions(+), 72 deletions(-)
 delete mode 100644 SuperBuild/External_FFTW_build.cmake
 delete mode 100644 SuperBuild/External_FFTW_configure.cmake
 delete mode 100644 SuperBuild/External_FFTWdouble_build.cmake
 delete mode 100644 SuperBuild/External_FFTWdouble_configure.cmake

@KrisThielemans
Copy link
Member

ok, now build again.

@Ede1994
Copy link
Author

Ede1994 commented Nov 19, 2020

It works.

@KrisThielemans
Copy link
Member

ok great!

For posterity:

  • currently have to use gcc8
  • remove existing build and install (see wiki)
  • use SIRF-SuperBuild master, at least until we have a new release.

This is more positive than feared.

thanks Eric!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants