Compiling TubeTK v1.1 or v1.0.0 with ITK 5.3rc03

Continuing the discussion from Compiling ~MinimalPathExtraction~ with ITK 5.2.1:

Hello! (This is not a request for help) I’m getting this error with v1.1 (8cb12a20) and v1.0.0 of TubeTK.

  samu: file is missing and not created by any action: '/usr/lib/libdl.so'

When using GNU Make, this is the result:

  [ 46%] Built target ITKImageLabelSwig
  make[2]: *** No rule to make target '/usr/lib/libdl.so', needed by 'Wrapping/Generators/Python/itk/libitkTubeTK-5.3.so.1'.  Stop.
  make[1]: *** [CMakeFiles/Makefile2:14113: Modules/Remote/TubeTK/src/CMakeFiles/TubeTK.dir/all] Error 2

I (regex-)replaced ‘libdl..so’ and 'libdl..a’ with ‘libdl.so.2’ (which exists in my system) in the source directories before running /CMake/ like this:

  find . -type f -exec grep -l libdl \{\} + |
      parallel 'sed -i "s%libdl.*\.\(so\|a\)[[:digit:].]*%libdl.so.2%g" {}'

After this change, the compilation seems to be working with Samurai (Ninja equivalent; did not try with GNU Make, because it takes longer to show the error).

I have checked, and gnu/lib-names-64.h does include "libdl.so.2"

These are my compilation options (I use the same to build ITK with other modules):

    -S "${srcdir}"/"${_pkgbase}"
    -B "${_build_dir}"

    -DCMAKE_INSTALL_PREFIX:FILEPATH=/usr
    -DCMAKE_BUILD_TYPE:STRING=Release
    -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF
    --log-level="NOTICE"

    -DCMAKE_CXX_FLAGS:STRING="-std=c++11 -pipe -fno-plt -fPIC -fopenmp -march=native -mtune=native -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS -fcf-protection -fno-plt -fstack-clash-protection -Wformat -Werror=format-security -O2 -L/usr/lib -ldl"
    -DCMAKE_C_FLAGS:STRING="-pipe -fno-plt -fPIC -fopenmp -march=native -mtune=native -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS -fcf-protection -fno-plt -fstack-clash-protection -Wformat -Werror=format-security -O2"
    -DITK_CXX_OPTIMIZATION_FLAGS:STRING="-pipe -fno-plt -fPIC -fopenmp -march=native -mtune=native -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS -fcf-protection -fno-plt -fstack-clash-protection -Wformat -Werror=format-security -O3"
    -DITK_C_OPTIMIZATION_FLAGS:STRING="-pipe -fno-plt -fPIC -fopenmp -march=native -mtune=native -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS -fcf-protection -fno-plt -fstack-clash-protection -Wformat -Werror=format-security -O3"
    -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON
    -G Ninja

    -DBUILD_TESTING:BOOL=OFF
    -DBUILD_EXAMPLES:BOOL=OFF
    -DITK_BUILD_DOCUMENTATION:BOOL=OFF
    -DITK_BUILD_DEFAULT_MODULES:BOOL=ON

    -DITK_WRAP_PYTHON:BOOL=ON
    -DITK_USE_SYSTEM_SWIG:BOOL=ON
    -DITK_USE_SYSTEM_CASTXML:BOOL=ON

    -DITK_LEGACY_SILENT:BOOL=ON
    -DBUILD_SHARED_LIBS:BOOL=ON
    -DITK_USE_SYSTEM_LIBRARIES:BOOL=ON
    -DITK_USE_SYSTEM_JPEG:BOOL=ON
    -DITK_USE_SYSTEM_PNG:BOOL=ON
    -DITK_USE_SYSTEM_ZLIB:BOOL=ON
    -DITK_USE_SYSTEM_TIFF:BOOL=ON
    -DITK_USE_SYSTEM_GDCM:BOOL=ON
    -DITK_USE_SYSTEM_EXPAT:BOOL=ON
    -DITK_USE_SYSTEM_FFTW:BOOL=ON
    -DITK_USE_SYSTEM_HDF5:BOOL=ON
    -DITK_USE_64BITS_IDS:BOOL=ON

    -DITK_WRAP_IMAGE_DIMS:STRING="2;3;4"
    -DITK_WRAP_VECTOR_COMPONENTS:STRING="2;3;4"
    -DITK_WRAP_float:BOOL=ON
    -DITK_WRAP_vector_float:BOOL=ON

    -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON

    -DModule_Montage:BOOL=ON
    -DModule_MorphologicalContourInterpolation:BOOL=ON
    -DModule_MultipleImageIterator:BOOL=ON
    -DModule_PhaseSymmetry:BOOL=ON
    -DModule_IsotropicWavelets:BOOL=OFF # Not working
    -DModule_LabelErodeDilate:BOOL=ON
    -DModule_Strain:BOOL=ON
    -DModule_TwoProjectionRegistration:BOOL=ON
    -DModule_TubeTK:BOOL=ON
    -DModule_MinimalPathExtraction:BOOL=ON

