Skip to content

Commit

Permalink
add CCPi-Regularisation-Toolkit with BUILD_CIL
Browse files Browse the repository at this point in the history
  • Loading branch information
paskino committed Sep 27, 2023
2 parents e6b31c6 + d858fda commit fc67546
Show file tree
Hide file tree
Showing 19 changed files with 204 additions and 92 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/GHA_increase_disk_space.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
df -h
# locations from the internet, e.g. https://github.com/easimon/maximize-build-space
# saves about 2GB
if [ -d /usr/share/dotnet ]; then
echo removing dotnet
sudo rm -rf /usr/share/dotnet
fi
# saves about 10 GB
if [ -d "$AGENT_TOOLSDIRECTORY" ]; then
echo removing agent_tools
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
fi
# saves about 10 GB
if [ -d /usr/local/lib/android ]; then
echo removing android files
sudo rm -rf /usr/local/lib/android
fi
if [ -d /opt/ghc ]; then
echo removing android files
sudo rm -rf /opt/ghc
fi
df -h
13 changes: 13 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: disk space
shell: bash
run: |
case ${{matrix.os}} in
(ubuntu* | macOS*)
sudo .github/workflows/GHA_increase_disk_space.sh
;;
(windows*)
# no idea what to do here
;;
esac
- name: install_dependencies
run:
cd docker;
Expand Down
34 changes: 20 additions & 14 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install docker and pre-reqs
- name: Install docker and pre-reqs and clean some disk-space
shell: bash -l {0}
run: |
# make the file runnable
sudo bash .github/workflows/install_docker.sh
sudo .github/workflows/install_docker.sh
sudo .github/workflows/GHA_increase_disk_space.sh
- name: Build docker core image
# Builds docker image from Docker file.
Expand Down Expand Up @@ -56,10 +56,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install docker and pre-reqs
- name: Install docker and pre-reqs and clean some disk-space
shell: bash -l {0}
run: |
.github/workflows/install_docker.sh
sudo .github/workflows/install_docker.sh
sudo .github/workflows/GHA_increase_disk_space.sh
- name: Build docker core-gpu image
# Builds docker image from Docker file.
Expand Down Expand Up @@ -89,10 +90,11 @@ jobs:
tag: ['latest', 'devel']
steps:
- uses: actions/checkout@v3
- name: Install docker and pre-reqs
- name: Install docker and pre-reqs and clean some disk-space
shell: bash -l {0}
run: |
.github/workflows/install_docker.sh
sudo .github/workflows/install_docker.sh
sudo .github/workflows/GHA_increase_disk_space.sh
- name: Download artifact of core image
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -136,10 +138,11 @@ jobs:
needs: build-core-gpu
steps:
- uses: actions/checkout@v3
- name: Install docker and pre-reqs
- name: Install docker and pre-reqs and clean some disk-space
shell: bash -l {0}
run: |
.github/workflows/install_docker.sh
sudo .github/workflows/install_docker.sh
sudo .github/workflows/GHA_increase_disk_space.sh
- name: Download artifact of core image
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -189,10 +192,11 @@ jobs:
tag: ['service', 'devel-service']
steps:
- uses: actions/checkout@v3
- name: Install docker and pre-reqs
- name: Install docker and pre-reqs and clean some disk-space
shell: bash -l {0}
run: |
.github/workflows/install_docker.sh
sudo .github/workflows/install_docker.sh
sudo .github/workflows/GHA_increase_disk_space.sh
- name: setup variables
shell: bash -l {0}
Expand Down Expand Up @@ -236,7 +240,8 @@ jobs:
run: |
# first we must delete image that is no longer needed, to save space:
docker rmi synerbi/sirf:${{ env.prereq_image_name }}
yes | docker system prune
# get rid of everything over 2 days old
docker system prune -a --filter "until=2d"
docker image ls
docker save synerbi/sirf:service | gzip > ${{ matrix.tag }}.tar.gz
Expand All @@ -256,10 +261,11 @@ jobs:
# tag: ['core', 'latest', 'devel', 'service', 'devel-service', 'core-gpu', 'service-gpu']
# steps:
# - uses: actions/checkout@v3
# - name: Install docker and pre-reqs
# - name: Install docker and pre-reqs and clean some disk-space
# shell: bash -l {0}
# run: |
# .github/workflows/install_docker.sh
# sudo .github/workflows/install_docker.sh
# sudo .github/workflows/GHA_increase_disk_space.sh

