Convert3D build failure on CentOS

204 views
Skip to first unread message

deeps...@gmail.com

unread,
Jan 30, 2024, 1:15:12 PMJan 30
to itksnap-users
Dear ITK-SNAP users,

I am trying to build Convert3D from source, and I am having build failures.

I was able to build the most up-to-date version of ITK5 (https://github.com/InsightSoftwareConsortium/ITK.git, commit: 8061d3ce1504e30203235ab16c5e2f9507145e24), and I have cloned the Convert3D source from https://github.com/pyushkevich/c3d.git with the master branch.

I am using gcc/9.2.0 and cmake/3.22.2 (which I built ITK5), I have the following error during build:

[ 53%] Building CXX object CMakeFiles/cnd_driver.dir/adapters/PrintImageInfo.cxx.o
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx: In member function ‘void PrintImageInfo<TPixel, VDim>::operator()(bool)’:
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:212:34: error: ‘ITK_COORDINATE_ORIENTATION_INVALID’ is not a member of ‘itk::SpatialOrientation’; did you mean ‘ITK_COORDINATE_ORIENTATION_IAL’?
  212 |         itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_INVALID;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                  ITK_COORDINATE_ORIENTATION_IAL
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx: In instantiation of ‘void PrintImageInfo<TPixel, VDim>::operator()(bool) [with TPixel = double; unsigned int VDim = 2]’:
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:258:16:   required from here
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:195:5: warning: ‘vnl_matrix_fixed<T, num_rows, num_cols>::operator const vnl_matrix_ref<T>() const [with T = double; unsigned int num_rows = 2; unsigned int num_cols = 2]’ is deprecated: Implicit cast conversion is dangerous.\nUSE: .as_matrix() or .as_ref() member function for clarity. [-Wdeprecated-declarations]
  195 |     c->PrintMatrix(c->sout(), image->GetDirection().GetVnlMatrix());
      |     ^
In file included from /n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.hxx:9,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkMatrix.h:25,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImageBase.h:34,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h:22,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImage.h:28,
                 from /home/cl266/workspace/c3d/itkextras/itkOrientedRASImage.h:4,
                 from /home/cl266/workspace/c3d/ConvertImageND.h:29,
                 from /home/cl266/workspace/c3d/adapters/ConvertAdapter.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:26:
/n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.h:704:3: note: declared here
  704 |   operator const vnl_matrix_ref<T>() const { return  this->as_ref(); }
      |   ^~~~~~~~
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:199:5: warning: ‘vnl_matrix_fixed<T, num_rows, num_cols>::operator const vnl_matrix_ref<T>() const [with T = double; unsigned int num_rows = 3; unsigned int num_cols = 3]’ is deprecated: Implicit cast conversion is dangerous.\nUSE: .as_matrix() or .as_ref() member function for clarity. [-Wdeprecated-declarations]
  199 |     c->PrintMatrix(c->sout(),
      |     ^
In file included from /n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.hxx:9,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkMatrix.h:25,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImageBase.h:34,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h:22,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImage.h:28,
                 from /home/cl266/workspace/c3d/itkextras/itkOrientedRASImage.h:4,
                 from /home/cl266/workspace/c3d/ConvertImageND.h:29,
                 from /home/cl266/workspace/c3d/adapters/ConvertAdapter.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:26:
/n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.h:704:3: note: declared here
  704 |   operator const vnl_matrix_ref<T>() const { return  this->as_ref(); }
      |   ^~~~~~~~
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx: In instantiation of ‘void PrintImageInfo<TPixel, VDim>::operator()(bool) [with TPixel = double; unsigned int VDim = 3]’:
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:259:16:   required from here
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:195:5: warning: ‘vnl_matrix_fixed<T, num_rows, num_cols>::operator const vnl_matrix_ref<T>() const [with T = double; unsigned int num_rows = 3; unsigned int num_cols = 3]’ is deprecated: Implicit cast conversion is dangerous.\nUSE: .as_matrix() or .as_ref() member function for clarity. [-Wdeprecated-declarations]
  195 |     c->PrintMatrix(c->sout(), image->GetDirection().GetVnlMatrix());
      |     ^
In file included from /n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.hxx:9,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkMatrix.h:25,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImageBase.h:34,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h:22,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImage.h:28,
                 from /home/cl266/workspace/c3d/itkextras/itkOrientedRASImage.h:4,
                 from /home/cl266/workspace/c3d/ConvertImageND.h:29,
                 from /home/cl266/workspace/c3d/adapters/ConvertAdapter.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:26:
/n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.h:704:3: note: declared here
  704 |   operator const vnl_matrix_ref<T>() const { return  this->as_ref(); }
      |   ^~~~~~~~
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:199:5: warning: ‘vnl_matrix_fixed<T, num_rows, num_cols>::operator const vnl_matrix_ref<T>() const [with T = double; unsigned int num_rows = 4; unsigned int num_cols = 4]’ is deprecated: Implicit cast conversion is dangerous.\nUSE: .as_matrix() or .as_ref() member function for clarity. [-Wdeprecated-declarations]
  199 |     c->PrintMatrix(c->sout(),
      |     ^
In file included from /n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.hxx:9,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkMatrix.h:25,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImageBase.h:34,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h:22,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImage.h:28,
                 from /home/cl266/workspace/c3d/itkextras/itkOrientedRASImage.h:4,
                 from /home/cl266/workspace/c3d/ConvertImageND.h:29,
                 from /home/cl266/workspace/c3d/adapters/ConvertAdapter.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:26:
/n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.h:704:3: note: declared here
  704 |   operator const vnl_matrix_ref<T>() const { return  this->as_ref(); }
      |   ^~~~~~~~
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx: In instantiation of ‘void PrintImageInfo<TPixel, VDim>::operator()(bool) [with TPixel = double; unsigned int VDim = 4]’:
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:260:16:   required from here
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:195:5: warning: ‘vnl_matrix_fixed<T, num_rows, num_cols>::operator const vnl_matrix_ref<T>() const [with T = double; unsigned int num_rows = 4; unsigned int num_cols = 4]’ is deprecated: Implicit cast conversion is dangerous.\nUSE: .as_matrix() or .as_ref() member function for clarity. [-Wdeprecated-declarations]
  195 |     c->PrintMatrix(c->sout(), image->GetDirection().GetVnlMatrix());
      |     ^
In file included from /n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.hxx:9,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkMatrix.h:25,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImageBase.h:34,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h:22,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImage.h:28,
                 from /home/cl266/workspace/c3d/itkextras/itkOrientedRASImage.h:4,
                 from /home/cl266/workspace/c3d/ConvertImageND.h:29,
                 from /home/cl266/workspace/c3d/adapters/ConvertAdapter.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:26:
/n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.h:704:3: note: declared here
  704 |   operator const vnl_matrix_ref<T>() const { return  this->as_ref(); }
      |   ^~~~~~~~
/home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:199:5: warning: ‘vnl_matrix_fixed<T, num_rows, num_cols>::operator const vnl_matrix_ref<T>() const [with T = double; unsigned int num_rows = 5; unsigned int num_cols = 5]’ is deprecated: Implicit cast conversion is dangerous.\nUSE: .as_matrix() or .as_ref() member function for clarity. [-Wdeprecated-declarations]
  199 |     c->PrintMatrix(c->sout(),
      |     ^
In file included from /n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.hxx:9,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkMatrix.h:25,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImageBase.h:34,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h:22,
                 from /n/scratch/users/c/cl266/ITK/Modules/Core/Common/include/itkImage.h:28,
                 from /home/cl266/workspace/c3d/itkextras/itkOrientedRASImage.h:4,
                 from /home/cl266/workspace/c3d/ConvertImageND.h:29,
                 from /home/cl266/workspace/c3d/adapters/ConvertAdapter.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.h:29,
                 from /home/cl266/workspace/c3d/adapters/PrintImageInfo.cxx:26:
/n/scratch/users/c/cl266/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.h:704:3: note: declared here
  704 |   operator const vnl_matrix_ref<T>() const { return  this->as_ref(); }
      |   ^~~~~~~~
make[2]: *** [CMakeFiles/cnd_driver.dir/adapters/PrintImageInfo.cxx.o] Error 1
make[1]: *** [CMakeFiles/cnd_driver.dir/all] Error 2
make: *** [all] Error 2

How should I move forward for building from source? Any tips appreciated.

Paul Yushkevich

unread,
Jan 30, 2024, 3:20:28 PMJan 30
to itksna...@googlegroups.com
ITK made a lot of changes in 5.4, we have not yet brought our code up with these changes. I think if you build against 5.2, you will not have the same errors.

--
You received this message because you are subscribed to the Google Groups "itksnap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to itksnap-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/itksnap-users/6c1f92c7-20d2-48f8-b5b8-11f1d8647f41n%40googlegroups.com.

deeps...@gmail.com

unread,
Jan 31, 2024, 8:52:49 AMJan 31
to itksnap-users
Thank you! Per your recommendation, I have re-built the ITK with checking out v5.2.1 tag from source (cleaning up clutter), by creating a new ITK build directory and successfully building it.

Then, I tried to build convert3D using the path, and initially I have a cmake error that it cannot find remote module. I switched off the remote module option (CONVERT3D_USE_ITK_REMOTE_MODUL) and generate the configuration and make it and have the following error:

[ 60%] Building CXX object CMakeFiles/cnd_driver.dir/adapters/RFApply.cxx.o
In file included from /home/cl266/workspace/c3d/itkextras/RandomForest/RandomForestClassifyImageFilter.txx:7,
                 from /home/cl266/workspace/c3d/itkextras/RandomForest/RandomForestClassifyImageFilter.h:95,
                 from /home/cl266/workspace/c3d/adapters/RFApply.cxx:27:
/home/cl266/workspace/c3d/itkextras/ImageCollectionConstIteratorWithIndex.h:297:48: error: ‘typename ImageCollectionConstIteratorWithIndex<TScalarImage, TVectorImage>::Self::ImageData’ names ‘template<class TScalarImage, class TVectorImage> template<class T> class ImageCollectionConstIteratorWithIndex<TScalarImage, TVectorImage>::ImageData’, which is not a type
  297 |   typedef typename Self::ImageData<TScalarImage> ScalarImageData;
      |                                                ^
/home/cl266/workspace/c3d/itkextras/ImageCollectionConstIteratorWithIndex.h:298:48: error: ‘typename ImageCollectionConstIteratorWithIndex<TScalarImage, TVectorImage>::Self::ImageData’ names ‘template<class TScalarImage, class TVectorImage> template<class T> class ImageCollectionConstIteratorWithIndex<TScalarImage, TVectorImage>::ImageData’, which is not a type
  298 |   typedef typename Self::ImageData<TVectorImage> VectorImageData;
      |                                                ^
make[2]: *** [CMakeFiles/cnd_driver.dir/adapters/RFApply.cxx.o] Error 1

make[1]: *** [CMakeFiles/cnd_driver.dir/all] Error 2
make: *** [all] Error 2

What should I do to make it build? Maybe I should use a different tag to build ITK?

Jilei Hao

unread,
Jan 31, 2024, 11:29:01 AMJan 31
to itksna...@googlegroups.com
Can you try the following cmake option?

CXXFLAGS "-std=c++11 -fpermissive"

Best,
Jilei

deeps...@gmail.com

unread,
Jan 31, 2024, 1:56:16 PMJan 31
to itksnap-users
Thank you for your suggestion, It is making the same error:

[  7%] Building CXX object CMakeFiles/cnd_driver.dir/adapters/RFApply.cxx.o

In file included from /home/cl266/workspace/c3d/itkextras/RandomForest/RandomForestClassifyImageFilter.txx:7,
                 from /home/cl266/workspace/c3d/itkextras/RandomForest/RandomForestClassifyImageFilter.h:95,
                 from /home/cl266/workspace/c3d/adapters/RFApply.cxx:27:
/home/cl266/workspace/c3d/itkextras/ImageCollectionConstIteratorWithIndex.h:297:48: error: ‘typename ImageCollectionConstIteratorWithIndex<TScalarImage, TVectorImage>::Self::ImageData’ names ‘template<class TScalarImage, class TVectorImage> template<class T> class ImageCollectionConstIteratorWithIndex<TScalarImage, TVectorImage>::ImageData’, which is not a type
  297 |   typedef typename Self::ImageData<TScalarImage> ScalarImageData;
      |                                                ^
/home/cl266/workspace/c3d/itkextras/ImageCollectionConstIteratorWithIndex.h:298:48: error: ‘typename ImageCollectionConstIteratorWithIndex<TScalarImage, TVectorImage>::Self::ImageData’ names ‘template<class TScalarImage, class TVectorImage> template<class T> class ImageCollectionConstIteratorWithIndex<TScalarImage, TVectorImage>::ImageData’, which is not a type
  298 |   typedef typename Self::ImageData<TVectorImage> VectorImageData;
      |                                                ^
make[2]: *** [CMakeFiles/cnd_driver.dir/adapters/RFApply.cxx.o] Error 1
make[1]: *** [CMakeFiles/cnd_driver.dir/all] Error 2
make: *** [all] Error 2

I changed the CMAKE_CXX_FLAGS option to -std=c++11 -fpermissive as you suggested, but in vain.

Any suggestions moving forward greatly appreciated.
Reply all
Reply to author
Forward
0 new messages