I hope that this is useful :slight_smile: . Thanks.

(I can’t edit my first post, possibly because I had deleted it.)

The situation is not solved. The compilation does fail despite my efforts. I get the same errors.

As I am writing this post, the progress is [1423/3386] with Samurai. I am attaching a patch which may be useful
libdl_fix.diff.gz (629 Bytes). I will come back to report if the compilation was successful.

I was getting the following error (replaced some spaces with “newlines”), and I made some changes:

[2928/4286] Building CXX object Wrapping/Modules/TubeTK/CMakeFiles/TubeTKPython.dir/tubeEnhanceContrastUsingPriorPython.cpp.o
samu: job failed: /usr/bin/c++
-DBOOST_SERIALIZATION_DYN_LINK
-DBOOST_SERIALIZATION_NO_LIB
-DDIY_NO_THREADS
-DFMT_LOCALE
-DFMT_SHARED
-DH5_BUILT_AS_DYNAMIC_LIB
-DHDF_NO_NAMESPACE
-DITK_FFT_FACTORY_REGISTER_MANAGER
-DITK_IMAGEIO_FACTORY_REGISTER_MANAGER
-DITK_MESHIO_FACTORY_REGISTER_MANAGER
-DITK_TRANSFORMIO_FACTORY_REGISTER_MANAGER
-DMPICH_SKIP_MPICXX
-DMPI_NO_CPPBIND
-DNO_STATIC_CAST
-DOLD_HEADER_FILENAME
-DOMPI_SKIP_MPICXX
-DQT_CORE_LIB
-DQT_GUI_LIB
-DQT_NETWORK_LIB
-DQT_NO_DEBUG
-DQT_OPENGL_LIB
-DQT_QMLMODELS_LIB
-DQT_QML_LIB
-DQT_QUICK_LIB
-DQT_SQL_LIB
-DQT_WIDGETS_LIB
-DRKCOMMON_TASKING_TBB
-DTubeTKPython_EXPORTS
-DVTKMDIY_MPI_AS_LIB
-DVTKMDIY_NO_THREADS
-DVTK_HAS_OGGTHEORA_SUPPORT
-D_FORTIFY_SOURCE=2
-D_MPICC_H
-Dkiss_fft_scalar=double
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/wrapping
-I"${srcdir}"/insight-toolkit/build/Wrapping/ITKFactoryRegistration
-I"${srcdir}"/insight-toolkit/Modules/Remote/TwoProjectionRegistration/include
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Segmentation
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Registration
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/ObjectDocuments
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Numerics
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/MetaIO
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/IO
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Filtering
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Common
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src
-I"${srcdir}"/insight-toolkit/build/Modules/Remote/TubeTK/include
-I"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/include
-I"${srcdir}"/insight-toolkit/Modules/Remote/Strain/include
-I"${srcdir}"/insight-toolkit/Modules/Remote/PhaseSymmetry/include
-I"${srcdir}"/insight-toolkit/Modules/Remote/MultipleImageIterator/include
-I"${srcdir}"/insight-toolkit/Modules/Remote/MorphologicalContourInterpolation/include
-I"${srcdir}"/insight-toolkit/Modules/Remote/Montage/include
-I"${srcdir}"/insight-toolkit/Modules/Remote/MinimalPathExtraction/include
-I"${srcdir}"/insight-toolkit/Modules/Remote/LabelErodeDilate/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/Watersheds/include
-I"${srcdir}"/insight-toolkit/Modules/Video/IO/include
-I"${srcdir}"/insight-toolkit/Modules/Video/Filtering/include
-I"${srcdir}"/insight-toolkit/Modules/Video/Core/include
-I"${srcdir}"/insight-toolkit/Modules/Bridge/VTK/include
-I"${srcdir}"/insight-toolkit/Modules/Core/TestKernel/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/SuperPixel/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/SpatialFunction/include
-I"${srcdir}"/insight-toolkit/Modules/Registration/RegistrationMethodsv4/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/RegionGrowing/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/QuadEdgeMeshFiltering/include
-I"${srcdir}"/insight-toolkit/Modules/Registration/Metricsv4/include
-I"${srcdir}"/insight-toolkit/Modules/Numerics/Optimizersv4/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/MarkovRandomFieldsClassifiers/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/LevelSetsv4/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/LabelVoting/include
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/libLBFGS/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/KLMRegionGrowing/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageNoise/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageFusion/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageFrequency/include
-I"${srcdir}"/insight-toolkit/Modules/IO/VTK/include
-I"${srcdir}"/insight-toolkit/Modules/IO/TransformMatlab/include
-I"${srcdir}"/insight-toolkit/Modules/IO/TransformInsightLegacy/include
-I"${srcdir}"/insight-toolkit/Modules/IO/TransformHDF5/include
-I"${srcdir}"/insight-toolkit/Modules/IO/TransformBase/include
-I"${srcdir}"/insight-toolkit/Modules/IO/TransformFactory/include
-I"${srcdir}"/insight-toolkit/Modules/IO/Stimulate/include
-I"${srcdir}"/insight-toolkit/Modules/IO/SpatialObjects/include
-I"${srcdir}"/insight-toolkit/Modules/IO/XML/include
-I"${srcdir}"/insight-toolkit/Modules/IO/Siemens/include
-I"${srcdir}"/insight-toolkit/Modules/IO/RAW/include
-I"${srcdir}"/insight-toolkit/Modules/IO/PNG/include
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/PNG/src
-I"${srcdir}"/insight-toolkit/Modules/IO/NRRD/include
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/NrrdIO/src/NrrdIO
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/NrrdIO/src/NrrdIO
-I"${srcdir}"/insight-toolkit/Modules/IO/NIFTI/include
-I"${srcdir}"/insight-toolkit/Modules/IO/Meta/include
-I"${srcdir}"/insight-toolkit/Modules/IO/Mesh/include
-I"${srcdir}"/insight-toolkit/Modules/IO/MeshVTK/include
-I"${srcdir}"/insight-toolkit/Modules/IO/MeshOFF/include
-I"${srcdir}"/insight-toolkit/Modules/IO/MeshOBJ/include
-I"${srcdir}"/insight-toolkit/Modules/IO/MeshGifti/include
-I"${srcdir}"/insight-toolkit/Modules/IO/MeshFreeSurfer/include
-I"${srcdir}"/insight-toolkit/Modules/IO/MeshBYU/include
-I"${srcdir}"/insight-toolkit/Modules/IO/MeshBase/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/Voronoi/include
-I"${srcdir}"/insight-toolkit/Modules/IO/MRC/include
-I"${srcdir}"/insight-toolkit/Modules/IO/MINC/include
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/MINC/src/libminc/volume_io/Include
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/MINC/src/libminc/libsrc2
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/MINC/src/libminc/libcommon
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/MINC/src/libminc
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/MINC
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/MINC
-I"${srcdir}"/insight-toolkit/Modules/IO/LSM/include
-I"${srcdir}"/insight-toolkit/Modules/IO/TIFF/include
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/TIFF/src
-I"${srcdir}"/insight-toolkit/Modules/IO/JPEG2000/include
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/OpenJPEG/src/openjpeg
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/OpenJPEG/src/openjpeg
-I"${srcdir}"/insight-toolkit/Modules/IO/JPEG/include
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/JPEG/src
-I"${srcdir}"/insight-toolkit/Modules/IO/HDF5/include
-I"${srcdir}"/insight-toolkit/Modules/IO/GIPL/include
-I"${srcdir}"/insight-toolkit/Modules/IO/GE/include
-I"${srcdir}"/insight-toolkit/Modules/IO/IPL/include
-I"${srcdir}"/insight-toolkit/Modules/IO/GDCM/include
-I"${srcdir}"/insight-toolkit/Modules/IO/CSV/include
-I"${srcdir}"/insight-toolkit/Modules/IO/Bruker/include
-I"${srcdir}"/insight-toolkit/Modules/IO/BioRad/include
-I"${srcdir}"/insight-toolkit/Modules/IO/BMP/include
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/HDF5/src
-I"${srcdir}"/insight-toolkit/Modules/Filtering/GPUThresholding/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/GPUSmoothing/include
-I"${srcdir}"/insight-toolkit/Modules/Registration/GPUPDEDeformable/include
-I"${srcdir}"/insight-toolkit/Modules/Registration/PDEDeformable/include
-I"${srcdir}"/insight-toolkit/Modules/Registration/Common/include
-I"${srcdir}"/insight-toolkit/Modules/Registration/GPUCommon/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/GPUImageFilterBase/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/GPUAnisotropicSmoothing/include
-I"${srcdir}"/insight-toolkit/Modules/Core/GPUFiniteDifference/include
-I"${srcdir}"/insight-toolkit/Modules/Core/GPUCommon/include
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/GIFTI/src/gifticlib
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/NIFTI/src/nifti/znzlib
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/NIFTI/src/nifti/niftilib
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/Expat/src
-I"${srcdir}"/insight-toolkit/Modules/Numerics/Eigen/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/DisplacementField/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/DiffusionTensorImage/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/Denoising/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/DeformableMesh/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/Deconvolution/include
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/DICOMParser/src/DICOMParser
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/DICOMParser/src/DICOMParser
-I"${srcdir}"/insight-toolkit/Modules/Filtering/Convolution/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/FFT/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/Colormap/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/Classifiers/include
-I"${srcdir}"/insight-toolkit/Modules/Bridge/NumPy/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/BiasCorrection/include
-I"${srcdir}"/insight-toolkit/Modules/Numerics/Polynomials/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/AntiAlias/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/LevelSets/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/SignedDistanceFunction/include
-I"${srcdir}"/insight-toolkit/Modules/Numerics/Optimizers/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageFeature/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageSources/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageGradient/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/Smoothing/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageCompare/include
-I"${srcdir}"/insight-toolkit/Modules/IO/ImageBase/include
-I"${srcdir}"/insight-toolkit/build/Modules/IO/ImageBase
-I"${srcdir}"/insight-toolkit/Modules/Filtering/FastMarching/include
-I"${srcdir}"/insight-toolkit/Modules/Core/QuadEdgeMesh/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/DistanceMap/include
-I"${srcdir}"/insight-toolkit/Modules/Numerics/NarrowBand/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/BinaryMathematicalMorphology/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/MathematicalMorphology/include
-I"${srcdir}"/insight-toolkit/Modules/Segmentation/ConnectedComponents/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/Thresholding/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/LabelMap/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageLabel/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageIntensity/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/Path/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageStatistics/include
-I"${srcdir}"/insight-toolkit/Modules/Core/SpatialObjects/include
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/MetaIO/src/MetaIO/src
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/MetaIO/src/MetaIO/src
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/ZLIB/src
-I"${srcdir}"/insight-toolkit/Modules/Core/Mesh/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageCompose/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/AnisotropicSmoothing/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageGrid/include
-I"${srcdir}"/insight-toolkit/Modules/Core/ImageFunction/include
-I"${srcdir}"/insight-toolkit/Modules/Core/Transform/include
-I"${srcdir}"/insight-toolkit/Modules/Numerics/Statistics/include
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/Netlib
-I"${srcdir}"/insight-toolkit/Modules/Core/ImageAdaptors/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/CurvatureFlow/include
-I"${srcdir}"/insight-toolkit/Modules/Filtering/ImageFilterBase/include
-I"${srcdir}"/insight-toolkit/Modules/Core/FiniteDifference/include
-I"${srcdir}"/insight-toolkit/Modules/Core/Common/include
-I"${srcdir}"/insight-toolkit/build/Modules/Core/Common
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/VNL/src/vxl/core
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/VNL/src/vxl/vcl
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/VNL/src/vxl/v3p/netlib
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/VNL/src/vxl/core
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/VNL/src/vxl/vcl
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/VNL/src/vxl/v3p/netlib
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/KWSys/src
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/Eigen3/src
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/DoubleConversion/src/double-conversion
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/DoubleConversion/src
-I"${srcdir}"/insight-toolkit/build/Wrapping/Typedefs
-I"${srcdir}"/insight-toolkit/Wrapping/Generators/Python
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/VNL/src/vxl/core/vnl/algo
-I"${srcdir}"/insight-toolkit/Modules/ThirdParty/VNL/src/vxl/core/vnl
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/VNL/src/vxl/core/vnl
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/NIFTI/src/nifti/znzlib
-I"${srcdir}"/insight-toolkit/build/Modules/ThirdParty/NIFTI/src/nifti/niftilib
-isystem /usr/include/gdcm-3.0
-isystem /usr/include/python3.10
-isystem /usr/include/eigen3
-isystem /usr/include/vtk
-isystem /usr/include/freetype2
-isystem /usr/include/qt
-isystem /usr/include/qt/QtOpenGL
-isystem /usr/include/qt/QtWidgets
-isystem /usr/include/qt/QtGui
-isystem /usr/include/qt/QtCore
-isystem /usr/lib/qt/mkspecs/linux-g++
-isystem /usr/lib/jvm/default/include
-isystem /usr/lib/jvm/default/include/linux
-isystem /usr/include/openvr
-isystem /usr/lib/python3.10/site-packages/mpi4py/include
-isystem /usr/include/libxml2
-isystem /usr/include/vtk/vtkxdmf3/core
-isystem /usr/include/vtk/vtkfides/fides
-isystem /usr/include/vtk/vtkvtkm/vtk-m
-isystem /usr/include/vtk/vtkvtkm/vtk-m/vtkm/thirdparty/optionparser
-isystem /usr/include/vtk/vtkvtkm/vtk-m/vtkm/thirdparty/diy
-isystem /usr/include/vtk/vtkvtkm/vtk-m/vtkm/thirdparty/diy/vtkmdiy/include
-isystem /usr/include/vtk/vtkvtkm/vtk-m/vtkm/thirdparty/diy/vtkmdiy/include/vtkmdiy/mpi
-isystem /usr/include/vtk/vtkvtkm/vtk-m/vtkm/thirdparty/lcl/vtkmlcl
-isystem /usr/include/qt/QtSql
-isystem /usr/include/qt/QtQuick
-isystem /usr/include/qt/QtQmlModels
-isystem /usr/include/qt/QtQml
-isystem /usr/include/qt/QtNetwork
-isystem /usr/include/double-conversion
-isystem /usr/include/utf8cpp -std=c++14 -pipe -fno-plt -fPIC -fopenmp -march=native -mtune=native -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS -fcf-protection -fstack-clash-protection -Wformat -Werror=format-security -O2 -O3  -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -funit-at-a-time -Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual -Wstrict-null-sentinel  -msse2  -msse2 -O3 -DNDEBUG -flto -fno-fat-lto-objects -fPIC -fno-strict-aliasing -w -fopenmp -fPIC -pthread -ffunction-sections -std=c++14 -MD -MT Wrapping/Modules/TubeTK/CMakeFiles/TubeTKPython.dir/tubeEnhanceEdgesUsingDiffusionPython.cpp.o -MF Wrapping/Modules/TubeTK/CMakeFiles/TubeTKPython.dir/tubeEnhanceEdgesUsingDiffusionPython.cpp.o.d -o Wrapping/Modules/TubeTK/CMakeFiles/TubeTKPython.dir/tubeEnhanceEdgesUsingDiffusionPython.cpp.o -c "${srcdir}"/insight-toolkit/build/Wrapping/Modules/TubeTK/tubeEnhanceEdgesUsingDiffusionPython.cpp
In file included from "${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Filtering/itktubeAnisotropicDiffusionTensorImageFilter.h:228,
                 from "${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Filtering/itktubeAnisotropicEdgeEnhancementDiffusionImageFilter.h:27,
                 from "${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/include/tubeEnhanceEdgesUsingDiffusion.h:32,
                 from "${srcdir}"/insight-toolkit/build/Wrapping/Typedefs/tubeEnhanceEdgesUsingDiffusionSwigInterface.h:18,
                 from "${srcdir}"/insight-toolkit/build/Wrapping/Modules/TubeTK/tubeEnhanceEdgesUsingDiffusionPython.cpp:3201:
"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Filtering/itktubeAnisotropicDiffusionTensorImageFilter.hxx: In instantiation of 'itk::tube::AnisotropicDiffusionTensorImageFilter<TInputImage, TOutputImage>::TimeStepType itk::tube::AnisotropicDiffusionTensorImageFilter<TInputImage, TOutputImage>::CalculateChange() [with TInputImage = itk::Image<float, 3>; TOutputImage = itk::Image<float, 3>; itk::tube::AnisotropicDiffusionTensorImageFilter<TInputImage, TOutputImage>::TimeStepType = double]':
"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Filtering/itktubeAnisotropicDiffusionTensorImageFilter.hxx:254:1:   required from here
"${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Filtering/itktubeAnisotropicDiffusionTensorImageFilter.hxx:285:9: error: cannot convert 'std::vector<bool>' to 'const std::vector<unsigned char>&'
  285 |     str.ValidTimeStepList );
      |     ~~~~^~~~~~~~~~~~~~~~~
      |         |
      |         std::vector<bool>
In file included from "${srcdir}"/insight-toolkit/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.h:380,
                 from "${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Filtering/itktubeAnisotropicDiffusionTensorImageFilter.h:28,
                 from "${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/src/Filtering/itktubeAnisotropicEdgeEnhancementDiffusionImageFilter.h:27,
                 from "${srcdir}"/insight-toolkit/Modules/Remote/TubeTK/include/tubeEnhanceEdgesUsingDiffusion.h:32,
                 from "${srcdir}"/insight-toolkit/build/Wrapping/Typedefs/tubeEnhanceEdgesUsingDiffusionSwigInterface.h:18,
                 from "${srcdir}"/insight-toolkit/build/Wrapping/Modules/TubeTK/tubeEnhanceEdgesUsingDiffusionPython.cpp:3201:
"${srcdir}"/insight-toolkit/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx:170:107: note:   initializing argument 2 of 'itk::FiniteDifferenceImageFilter<TInputImage, TOutputImage>::TimeStepType itk::FiniteDifferenceImageFilter<TInputImage, TOutputImage>::ResolveTimeStep(const std::vector<typename itk::FiniteDifferenceFunction<TOutputImage>::TimeStepType>&, const std::vector<unsigned char>&) const [with TInputImage = itk::Image<float, 3>; TOutputImage = itk::Image<float, 3>; itk::FiniteDifferenceImageFilter<TInputImage, TOutputImage>::TimeStepType = double; typename itk::FiniteDifferenceFunction<TOutputImage>::TimeStepType = double]'
  170 |                                                                         const std::vector<uint8_t> &      valid) const
      |                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
samu: subcommand failed

In itktubeAnisotropicDiffusionTensorImageFilter.h (in line 202) shows

std::vector< bool > ValidTimeStepList;

This is called in the definition of CalculateChange (template in itktubeAnisotropicDiffusionTensorImageFilter.hxx). Then, itkFiniteDifferenceImageFilter.h states: “Although they are uint8_t, they should be treated like bools.”, and it shows

virtual TimeStepType
  ResolveTimeStep(const std::vector<TimeStepType> & timeStepList, const std::vector<uint8_t> & valid) const;