# - name: Download artifact of image
# uses: actions/download-artifact@v3
Expand Down
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ jobs:
script: &docker_script
- |
# run tests within the container
# Disabled tests as we no longer have ctest files in the container
true
# TODO: also add CORE tests!
# TODO: GPU tests are failing even with nvidia run-time https://github.com/SyneRBI/SIRF-SuperBuild/issues/553
if [[ "$DOCKER_BUILD" != *"CORE"* && "$DOCKER_BUILD" != *"GPU"* ]]; then
# if [[ "$DOCKER_BUILD" != *"CORE"* && "$DOCKER_BUILD" != *"GPU"* ]]; then
# Need to run as jovyan to be able to write to build directory (needed by ctest)
$DCC run --rm -u jovyan --entrypoint /bin/bash sirf --login -c /devel/test.sh 1
fi
# $DCC run --rm -u jovyan --entrypoint /bin/bash sirf --login -c /devel/test.sh 1
# fi
after_success: &docker_after_success
- |
# push images
Expand Down
14 changes: 12 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
# ChangeLog

## vx.x.x
## v3.5.0
- Temporarily disable CCPi-Regularisation due to #832
- CMake/building:
- default `DISABLE_MATLAB` to `ON` as SIRF Matlab support is out-of-date and enabling it could
generate conflicts with Python shared libraries.
- docker image updates
- introduce `REMOVE_BUILD_FILES` variable. If set to 1 (which is the default),
most build files will be removed in the docker image.
- introduce `RUN_CTESTS` variable. If set to 1 (which is the default),
the CTests will be run while building the image.
- remove obsolete copying of gadgetron.xml
- Installing requirements for SIRF-Exercises uses its environment.yml or requirements.txt depending on settings.
- Build Gadgetron master. Requires new Ubuntu packages: libdcmtk-dev, libpugixml-dev, libgflags-dev,
libssl-dev, libcurl4-openssl-dev, pkg-config, golang, libboost-coroutine-dev, libboost-context-dev, libboost-random-dev.
- Added SuperBuild project dependency: range-v3, RocksDB, Date, mrd-storage-server
- Added SuperBuild project dependencies for Gadgetron: range-v3, RocksDB, Date, mrd-storage-server
- updated versions:
- Gadgetron: 42f11bf14b77b16f1ca5bcfbfa435d5ee8cb22a6 (master)
- RocksDB: 6.26.0
- range-v3: 0.12.0
- siemens_to_ismrmrd: 8bb8b08f53ce73c2de9ba5f47f1532f96292d92b
- ISMRMRD: v1.13.2
- SIRF: v3.5.0
- CIL: 0ba2f8e2935db66ec3dfe8c88e407e8d0eb5609f
- CCPi-Regularisation: v22.0.0
- TomoPhantom: v2.0.0

## v3.4.0
- Removed CIL-ASTRA as it has been merged into CIL code base.
Expand Down
7 changes: 5 additions & 2 deletions SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ else()
endif()

#### MATLAB support
option(DISABLE_Matlab "Disable building MATLAB support" OFF)
option(DISABLE_Matlab "Disable building MATLAB support" ON)
if (DISABLE_Matlab)
message(STATUS "Matlab support disabled")
else()
Expand Down Expand Up @@ -197,6 +197,8 @@ option(USE_SYSTEM_NIFTYREG "Build using an external version of NIFTYREG" OFF)
option(USE_SYSTEM_GTest "Build using an external version of GTest" OFF)
option(USE_SYSTEM_ACE "Build using an external version of ACE" ON)
option(USE_SYSTEM_RocksDB "Build using an external version of RocksDB" ON)
option(USE_SYSTEM_Date "Build using an external version of Date" OFF)
option(USE_SYSTEM_pugixml "Build using an external version of pugixml" ON)

# SPM requires matlab
if (BUILD_MATLAB)
Expand Down Expand Up @@ -298,6 +300,7 @@ endif()

