Closed yanarof closed 9 months ago
Hello Yanarof,
Sorry for the delayed answer.
It seems that the boost library is not found when you build. I assume you are on Windows. Either add boost on your system and update the PATH variable, or modify the CMakeLists.txt to add a find_package( ) with Boost.
I am building the project under ubuntu 22.04 with cmake version 3.22.1
@omerveille told that I forgot to install boost library so I installed the thing with sudo apt-get install libboost-all-dev
Now, when building the LiverVesselness, the error is again due to the fftw library not being found
Consolidate compiler generated dependencies of target Antiga
[ 3%] Built target Antiga
Consolidate compiler generated dependencies of target Frangi
[ 7%] Built target Frangi
Consolidate compiler generated dependencies of target Jerman
[ 11%] Built target Jerman
Consolidate compiler generated dependencies of target Zhang
[ 14%] Built target Zhang
Consolidate compiler generated dependencies of target Meijering
[ 18%] Built target Meijering
Consolidate compiler generated dependencies of target Sato
[ 22%] Built target Sato
Consolidate compiler generated dependencies of target OOF
[ 24%] Building CXX object CMakeFiles/OOF.dir/src/Filters/oof.cxx.o
In file included from /home/yanarof/LiverVesselness/include/OOF/itkOptimallyOrientedFlux.h:75,
from /home/yanarof/LiverVesselness/src/Filters/oof.cxx:6:
/home/yanarof/LiverVesselness/include/OOF/itkOptimallyOrientedFlux.hxx: In member function ‘void itk::OptimallyOrientedFlux<TInputImage, TOutputImage>::GenerateData()’:
/home/yanarof/LiverVesselness/include/OOF/itkOptimallyOrientedFlux.hxx:249:34: error: ‘FFTWForwardFFTImageFilter’ in namespace ‘itk’ does not name a template type; did you mean ‘ForwardFFTImageFilter’?
249 | using FFTType = typename itk::FFTWForwardFFTImageFilter<TInputImage>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| ForwardFFTImageFilter
/home/yanarof/LiverVesselness/include/OOF/itkOptimallyOrientedFlux.hxx:250:22: error: ‘FFTType’ has not been declared
250 | auto FFTfilter = FFTType::New();
| ^~~~~~~
/home/yanarof/LiverVesselness/include/OOF/itkOptimallyOrientedFlux.hxx:253:41: error: ‘FFTType’ has not been declared
253 | using FFTOutputImageType = typename FFTType::OutputImageType;
| ^~~~~~~
/home/yanarof/LiverVesselness/include/OOF/itkOptimallyOrientedFlux.hxx:254:41: error: ‘FFTType’ has not been declared
254 | using FFTOutputPixelType = typename FFTType::OutputPixelType;
.......
And I do get this warning when building ITK(however it does compile):
...
-- The following OPTIONAL packages have not been found:
* KWStyle (required version >= 1.0.1)
* cppcheck
* FFTW
...
I tried with a different version of ITK (ITK-5.3.0), but I get the same error
This probably means that the problem comes from ITK and FFTW .. maybe ?
Which versions and parameters are you using and parameters when building the project ? Edit: build_livervessels.txt I attached the current attempt at building the code
I've used ITK up to 5.1, so it shouldn't be a problem.
One way around having difficulties with FFTW, is to let ITK build the library itself. Actually, there is an ITK flag for this. I would advise you use ccmake, so you can easily find the corresponding FLAG name and activate it. This way, itk will compile a local install of FFTW that should not conflic with anything
So for the ITK version 5.1, it's not possible, because LiverVesselness has a 5.2 requirement in the CMakeLists.txt, and even replacing with find_package(ITK 5.2 REQUIRED)
in the cmake, I get other errors ...
In the end I was able to use ITK 5.2.1 (not 5.2.0 not 5.3.0), and livervesselness was able to generate all the binaries
I also had to add a #include <optional>
in the file ~/LiverVesselness/RORPO/Image/include/Image/Image_IO_ITK.hpp
even though we are using the set(CMAKE_CXX_STANDARD 17)
This is how I was able to build it in the end:
#!/bin/bash
#cmake version 3.22.1
#Ubuntu 22.04
sudo apt-get install libboost-all-dev
#optionnal for ITK: kwstyle, cppcheck
vess_path='/home/yanarof/LiverVesselness'
parentpath=$(dirname "$vess_path")
cd $parentpath
git clone https://github.com/JonasLamy/LiverVesselness.git
# Building ITK
git clone -b v5.2.1 https://github.com/InsightSoftwareConsortium/ITK ITK-5.2.1
cd ITK-5.2.1
mkdir build ; cd build
cmake -DModule_Thickness3D=ON \
-DBUILD_SHARED_LIBS=OFF \
-DITK_USE_FFTWD=ON \
-DITK_USE_FFTWF=ON \
-DITK_USE_SYSTEM_FFTW=OFF \
-DBUILD_EXAMPLES=OFF \
..
make -j8
#Install vcpkg
cd ${vess_path}/lib
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install jsoncpp
git submodule update --init
#Build Jsoncpp
cd ${vess_path}/lib
git clone https://github.com/open-source-parsers/jsoncpp.git
cd jsoncpp
mkdir build ; cd build
cmake ..
make
#Install Boost
cd ${vess_path}/lib
git clone https://github.com/boostorg/boost
cd boost
git submodule update --init
#Install pybind
cd ${vess_path}/RORPO/pyRORPO
git clone https://github.com/pybind/pybind11.git
cd ${vess_path}/RORPO
git submodule update --init
#Building LiverVessels
cd ${vess_path}
mkdir build ; cd build
cmake \
-D ITK_DIR="${vess_path}/lib/ITK-5.2.1/build" \
-D BOOST_ROOT="${vess_path}/lib/math/build" \
-D jsoncpp_DIR="${vess_path}/lib/vcpkg/installed/x64-linux/share/jsoncpp" \
..
make -j8
Thank you for the help. You can mark this issue as closed/resolved
I'm glad you managed to get the project to compile ! The setup is always a bit tricky... Enjoy the filters :)
Hello, I am currently trying to build the project LiverVesselness, and I'm struggling to build it:
This ~script is my current attempt at building the code
Here, I am getting an error at the end (the last make) due to boost.math....bessel not being found
Do you know which step of this build process I am doing wrong ?