So, I changed line 202 of itktubeAnisotropicDiffusionTensorImageFilter.h to

std::vector< uint8_t > ValidTimeStepList;

I also slightly modified the diff file which I had previously uploaded: libdl_fix.diff.gz (622 Bytes). In the meantime, I should note that using Samurai’s -f directive is needed, and that doing the regex may also be necessary after running CMake.

@Niels_Dekker @seanm @Lee_Newberg @Stephen_Aylward anyone wants to turn @edgar’s diff into a PR?

The build is faulty. I am getting errors even with this:

>>> import itk; itk.auto_progress(2); itk.Version.GetITKVersion()
Loading ITKPyBase... done
Loading ITKCommon... Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/itk/support/lazy.py", line 137, in __getattribute__
    base.itk_load_swig_module(module, namespace)
  File "/usr/lib/python3.10/site-packages/itk/support/base.py", line 110, in itk_load_swig_module
    l_module = loader.load(swig_module_name)
  File "/usr/lib/python3.10/site-packages/itk/support/base.py", line 259, in load
    l_spec.loader.exec_module(l_module)  # pytype: disable=attribute-error
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.10/site-packages/itk/support/../ITKCommonPython.py", line 13, in <module>
    from . import _ITKCommonPython
ImportError: libjawt.so: cannot open shared object file: No such file or directory