if (BUILD_Gadgetron)
list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES Gadgetron)
list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES mrd-storage-server)
set(Armadillo_REQUIRED_VERSION 4.600)
endif()
option(DISABLE_range-v3_TESTING "Disable range-v3 testing" ON)
Expand All @@ -314,7 +317,7 @@ if ("${PYTHON_STRATEGY}" STREQUAL "CONDA")
set (BUILD_CIL OFF)
endif()
if (BUILD_CIL)
list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES CIL CCPi-Regularisation-Toolkit TomoPhantom)
list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES CIL CCPi-Regularisation-Toolkit TomoPhantom)
endif()
if (BUILD_ASTRA)
list(APPEND ${PRIMARY_PROJECT_NAME}_DEPENDENCIES astra-python-wrapper)
Expand Down
4 changes: 2 additions & 2 deletions SuperBuild/External_CCPi-Regularisation-Toolkit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr

set(${proj}_ROOT ${${proj}_SOURCE_DIR})
set(${proj}_INCLUDE_DIR ${${proj}_SOURCE_DIR})
add_test(NAME CIL_REGULARISATION_TEST_1
COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -s test -p test_*.py
add_test(NAME CIL_REGULARISATION_TEST_CPU
COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -s test -p test_CPU_*.py
WORKING_DIRECTORY ${${proj}_SOURCE_DIR})

else()
Expand Down
9 changes: 3 additions & 6 deletions SuperBuild/External_CIL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr
add_test(NAME CIL_FRAMEWORK_TESTS_3
COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_run_*.py
WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test)
# add_test(NAME CIL_SIRF_TESTS
# COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_SIRF*.py
# WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test)
add_test(NAME CIL_SIRF_TESTS
COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_SIRF*.py
WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test)
add_test(NAME CIL_FRAMEWORK_TESTS_4
COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_Block_*.py
WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test)
Expand All @@ -116,9 +116,6 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr
add_test(NAME CIL_FRAMEWORK_TESTS_9
COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_Operator.py
WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test)
add_test(NAME CIL_FRAMEWORK_TESTS_10
COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_PluginsRegularisation.py
WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test)
add_test(NAME CIL_FRAMEWORK_TESTS_11
COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -p test_quality_measures.py
WORKING_DIRECTORY ${${proj}_SOURCE_DIR}/Wrappers/Python/test)
Expand Down
22 changes: 3 additions & 19 deletions SuperBuild/External_Gadgetron.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
set(proj Gadgetron)

# Set dependency list
set(${proj}_DEPENDENCIES "ACE;Boost;HDF5;ISMRMRD;FFTW3double;Armadillo;GTest;range-v3;JSON;RocksDB;Date;mrd-storage-server")
set(${proj}_DEPENDENCIES "ACE;Boost;HDF5;ISMRMRD;FFTW3double;Armadillo;GTest;range-v3;JSON;RocksDB;Date")

# Include dependent projects if any
ExternalProject_Include_Dependencies(${proj} DEPENDS_VAR ${proj}_DEPENDENCIES)
Expand All @@ -47,13 +47,9 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr

# Gadgetron only adds tests if (GTEST_FOUND AND ARMADILLO_FOUND)
# but that's currently always the case.
# Default to on, as we cannot disable it, and they're quite fast
# Default to on, as they're quite fast
option(BUILD_TESTING_${proj} "Build tests for ${proj}" ON)

#message(STATUS "HDF5_ROOT in External_SIRF: " ${HDF5_ROOT})
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${SUPERBUILD_INSTALL_DIR})
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${SUPERBUILD_INSTALL_DIR})

# BLAS
find_package(BLAS)

Expand Down Expand Up @@ -107,24 +103,12 @@ endif()
set(${proj}_ENABLE_OPENMP OFF)
endif()

# require to have access to Python for patching
if (NOT PYTHON_EXECUTABLE)
if (${CMAKE_VERSION} VERSION_LESS "3.12")
find_package(PythonInterp REQUIRED)
else()
find_package(Python COMPONENTS Interpreter REQUIRED)
set (PYTHON_EXECUTABLE ${Python_EXECUTABLE})
endif()
endif()

