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

Build following dockerfiles -- itkKernelFunction.h not found #141

Open
zerothi opened this issue Sep 6, 2024 · 0 comments
Open

Build following dockerfiles -- itkKernelFunction.h not found #141

zerothi opened this issue Sep 6, 2024 · 0 comments

Comments

@zerothi
Copy link

zerothi commented Sep 6, 2024

I am trying to follow the docker instructions to try and build locally.

The reason for doing local builds is that the released executables are build against a newer glibc (same as #92).

When following the docker builds the qt release 6.4 is not found anymore, #129. However, I don't have problems (so far) with the linker problem.

So, I am doing something like this:

#!/bin/bash
#
# Simple script to build itk
#

# on debian 
# sudo apt install '^libxcb.*-dev'
# + some more libx11 libraries
QTVER=6.5.3

install_dir=$(pwd)/install

mkdir -p qt
cd qt
rm -rf qt*-$QTVER install

if [ ! -e $install_dir/bin/qt-configure-module ]; then
  rm -rf qtbase-everywhere-src-$QTVER*
  wget https://download.qt.io/official_releases/qt/${QTVER%.*}/$QTVER/submodules/qtbase-everywhere-src-$QTVER.tar.xz
  tar -xf qtbase-everywhere-src-$QTVER.tar.xz

  cd qtbase-everywhere-src-$QTVER
  ./configure -xcb -prefix $install_dir
  cmake --build . --parallel
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cmake --install .
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cd ..
fi

if [ ! -e $install_dir/lib/libQt6Qml.so ]; then
  rm -rf qtdeclarative-everywhere-src-$QTVER*
  wget https://download.qt.io/official_releases/qt/${QTVER%.*}/$QTVER/submodules/qtdeclarative-everywhere-src-$QTVER.tar.xz
  tar -xf qtdeclarative-everywhere-src-$QTVER.tar.xz
  cd qtdeclarative-everywhere-src-$QTVER
  cmake -G Ninja -DCMAKE_PREFIX_PATH=$install_dir -DCMAKE_INSTALL_PREFIX=$install_dir
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cmake --build . --parallel || : cmake --build . --parallel
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cmake --install .
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cd ..
fi

cd ..


# Install VTK
if [ ! -d $install_dir/include/vtk-9.1 ]; then
  git clone --branch v9.1.0 --depth 1 https://gitlab.kitware.com/vtk/vtk.git vtk-src
  cd vtk-src
  mkdir build && cd build
  cmake \
      -G Ninja \
      -DCMAKE_BUILD_TYPE=Release \
      -DBUILD_SHARED_LIBS=OFF \
      -DVTK_USE_SYSTEM_LIBRARIES=ON \
      -DVTK_RENDERING_BACKEND=OpenGL2 \
      -DVTK_REQUIRED_OBJCXX_FLAGS= \
      -DBUILD_TESTING=OFF \
      -DBUILD_EXAMPLES=OFF \
      -DVTK_GROUP_ENABLE_Qt=YES \
      -DVTK_MODULE_ENABLE_VTK_GUISupportQtQuick=NO \
      -DVTK_MODULE_ENABLE_VTK_GUISupportQtSQL=NO \
      -DCMAKE_PREFIX_PATH=$install_dir \
      -DCMAKE_INSTALL_PREFIX=$install_dir \
      ..
    [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cmake --build . --parallel
    [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cmake --install .
    [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cd ../..
fi


# Install ITK
# Download and build ITK
if [ ! -e $install_dir/bin/itkTestDriver ]; then
  rm -rf itk-src
  git clone --branch v5.2.1 --depth 1 https://github.com/InsightSoftwareConsortium/ITK.git itk-src
  cd itk-src
  mkdir build && cd build
  cmake -G Ninja  \
      -DCMAKE_PREFIX_PATH=$install_dir \
      -DCMAKE_INSTALL_PREFIX=$install_dir \
      -DCMAKE_BUILD_TYPE=Release \
      -DBUILD_TESTING=OFF \
      -DBUILD_EXAMPLES=OFF \
      -DModule_MorphologicalContourInterpolation=ON \
      ..
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cmake --build . --parallel
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cmake --install .
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cd ../..
fi

# Install ITKSNAP
if [ ! -e $install_dir/bin/itksnap ]; then
  rm -rf itksnap-src
  git clone --branch v4.0.0 --depth 1 https://github.com/pyushkevich/itksnap.git itksnap-src
  cd itksnap-src
  git submodule init
  git submodule update
  mkdir build && cd build
  cmake -G Ninja  \
      -DCMAKE_PREFIX_PATH=$install_dir \
      -DCMAKE_INSTALL_PREFIX=$install_dir \
      -DCMAKE_BUILD_TYPE=Release \
      -DITK_DIR=$install_dir \
      -DVTK_DIR=$install_dir \
      ..
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cmake --build . --parallel
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cmake --install .
  [ $? -ne 0 ] && { echo "Error!" ; exit 1 ; }
  cd ../..
fi

However, I get this problem:

[33/693] Building CXX object CMakeFiles/itksnapui_model.dir/GUI/Model/PolygonDrawingModel.cxx.o
FAILED: CMakeFiles/itksnapui_model.dir/GUI/Model/PolygonDrawingModel.cxx.o 
/opt/generic/gcc/12.3.0/bin/g++ -DGLEW_STATIC -DITK_IO_FACTORY_REGISTER_MANAGER -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_OPENGLWIDGETS_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -Dkiss_fft_scalar=double -DvtkRenderingContext2D_AUTOINIT_INCLUDE=\"/home/nicpa/dcc/tickets/35329/itksnap-src/build/CMakeFiles/vtkModuleAutoInit_2a29b50fd6b6860aabde65be71648124.h\" -DvtkRenderingCore_AUTOINIT_INCLUDE=\"/home/nicpa/dcc/tickets/35329/itksnap-src/build/CMakeFiles/vtkModuleAutoInit_2a29b50fd6b6860aabde65be71648124.h\" -DvtkRenderingOpenGL2_AUTOINIT_INCLUDE=\"/home/nicpa/dcc/tickets/35329/itksnap-src/build/CMakeFiles/vtkModuleAutoInit_2a29b50fd6b6860aabde65be71648124.h\" -DvtkRenderingVolume_AUTOINIT_INCLUDE=\"/home/nicpa/dcc/tickets/35329/itksnap-src/build/CMakeFiles/vtkModuleAutoInit_2a29b50fd6b6860aabde65be71648124.h\" -IITKFactoryRegistration -I/opt/generic/curl/8.0.1/include -I../Common -I../Common/ITKExtras -I../Common/JSon -I../Common/ITKBinaryWeightedAverage -I../Logic -I../Logic/Common -I../Logic/Framework -I../Logic/ImageWrapper -I../Logic/LevelSet -I../Logic/Mesh -I../Logic/Preprocessing -I../Logic/Preprocessing/GMM -I../Logic/Preprocessing/Texture -I../Logic/RLEImage -I../Logic/Slicing -I../Logic/WorkspaceAPI -I../Submodules/c3d -I../Submodules/c3d/itkextras -I../Submodules/c3d/itkextras/RandomForest -I../Submodules/c3d/itkextras/PovRayIO -I../Submodules/c3d/api -I../Submodules/c3d/adapters -I../Submodules/greedy/src -I../Submodules/greedy/src/ITKFilters/include -I../GUI -I../GUI/Model -I../GUI/Renderer -I../GUI/Renderer/OrientationWidget/Reorient -I../GUI/Qt -I../GUI/Qt/Components -I../GUI/Qt/Coupling -I../GUI/Qt/External -I../GUI/Qt/External/ColorWheel -I../GUI/Qt/ModelView -I../GUI/Qt/Testing -I../GUI/Qt/View -I../GUI/Qt/Windows -I../GUI/Qt/Windows/DSS -I../GUI/Qt/Windows/MeshExportWizard -I../GUI/Qt/Windows/MeshImportWizard -I../GUI/Qt/Windows/Registration -I../Testing/Logic -I../Testing/GUI/Qt -I/home/nicpa/dcc/tickets/35329/install/lib/cmake/ITK-5.2/Utilities/zlib -I. -I/home/nicpa/dcc/tickets/35329/install/include/QtDBus -I/home/nicpa/dcc/tickets/35329/install/include/QtConcurrent -I/home/nicpa/dcc/tickets/35329/install/include/QtQml -I/home/nicpa/dcc/tickets/35329/install/include/QtQmlIntegration -I/home/nicpa/dcc/tickets/35329/install/include/QtNetwork -isystem /home/nicpa/dcc/tickets/35329/install/include/ITK-5.2 -isystem /home/nicpa/dcc/tickets/35329/install/include/QtWidgets -isystem /home/nicpa/dcc/tickets/35329/install/include -isystem /home/nicpa/dcc/tickets/35329/install/include/QtCore -isystem /home/nicpa/dcc/tickets/35329/install/include/QtGui -isystem /home/nicpa/dcc/tickets/35329/install/include/QtOpenGL -isystem /home/nicpa/dcc/tickets/35329/install/include/vtk-9.1 -isystem /home/nicpa/dcc/tickets/35329/install/include/vtk-9.1/vtkfreetype/include -isystem /home/nicpa/dcc/tickets/35329/install/mkspecs/linux-g++ -isystem /home/nicpa/dcc/tickets/35329/install/include/QtOpenGLWidgets -O3 -DNDEBUG -fPIC -std=gnu++17 -MD -MT CMakeFiles/itksnapui_model.dir/GUI/Model/PolygonDrawingModel.cxx.o -MF CMakeFiles/itksnapui_model.dir/GUI/Model/PolygonDrawingModel.cxx.o.d -o CMakeFiles/itksnapui_model.dir/GUI/Model/PolygonDrawingModel.cxx.o -c ../GUI/Model/PolygonDrawingModel.cxx
In file included from ../Common/ITKExtras/itkBSplineScatteredDataPointSetToImageFilter.h:21,
                 from ../GUI/Model/PolygonDrawingModel.cxx:12:
../Common/ITKExtras/itkCoxDeBoorBSplineKernelFunction.h:20:10: fatal error: itkKernelFunction.h: No such file or directory
   20 | #include "itkKernelFunction.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[46/693] Building CXX object CMakeFiles/itksnapui_model.dir/GUI/Model/InterpolateLabelModel.cxx.o
ninja: build stopped: subcommand failed.
Error!

Indeed that header file is not found, only itkKernelFunctionBase.h, what am I missing?

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

1 participant