I will try to rebuild. In any case, any help is welcome :slight_smile: .

Regarding the DL issue:

Thanks for the details. I see that you have defined
-ldl
In the build cmake variable
CMAKE_CXX_FLAGS

The DL library isn’t specified for inclusion by TubeTk, but perhaps itk uses it. Regardless, if it is needed, it’s inclusion should be automatically managed by cmake. You should never have to specify it as a compiler option. Have you tried removing it from your specification?

Regarding the ValidTimeStepList bug

That API has been changed multiple times during the ITKv5.3rc series. The v1.1 tag of TubeTK works with ITKv5.3rc03. The master of TubeTK works with the master of ITK. The two cannot be mixed.

1 Like

Thank you, very much to both of you.

Yes, I saw that. It’s puzzling, because that error message only happens when TubeTK is enabled in the compilation options of CMake.

Indeed, the -ldl has no effect. Frankly, I had removed it already, and failed to tell you about it, sorry (repo).

I could try to check which of the replacements of libdl.so and libdl-2.9.so (in TubeTK/CMake/TubeTKValgrind.supp or testDynamicLoader.cxx) is helping me. As it is, I still had to replace them in build.ninja after running CMake.

sed -i "s%libdl[^[:space:];]*\.so[[:digit:].]*%libdl.so.2%g" "${_build_dir}"/build.ninja

