ITK 5.0.0 build fails with -DBUILD_TESTING=ON

Created on 15 Jul 2019  路  9Comments  路  Source: InsightSoftwareConsortium/ITK

With the following CMake command

cmake -C /var/tmp/portage/sci-libs/itk-5.0.0/work/itk-5.0.0_build/gentoo_common_config.cmake -G Unix Makefiles -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DITK_USE_SYSTEM_DCMTK=ON -DGDCM_USE_SYSTEM_OPENJPEG=ON -DITK_USE_SYSTEM_DOUBLECONVERSION=ON -DITK_USE_SYSTEM_CASTXML=ON -DITK_USE_SYSTEM_HDF5=ON -DITK_USE_SYSTEM_JPEG=ON -DITK_USE_SYSTEM_PNG=ON -DITK_USE_SYSTEM_SWIG=ON -DITK_USE_SYSTEM_TIFF=ON -DITK_USE_SYSTEM_ZLIB=ON -DITK_USE_KWSTYLE=OFF -DITK_BUILD_DEFAULT_MODULES=ON -DITK_COMPUTER_MEMORY_SIZE=1 -DWRAP_ITK_JAVA=OFF -DWRAP_ITK_TCL=OFF -Ddouble-conversion_INCLUDE_DIRS=/usr/include/double-conversion -DExternalData_OBJECT_STORES=/var/tmp/portage/sci-libs/itk-5.0.0/work/InsightToolkit-/.ExternalData -DBUILD_TESTING=ON -DBUILD_EXAMPLES=OFF -DITK_USE_REVIEW=OFF -DITK_INSTALL_LIBRARY_DIR=lib64 -DITK_WRAP_PYTHON=OFF -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/sci-libs/itk-5.0.0/work/itk-5.0.0_build/gentoo_toolchain.cmake  /var/tmp/portage/sci-libs/itk-5.0.0/work/InsightToolkit-5.0.0

I get the following build.log failure.

With:

cmake -C /var/tmp/portage/sci-libs/itk-5.0.0/work/itk-5.0.0_build/gentoo_common_config.cmake -G Unix Makefiles -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DITK_USE_SYSTEM_DCMTK=ON -DGDCM_USE_SYSTEM_OPENJPEG=ON -DITK_USE_SYSTEM_DOUBLECONVERSION=ON -DITK_USE_SYSTEM_CASTXML=ON -DITK_USE_SYSTEM_HDF5=ON -DITK_USE_SYSTEM_JPEG=ON -DITK_USE_SYSTEM_PNG=ON -DITK_USE_SYSTEM_SWIG=ON -DITK_USE_SYSTEM_TIFF=ON -DITK_USE_SYSTEM_ZLIB=ON -DITK_USE_KWSTYLE=OFF -DITK_BUILD_DEFAULT_MODULES=ON -DITK_COMPUTER_MEMORY_SIZE=1 -DWRAP_ITK_JAVA=OFF -DWRAP_ITK_TCL=OFF -Ddouble-conversion_INCLUDE_DIRS=/usr/include/double-conversion -DExternalData_OBJECT_STORES=/var/tmp/portage/sci-libs/itk-5.0.0/work/InsightToolkit-/.ExternalData -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DITK_USE_REVIEW=OFF -DITK_INSTALL_LIBRARY_DIR=lib64 -DITK_WRAP_PYTHON=OFF -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/sci-libs/itk-5.0.0/work/itk-5.0.0_build/gentoo_toolchain.cmake  /var/tmp/portage/sci-libs/itk-5.0.0/work/InsightToolkit-5.0.0

The build works, as seen in this build.log.

What can I do to allow ITK 5.0.0 to successfully build with testing support enabled?

Bug

Most helpful comment

Thank you all for your help! :)

All 9 comments

If you want to do an offline build with testing, get ITKTestingData and unzip it into /var/tmp/portage/sci-libs/itk-5.0.0/work/InsightToolkit-/.ExternalData, or wherever you configure ExternalData_OBJECT_STORES to point to.

@TheChymera thanks for the continued work on packaging :+1:

To just download the data required for a given release, download the InsightData tarball and unpack it in the same directory that the sources were unpacked. For example,

https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.0.1/InsightData-5.0.1.tar.gz

Ok, @dzenanz , thanks for the pointer. I tried it again, and I get this build.log (CMake command at the beginning).

It still fails, thought the data seems toe be there:

darkhost /var/tmp/portage/sci-libs # tree itk-5.0.0/work/InsightToolkit-5.0.0/.ExternalData/
itk-5.0.0/work/InsightToolkit-5.0.0/.ExternalData/
|-- MD5
|   |-- 000361a85ff53cec8df5e6f00fcb3454
|   |-- 0005313c352ea289a61da9f412016a9d
|   |-- 0010e97b9d899be916a4e82cb6267c71
|   |-- 00364cfde89513a86de8228b0bd2e4ea
|   |-- 00507edaa64607d62de40375d48fe0f9
|   |-- 007603baa7aed28d8040164d93502443
|   |-- 00835c337749f68b63fb7bbd7c009e94
|   |-- 00bd97f6008825bab8e117837777e9fe
|   |-- 00bf1523c6751b4c2f0db7ddecf25d99
|   |-- 00d9bbe450140a8b30f02950dd00dea2
...

you get the idea

Those .tar.gz files only contain files index by MD5 hashes, and the error log contains complaints about missing sha512 hash. Corresponding .md5 file is just next to it.

Can you try adding to CMake configure line also -DITK_FORBID_DOWNLOADS=ON? Maybe that will force it to look for MD5 index before trying to download it.

@thewtex are you sure for 5.0.0 this shouldn't be https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.0.0/InsightData-5.0.0.tar.gz ?

I would recommend packaging 5.0.1 -- if I recall correctly, the 5.0.0 InsightData tarball was missing a few entries, which would explain the failure.

@thewtex ok, packaged that, and it seems to work, now, including with the tests.

Can you please give it a look and tell me whether the build log looks ok to you?
itk-5.0.1-build.log

Not least of all, is it safe to set ITK_COMPUTER_MEMORY_SIZE to the total memory size of my computer? Or is there any other preferable heuristic?

The log looks fine to me. ITK_COMPUTER_MEMORY_SIZE only controls whether some tests requiring large amount of memory (4-5GB) are run.

Edit: yes, you can set it to total memory size of the computer, or just leave it at default value of 1 to reduce your build script's peak memory use.

Thank you all for your help! :)

Was this page helpful?
0 / 5 - 0 ratings