Build and install SimpleITK with SimpleITK_USE_ELASTIX option in linux environment

Hi All,

I’m trying to install simple elastix package using SimpleITK v2.2.1 source code in a python 3.10.13 virtual environment by following the documentation:https://simpleitk.readthedocs.io/en/master/building.html
I’m getting an error when executing the built command after configuration:

cmake ../SimpleITK -D SimpleITK_USE_ELASTIX=ON
make  -j$(nproc) > output.log

I have attached the error lines I got in the terminal as cmd.
cmd.out (70.4 KB)
out file here.

Could you please help to solve this issue?

Thank you!

Thanks @thanuja Just wondering, are those errors specific to the USE_ELASTIX option, or do they also occur when you try to build without elastix? (-D SimpleITK_USE_ELASTIX=OFF)

Hello,

Can you share a few things about your system?

OS Version? Compiler version? CMake version? How much memory on your system, and now many cpus ( value of nproc)?

Any reason you are building the older “v2.2.1” tag? I’d building recommend the current master which is just after the v2.4rc2 tag with an update to Elastix 5.4.0 tag.

Looking at the log, I don’t see compiler errors just “Killed signal terminated program cc1plus” which may be due to running out of memory. A rule of thumb for the memory requirements for building SimpleITK if 4GB + 2 GB per core of memory when building in parallel.

P.S. If this is being run in a Docker container, the resources of the docker container need to be checked.

@Niels_Dekker Thank you for the reply. Yes, I’m getting the same error when building the source code without USE_ELASTIX option.

1 Like

@blowekamp Thank you for the reply. Please note that I’m installing Simple ITK 2.2.1 because ITK 5.3.0 is the available module in the virtual environment in the cluster. I have the privilege of installing packages as an end user. The details of the node where I have setup the virtual environment:

OS version:

NAME="Rocky Linux"
VERSION="8.9 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.9"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.9 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2029-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.9"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.9"

Compiler version:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3/usr/libexec/gcc/x86_64-pc-linux-gnu/12/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3/usr --bindir=/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3/usr/x86_64-pc-linux-gnu/gcc-bin/12 --includedir=/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3/usr/lib/gcc/x86_64-pc-linux-gnu/12/include --datadir=/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3/usr/share/gcc-data/x86_64-pc-linux-gnu/12 --mandir=/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3/usr/share/gcc-data/x86_64-pc-linux-gnu/12/man --infodir=/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3/usr/share/gcc-data/x86_64-pc-linux-gnu/12/info --with-gxx-include-dir=/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/12/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 12.3.1_p20230526 p2' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --with-sysroot=/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3 --with-build-sysroot=/cvmfs/soft.computecanada.ca/gentoo/2023/x86-64-v3 --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --with-multilib-list=m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --with-isl --disable-isl-version-check --disable-default-pie --disable-default-ssp --without-cuda-driver --enable-offload-targets=nvptx-none --with-build-config=bootstrap-lto
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.3.1 20230526 (Gentoo 12.3.1_p20230526 p2) 

CMake version: cmake version 3.27.7

Memory details:

MemTotal:       263548452 kB
MemFree:        60815524 kB
MemAvailable:   79183712 kB
Percpu:          1626112 kB

Since the memory per core is less than 2GB, I will try to build the source code from compute node rather than login node and update you. If there are anything else I can do, please let me know.

Thank you!

1 Like

Yes, It sounds like your processes were rightfully killed if you were building on a head node of a cluster.

With the current command line configuration you will not be using the installed system ITK.

1 Like

@blowekamp I am able to build v2.3.0 source code but 6 tests are failing when executing command:

cd SimpleITK-build/SimpleITK-build
ctest .

Please refer below:

99% tests passed, 6 tests failed out of 2756

Label Time Summary:
Lua       = 353.65 sec*proc (536 tests)
Python    = 728.56 sec*proc (590 tests)
Ruby      = 484.63 sec*proc (535 tests)
Tcl       = 207.89 sec*proc (534 tests)

Total Test time (real) = 3051.67 sec

The following tests FAILED:
	673 - Lua.ConfidenceConnectedImageFilter.3d (Failed)
	695 - Lua.ConnectedThresholdImageFilter.2d (Failed)
	696 - Lua.ConnectedThresholdImageFilter.2dwconnectivity (Failed)
	1850 - Lua.NeighborhoodConnectedImageFilter.2d (Failed)
	2545 - Lua.VectorConfidenceConnectedImageFilter.VM_segmentation (Failed)
	2668 - Python.Test.ConcurrentImageRead (SEGFAULT)
Errors while running CTest
Output from these tests are in: /home/uruththi/scratch/SimpleITK/SimpleITK-build/SimpleITK-build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.

Is there any additional command to install the binary after the build? I couldn’t import SimpleITK.

Thank you!

1 Like

Sorry that I have not checked the installation part. Everything works fine for the v2.3.0 version.

Thank you!

2 Likes

The Python.Test.ConcurrentImageRead test is known to be unstable on some systems, most likely related it internal ITK concurrent issues.

The Lua failures do not look familiar and the output would need to be inspected for the reason of the failures.

Glad to hear you have it working.

1 Like