BIC-MNI / minc-toolkit

Metaproject uniting all the available minc tools
GNU General Public License v3.0
37 stars 15 forks source link

libminc and/or ITK not accessible in minc4itk build when building with system ITK #36

Open bcdarwin opened 8 years ago

bcdarwin commented 8 years ago

Building in a clean sandbox:

[  4%] Built target minc2
Scanning dependencies of target minc_io
[  4%] Building CXX object libminc/ezminc/CMakeFiles/minc_io.dir/minc_1_rw.cpp.o
[  4%] Building CXX object libminc/ezminc/CMakeFiles/minc_io.dir/minc_1_simple_rw.cpp.o
[  4%] Linking CXX shared library libminc_io.so
[  4%] Built target minc_io
Scanning dependencies of target ITKIOMINC
[  4%] Building CXX object minc4itk/CMakeFiles/ITKIOMINC.dir/src/itkMincHelpers.cxx.o
[  4%] Building CXX object minc4itk/CMakeFiles/ITKIOMINC.dir/src/itkMincImageIO.cxx.o
[  4%] Building CXX object minc4itk/CMakeFiles/ITKIOMINC.dir/src/itkMincImageIOFactory.cxx.o
[  4%] Building CXX object minc4itk/CMakeFiles/ITKIOMINC.dir/src/itkMincTransformIO.cxx.o
/tmp/<stuff>/src/itkMincTransformIO.cxx: In member function 'void itk::MincTransformIO::ReadOneTransform(VIO_General_transform*)':
/tmp/<stuff>/minc-toolkit-9dbb6ed/minc4itk/src/itkMincTransformIO.cxx:139:11: error: 'Volume' was not declared in this scope
           Volume grid=static_cast<Volume>(xfm->displacement_volume);
           ^

followed by lots of resulting syntax (!) errors.

Flags:

  -DCMAKE_INSTALL_PREFIX=$out
  -DMT_BUILD_SHARED_LIBS=ON
  -DUSE_SYSTEM_FFTW3F=ON
  -DUSE_SYSTEM_GSL=ON
  -DUSE_SYSTEM_HDF5=ON
  -DUSE_SYSTEM_ITK=ON
  -DUSE_SYSTEM_NETCDF=ON
  -DUSE_SYSTEM_PCRE=ON
  -DUSE_SYSTEM_ZLIB=ON
  -DMT_BUILD_VISUAL_TOOLS=ON
  -DMT_BUILD_ITK_TOOLS=ON
  -DMT_BUILD_MINC_ANTS=ON

but this happens with/without shared libs and with/without superbuild (e.g., not using system (say) fftw3f; see next-most-recent bug). ITK version is 4.0.0.

bcdarwin commented 8 years ago

If I turn off BUILD_ITK_TOOLS, the build succeeds.

bcdarwin commented 8 years ago

Oh, I assume I wasn't supposed to use ITK4 - closing for now.

bcdarwin commented 8 years ago

Using an existing ITK 3 doesn't seem to work either:

CMake Warning at CMakeLists.txt:319 (FIND_PACKAGE):
  By not providing "FindITK.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "ITK", but
  CMake did not find one.

  Could not find a package configuration file provided by "ITK" with any of
  the following names:

    ITKConfig.cmake
    itk-config.cmake

  Add the installation prefix of "ITK" to CMAKE_PREFIX_PATH or set "ITK_DIR"
  to a directory containing one of the above files.  If "ITK" provides a
  separate development package or SDK, be sure it has been installed.
 ...
CMake Warning (dev) at CMakeLists.txt:342 (ADD_DEPENDENCIES):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  The dependency target "ITKv3" of target "ANTS" does not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:351 (ADD_DEPENDENCIES):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  The dependency target "ITKv3" of target "C3D" does not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.
 ...
[  4%] Built target minc2
Scanning dependencies of target minc_io
[  4%] Building CXX object libminc/ezminc/CMakeFiles/minc_io.dir/minc_1_rw.cpp.o
[  5%] Building CXX object libminc/ezminc/CMakeFiles/minc_io.dir/minc_1_simple_rw.cpp.o
[  5%] Linking CXX shared library libminc_io.so
[  5%] Built target minc_io
Scanning dependencies of target ITKIOMINC
[  5%] Building CXX object minc4itk/CMakeFiles/ITKIOMINC.dir/src/itkMincHelpers.cxx.o
In file included from /tmp/.../minc-toolkit-9dbb6ed/minc4itk/src/itkMincHelpers.cxx:16:0:
/tmp/.../minc-toolkit-9dbb6ed/minc4itk/include/itkMincHelpers.h:23:22: fatal error: itkArray.h: No such file or directory
 #include "itkArray.h"
                      ^
compilation terminated.
minc4itk/CMakeFiles/ITKIOMINC.dir/build.make:62: recipe for target 'minc4itk/CMakeFiles/ITKIOMINC.dir/src/itkMincHelpers.cxx.o' failed
make[2]: *** [minc4itk/CMakeFiles/ITKIOMINC.dir/src/itkMincHelpers.cxx.o] Error 1
CMakeFiles/Makefile2:15746: recipe for target 'minc4itk/CMakeFiles/ITKIOMINC.dir/all' failed
make[1]: *** [minc4itk/CMakeFiles/ITKIOMINC.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2