Elastix build error

As seen here http://slicer.cdash.org/buildSummary.php?buildid=1809996

elastix is failing and it is not being built, there is any schedule to solve this issue, it seems quite complicated errors there

Thank you, probably we just need to update to a more recent Elastix version that is compatible with the ITK version that Slicer uses. Could you give it a try?

Since Elastix is not core part of slicer I don’t know how to test this:

  • Shall I build slicer, then elastix?
  • Shall I build only elastix?

Never tried this before

Yes, first you need to build Slicer and then build SlicerElastix extension.

I had a look at this build error. It is due to recent backward-incompatible changes in ITK related to typed enums. I applied a quick patch to Elastix in my fork and switched to this patched version for now. This should fix the build problem in SlicerElastix.

@dzenanz I don’t know if these kind of issues are expected with ITK-v5.1rc01 but it would be nice if the final ITK-v5.1 release would not have such problems.

Well, that was not enough accordingly to http://slicer.cdash.org/buildSummary.php?buildid=1811816

I anm currently running a test in a container with

# only one stage, since gitlab-ci does not support passing images between stages
image: unnmdnwb3/slicer3d-nightly:0.7.0

build-and-test:
  variables:
    DISPLAY: ":99.0"
  script:
    - mkdir $CI_BUILDS_DIR/elastix-build && cd $CI_BUILDS_DIR/elastix-build
    - cmake -DSlicer_DIR:PATH=/usr/src/Slicer-build/Slicer-build -DITK_DIR:PATH$
    - make -j32

Build is successful on Windows and Linux now, but yes, the compiler on MacOS still struggles with some type conversion. I saw similar issue when we first built Slicer and BRAINSTools with ITK5 a d probably the solution will be similar, too. I’ll try to fix it today, but I don’t have a Mac to test on, so it may take a few more days until we converge to a solution.

For reference this is the container output (truncated)

/builds/project-0/Common/Transforms/itkAdvancedRigid2DTransform.hxx:125:5: warning: ‘vnl_matrix_fixed<T, num_rows, num_cols>::operator const vnl_matrix_ref<T>() const [with T = double; unsigned int num_rows = 2u; unsigned int num_cols = 2u]’ is deprecated: Implicit cast conversion is dangerous.
USE: .as_vector() or .as_ref() member function for clarity. [-Wdeprecated-declarations]
   p = this->GetMatrix().GetVnlMatrix();
     ^
In file included from /usr/src/Slicer-build/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.hxx:9:0,
                 from /usr/src/Slicer-build/ITK/Modules/Core/Common/include/itkMatrix.h:25,
                 from /usr/src/Slicer-build/ITK/Modules/Core/Common/include/itkSymmetricSecondRankTensor.h:28,
                 from /usr/src/Slicer-build/ITK/Modules/IO/ImageBase/include/itkImageIOBase.h:30,
                 from /usr/src/Slicer-build/ITK/Modules/IO/ImageBase/include/itkImageFileReader.h:24,
                 from /builds/project-0/Core/Kernel/elxElastixBase.h:39,
                 from /builds/project-0/Core/Kernel/elxElastixTemplate.h:21,
                 from /builds/project-0/Core/Install/elxIncludes.h:39,
                 from /builds/project-0/Components/Transforms/EulerStackTransform/elxEulerStackTransform.h:21,
                 from /builds/project-0/Components/Transforms/EulerStackTransform/elxEulerStackTransform.cxx:19:
/usr/src/Slicer-build/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_matrix_fixed.h:687:3: note: declared here
   operator const vnl_matrix_ref<T>() const { return  this->as_ref(); }
   ^

[ 99%] Linking CXX executable ../bin/elastix
[100%] Linking CXX executable ../bin/transformix
[100%] Built target elastix
[100%] Built target transformix
e[0KAuthenticating with credentials from /home/alex/.docker/config.json
e[0;me[0KAuthenticating with credentials from /home/alex/.docker/config.json
e[0;me[32;1mJob succeeded
e[0;m

I’ve committed a change in Elastix that fixed a similar issue in Slicer core. We’ll see tomorrow on the dashboard if this fixes the Mac build error.

Elastix build error is now fixed on Mac. It would be great if you could check if it works well.

Well It is being built

And it is running very well

Great, thanks for testing!