At the end, I was getting some errors about Java libraries for whatever reason. If I add some paths to my LD_LIBRARY_PATH, I can get ITK’s version in Python. I have not tested TubeTK’s functionalities, but this thread is about compilation.

 $ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib:/usr/lib/jvm/java-8-openjdk/lib/amd64"
 $ python
Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import itk; itk.auto_progress(2); itk.Version.GetITKVersion()
Loading ITKPyBase... done
Loading ITKCommon... Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/itk/support/lazy.py", line 137, in __getattribute__
    base.itk_load_swig_module(module, namespace)
  File "/usr/lib/python3.10/site-packages/itk/support/base.py", line 110, in itk_load_swig_module
    l_module = loader.load(swig_module_name)
  File "/usr/lib/python3.10/site-packages/itk/support/base.py", line 259, in load
    l_spec.loader.exec_module(l_module)  # pytype: disable=attribute-error
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.10/site-packages/itk/support/../ITKCommonPython.py", line 13, in <module>
    from . import _ITKCommonPython
ImportError: libjvm.so: cannot open shared object file: No such file or directory
>>>
 $ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib:/usr/lib/jvm/java-8-openjdk/lib/amd64:/usr/lib/jvm/java-17-openjdk/lib/server"
 $ python
Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import itk; itk.auto_progress(2); itk.Version.GetITKVersion()
Loading ITKPyBase... done
Loading ITKCommon... Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/itk/support/lazy.py", line 137, in __getattribute__
    base.itk_load_swig_module(module, namespace)
  File "/usr/lib/python3.10/site-packages/itk/support/base.py", line 110, in itk_load_swig_module
    l_module = loader.load(swig_module_name)
  File "/usr/lib/python3.10/site-packages/itk/support/base.py", line 259, in load
    l_spec.loader.exec_module(l_module)  # pytype: disable=attribute-error
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.10/site-packages/itk/support/../ITKCommonPython.py", line 13, in <module>
    from . import _ITKCommonPython
ImportError: libawt_xawt.so: cannot open shared object file: No such file or directory
>>>
 $ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib:/usr/lib/jvm/java-8-openjdk/lib/amd64:/usr/lib/jvm/java-17-openjdk/lib/server:/usr/lib/jvm/java-17-openjdk/lib"
 $ python
Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import itk; itk.auto_progress(2); itk.Version.GetITKVersion()
Loading ITKPyBase... done
Loading ITKCommon... done
'5.3.0'

