Hi!
I am trying to build ITK with MinimalPathExtraction
, because I want to try TubeTK
. I am getting a compilation error.
I would appreciate if we can keep my compilation flags, so that the compilation does not restart from 0. Compiling really takes the whole day. (Using more than one process, i.e. make -jn...
for n > 1
, usually crashes my machine with segfault, and it becomes unusable during parts of the process). Of course, this is just a polite request to consider.
Thanks!
Desired outcome
I would like to have a Python interface to ITK without SimpleITK which allows me to use the TubeTK
module.
Actual result
This is a sample of the compilation output
...
-- MinimalPathExtraction: Creating module.
-- MinimalPathExtraction: Creating itkArrivalFunctionToPathFilter submodule.
-- MinimalPathExtraction: Creating itkIterateNeighborhoodOptimizer submodule.
-- MinimalPathExtraction: Creating itkPhysicalCentralDifferenceImageFunction submodule.
-- MinimalPathExtraction: Creating itkSingleImageCostFunction submodule.
-- MinimalPathExtraction: Creating itkSpeedFunctionPathInformation submodule.
-- MinimalPathExtraction: Creating itkSpeedFunctionToPathFilter submodule.
...
...
Consolidate compiler generated dependencies of target MinimalPathExtraction
[ 24%] Linking CXX shared library ../../../../Wrapping/Generators/Python/itk/libitkMinimalPathExtraction-5.2.so
[ 24%] Built target MinimalPathExtraction
[ 24%] Built target MinimalPathExtraction-all
...
...
[ 93%] Generating ../../itkIterateNeighborhoodOptimizer.xml
In file included from insight-toolkit/src/insight-toolkit-5.2.1/build/Wrapping/itkIterateNeighborhoodOptimizer.cxx:16:
insight-toolkit/src/insight-toolkit-5.2.1/Modules/Remote/MinimalPathExtraction/include/itkIterateNeighborhoodOptimizer.h:41:36: error: variable has incomplete type 'class MinimalPathExtraction_EXPORT'
class MinimalPathExtraction_EXPORT IterateNeighborhoodOptimizer : public SingleValuedNonLinearOptimizer
^
insight-toolkit/src/insight-toolkit-5.2.1/Modules/Remote/MinimalPathExtraction/include/itkIterateNeighborhoodOptimizer.h:41:7: note: forward declaration of 'itk::MinimalPathExtraction_EXPORT'
class MinimalPathExtraction_EXPORT IterateNeighborhoodOptimizer : public SingleValuedNonLinearOptimizer
^
insight-toolkit/src/insight-toolkit-5.2.1/Modules/Remote/MinimalPathExtraction/include/itkIterateNeighborhoodOptimizer.h:41:65: error: expected ';' after top level declarator
class MinimalPathExtraction_EXPORT IterateNeighborhoodOptimizer : public SingleValuedNonLinearOptimizer
^
;
insight-toolkit/src/insight-toolkit-5.2.1/Modules/Remote/MinimalPathExtraction/include/itkIterateNeighborhoodOptimizer.h:41:67: error: expected unqualified-id
class MinimalPathExtraction_EXPORT IterateNeighborhoodOptimizer : public SingleValuedNonLinearOptimizer
^
insight-toolkit/src/insight-toolkit-5.2.1/build/Wrapping/itkIterateNeighborhoodOptimizer.cxx:26:18: error: no type named 'IterateNeighborhoodOptimizer' in namespace 'itk'
typedef itk::IterateNeighborhoodOptimizer itkIterateNeighborhoodOptimizer;
~~~~~^
insight-toolkit/src/insight-toolkit-5.2.1/build/Wrapping/itkIterateNeighborhoodOptimizer.cxx:27:18: error: 'IterateNeighborhoodOptimizer' is not a class, namespace, or enumeration
typedef itk::IterateNeighborhoodOptimizer::Pointer itkIterateNeighborhoodOptimizer_Pointer;
^
insight-toolkit/src/insight-toolkit-5.2.1/Modules/Remote/MinimalPathExtraction/include/itkIterateNeighborhoodOptimizer.h:41:36: note: 'IterateNeighborhoodOptimizer' declared here
class MinimalPathExtraction_EXPORT IterateNeighborhoodOptimizer : public SingleValuedNonLinearOptimizer
^
5 errors generated.
make[2]: *** [Wrapping/Modules/MinimalPathExtraction/CMakeFiles/MinimalPathExtractionCastXML.dir/build.make:86: Wrapping/itkIterateNeighborhoodOptimizer.xml] Error 1
make[1]: *** [CMakeFiles/Makefile2:31038: Wrapping/Modules/MinimalPathExtraction/CMakeFiles/MinimalPathExtractionCastXML.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Compilation options (MWE)
If you use Parabola GNU/Linux, there is a PKGBUILD
safe_flags="-Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS"
safe_flags+=" -fcf-protection -fno-plt"
safe_flags+=" -fstack-clash-protection -Wformat"
safe_flags+=" -Werror=format-security"
generic_flags="-pipe -fno-plt -fPIC -fopenmp"
generic_flags+=" -march=native"
generic_flags+=" -mtune=native ${safe_flags}"
opt_flags="${generic_flags} -O3"
generic_flags="${generic_flags} -O2"
export COPTFLAGS="${opt_flags}"
export CXXOPTFLAGS="$COPTFLAGS"
export FOPTFLAGS="$COPTFLAGS"
export CPPFLAGS="$generic_flags"
export CXXFLAGS="$CPPFLAGS"
export CFLAGS="$generic_flags"
export FFLAGS="$generic_flags"
export FCFLAGS="$generic_flags"
export F90FLAGS="$generic_flags"
export F77FLAGS="$generic_flags"
export LANG=C
export OMPI_MCA_opal_cuda_support=0
export OMPI_MCA_mpi_oversubscribe=0
_usepython=true _confopts=(
-S "${srcdir}"/"${pkgname}"-"${pkgver}"
-B "${srcdir}"/"${pkgname}"-"${pkgver}"/build
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS} -std=c++98"
-DITK_CXX_OPTIMIZATION_FLAGS:STRING="${COPTFLAGS}"
-DITK_C_OPTIMIZATION_FLAGS:STRING="${COPTFLAGS}"
-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=OFF
-DITK_BUILD_DOCUMENTATION:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_INSTALL_PREFIX:FILEPATH=/usr
-DModule_ITKReview:BOOL=ON
-DModule_Montage:BOOL=ON
-DModule_MorphologicalContourInterpolation:BOOL=ON
-DModule_MultipleImageIterator:BOOL=ON
-DModule_PhaseSymmetry:BOOL=ON
-DModule_IsotropicWavelets:BOOL=ON
-DModule_LabelErodeDilate:BOOL=ON
-DModule_Strain:BOOL=ON
-DModule_TwoProjectionRegistration:BOOL=ON
-DModule_TubeTK:BOOL=ON
# TubeTK requires MinimalPathExtraction module enabled
-DModule_MinimalPathExtraction: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_LEGACY_SILENT:BOOL=ON
$( $_usepython && echo "-DITK_WRAP_PYTHON:BOOL=ON")
$( $_usepython && echo "-DModule_ITKReview:BOOL=OFF")
$( $_usepython && echo "-DITK_USE_SYSTEM_SWIG:BOOL=ON")
$( $_usepython && echo "-DITK_USE_SYSTEM_CASTXML:BOOL=ON")
-DITK_USE_SYSTEM_LIBRARIES: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_LEGACY_REMOVE:BOOL=ON
-DModule_ITKIOMINC:BOOL=ON
-DModule_ITKIOTransformMINC:BOOL=ON
-DModule_SimpleITKFilters:BOOL=ON
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4"
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON
)
cmake "${_confopts[@]}"
make -j1 -s -C "${srcdir}/${pkgname}-${pkgver}"/build
System
Table 1: Python and ITK versionsPython | 3.10.1 |
ITK | 5.2.1 |
Numpy | 1.21.5 |
Scipy | 1.7.3 |
Parabola_(GNU/Linux) | 5.15.12-gnu-1 |
gcc | 11.1.0 |