# Sets ${proj}_URL_MODIFIED and ${proj}_TAG_MODIFIED
SetGitTagAndRepo("${proj}")
set (${proj}_CMAKE_ARGS
-DBUILD_PYTHON_SUPPORT:BOOL=${${proj}_BUILD_PYTHON_SUPPORT}
-DBUILD_MATLAB_SUPPORT:BOOL=${${proj}_BUILD_MATLAB_SUPPORT}
-DCMAKE_PREFIX_PATH:PATH=${SUPERBUILD_INSTALL_DIR}
-DCMAKE_LIBRARY_PATH:PATH=${SUPERBUILD_INSTALL_DIR}/lib
-DCMAKE_INCLUDE_PATH:PATH=${SUPERBUILD_INSTALL_DIR}/include
-DCMAKE_INSTALL_PREFIX:PATH=${${proj}_INSTALL_DIR}
${Boost_CMAKE_ARGS}
${PYTHONLIBS_CMAKE_ARGS}
Expand All @@ -135,7 +119,7 @@ endif()
-DUSE_MKL:BOOL=${${proj}_USE_MKL}
-DUSE_CUDA:BOOL=${${proj}_USE_CUDA}
-DUSE_OPENMP:BOOL=${${proj}_ENABLE_OPENMP}
-DBUILD_TESTING:BOOL=ON
-DBUILD_TESTING:BOOL=${BUILD_TESTING_${proj}}
)


Expand Down
2 changes: 1 addition & 1 deletion SuperBuild/External_ISMRMRD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
set(proj ISMRMRD)

# Set dependency list
set(${proj}_DEPENDENCIES "HDF5;Boost;FFTW3")
set(${proj}_DEPENDENCIES "HDF5;Boost;FFTW3;pugixml")

# Include dependent projects if any
ExternalProject_Include_Dependencies(${proj} DEPENDS_VAR ${proj}_DEPENDENCIES)
Expand Down
68 changes: 68 additions & 0 deletions SuperBuild/External_pugixml.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#========================================================================
# Author: Edoardo Pasca
# Copyright 2022 UKRI STFC
#
# This file is part of the CCP SyneRBI (formerly PETMR) Synergistic Image Reconstruction Framework (SIRF) SuperBuild.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#=========================================================================
#This needs to be unique globally
set(proj pugixml)

# Set dependency list
set(${proj}_DEPENDENCIES "")

# Include dependent projects if any
ExternalProject_Include_Dependencies(${proj} DEPENDS_VAR ${proj}_DEPENDENCIES)

# Set external name (same as internal for now)
set(externalProjName ${proj})
SetCanonicalDirectoryNames(${proj})

if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalProjName}}" ) )
message(STATUS "${__indent}Adding project ${proj}")

### --- Project specific additions here


# Sets ${proj}_URL_MODIFIED and ${proj}_TAG_MODIFIED
SetGitTagAndRepo("${proj}")

# conda build should never get here
if("${PYTHON_STRATEGY}" STREQUAL "PYTHONPATH")
# in case of PYTHONPATH it is sufficient to copy the files to the
# $PYTHONPATH directory
ExternalProject_Add(${proj}
${${proj}_EP_ARGS}
${${proj}_EP_ARGS_GIT}
${${proj}_EP_ARGS_DIRS}
CMAKE_ARGS -DCMAKE_INSTALL_INCLUDEDIR:PATH=${SUPERBUILD_INSTALL_DIR}/include
DEPENDS ${${proj}_DEPENDENCIES}
)

else()
# if SETUP_PY one can launch the conda build.sh script setting
# the appropriate variables.
message(FATAL_ERROR "Only PYTHONPATH install method is currently supported")
endif()

else()
ExternalProject_Add_Empty(${proj} DEPENDS "${${proj}_DEPENDENCIES}"
SOURCE_DIR ${${proj}_SOURCE_DIR}
BINARY_DIR ${${proj}_BINARY_DIR}
DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR}
STAMP_DIR ${${proj}_STAMP_DIR}
TMP_DIR ${${proj}_TMP_DIR}
)
endif()
2 changes: 1 addition & 1 deletion VirtualBox/VM_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.0
3.5.0
Loading

0 comments on commit fc67546

Please sign in to comment.