Yes, thank you. As I was following our previous conversation (#4784), I did try to match them, and tried an earlier version, just in case. Anyway, what I do think that needs to be changed is this:

uint8.diff.gz (267 Bytes)

I’m sure that this leaves more questions than answers :stuck_out_tongue: ! If you want me to test something, let me know. I will later formulate a question regarding the Java libraries.

Thank you again.

Hi,

I think it might be a good idea to start from an empty build directory. Sometimes stuff from prior configurations linger in build, cmakecache, and intermediate config files, or object files don’t get rebuilt. That might be causing your continued problems with dl.

For configuration, you should only need to do

cmake …/ITK -G Ninja -DITK_WRAP_PYTHON=ON -DModule_TubeTK=ON

  • any deviations from that are at your own risk :slight_smile: (Ok, not really, but you’re definitely moving into uncharted territory that could have funky consequences).

Looks like the API for the ResolveTimeStep function has changed, again. I’ll commit a fix…again…

s

Hi @edgar

What is your github login? I’d like to acknowledge you in the commit:

Thanks,
s

Oh, don’t worry about that. I mean, I appreciate all the help and that you took the diff already. (Besides, I don’t have an account with them).

Cheers!

The change has been merged with TubeTK.

TubeTK master should now compile with ITK master. However, it is now incompatible with the most recent release of ITK (v5.3rc03). Either use TubeTK v1.1 with ITKv5.3rc03, or use TubeTK master with ITK master from within the past few days.

Thanks!

Yes, thank you. One of the convenient functionalities of makepkg (the building tools of Parabola GNU/Linux) is the option to clear the building environment.

I know… further, I am sorry to take your time, but many of the options are for faster or safer building. For instance, this means that I don’t have to download or recompile libraries:

-DITK_USE_SYSTEM_SWIG:BOOL=ON
-DITK_USE_SYSTEM_CASTXML:BOOL=ON

-DITK_USE_SYSTEM_LIBRARIES:BOOL=ON
-DITK_USE_SYSTEM_JPEG:BOOL=ON
-DITK_USE_SYSTEM_PNG:BOOL=ON
-DITK_USE_SYSTEM_ZLIB:BOOL=ON
-DITK_USE_SYSTEM_TIFF:BOOL=ON
-DITK_USE_SYSTEM_GDCM:BOOL=ON
-DITK_USE_SYSTEM_EXPAT:BOOL=ON
-DITK_USE_SYSTEM_FFTW:BOOL=ON
-DITK_USE_SYSTEM_HDF5:BOOL=ON

These will certainly shorten compilation time and space:

-DBUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=OFF
-DITK_BUILD_DOCUMENTATION:BOOL=OFF

Regarding the compilation flags,

  • -march=native, mtune=native: will build for my architecture and processor (faster)
  • -D-FORTIFY-SOURCE=2: detect some buffer overflow
  • -D_GLIBCXX_ASSERTIONS: enables extra error checking in the form of precondition assertions
  • -fPIC: use relative addresses, and not absolute addresses in jump calls
  • -fcf-protection: protect against Return-oriented Programming (ROP) and call/jmp-oriented programming (COP/JOP)
  • -pipe: Use pipes rather than temporary files during compilation
  • -fno-plt: more efficient code by eliminating PLT stubs and exposing GOT loads to optimizations
  • -fopenmp: Enable handling of OpenMP directives
  • -fstack-clash-protection: prevent stack clash style attacks
  • -Werror=format-security: warn aboutf uses of format functions that represent possible security problems

For some years, I have been using out-of-source builds, just because it makes debugging easier and safer (-S and -B).

Then, these allow for 3D registration functionalities:

-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4"
-DITK_WRAP_VECTOR_COMPONENTS:STRING="2;3;4"
-DITK_WRAP_float:BOOL=ON
-DITK_WRAP_vector_float:BOOL=ON

As for the rest, I think that it’s better to have -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON, because I don’t know if any paths get in the way: with makepkg, you have a building directory, a packaging directory and then a package, which may not have the same paths. Then, -DITK_BUILD_DEFAULT_MODULES:BOOL=ON is more as a reminder. Finally, -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON gives me a compile_commands.json for my IDE.

I don’t know if I express this sufficiently, but I really appreciate the support :slight_smile: .

Just for (in)completeness, the Java library path may be affected by -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON. To create the package, I created a /etc/ld.so.conf.d/insight-toolkit.conf with this:

/usr/lib/jvm/default/lib
/usr/lib/jvm/default/lib/server

The alternative of LD_LIBRARY_PATH is also viable. A recompilation with -DCMAKE_SKIP_INSTALL_RPATH:BOOL=OFF would be needed to check if RPATH is in fact missing in the libraries and triggering my error.