From 571decba67e0dc4c3ab2bb3370682f8b04aa018d Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Mon, 15 Jul 2024 10:45:30 +0100 Subject: [PATCH 01/27] migrate cppflow to ONNXrt --- CMakeLists.txt | 3 +-- cmake_files/LookUpONNXRT.cmake | 41 ++++++++++++++++++++++++++++++++++ cmake_files/dependencies.cmake | 15 ++++--------- conanfile.py | 13 ++++++----- cpp/purify/algorithm_factory.h | 4 ++-- 5 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 cmake_files/LookUpONNXRT.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ac2d65a5c..49b136fdb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ option(docimg "Enable CImg" off) option(docasa "Enable CASA" off) option(docs "Build documentation" off) option(coverage "Build coverage" off) -option(cppflow "Build with TensorFlow interface" off) +option(onnxrt "Build with ONNXruntime interface" off) if(NOT CMAKE_BUILD_TYPE) message(STATUS "Setting build type to 'Release' as none was specified.") @@ -29,7 +29,6 @@ set(Sopt_GIT_TAG "development" CACHE STRING "Branch/tag when downloading sopt") ## we are doing c++11 #include(AddCPP11Flags) -# c++17 is required when using cppflow with learned algorithms set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/cmake_files/LookUpONNXRT.cmake b/cmake_files/LookUpONNXRT.cmake new file mode 100644 index 000000000..de4d3a3d7 --- /dev/null +++ b/cmake_files/LookUpONNXRT.cmake @@ -0,0 +1,41 @@ + +find_package(onnxruntime QUIET) +if(NOT ${onnxruntime_FOUND}) + message(STATUS "ONNXrt not found. Attempt to install...") + EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCH ) + message( STATUS "Detected architecture: ${ARCH}" ) + if ("${ARCH}" STREQUAL "x86_64") + set(ARCH "x64") + endif() + set(ORT_VERSION "1.16.3") + + set(ORT_URL_BASE "https://github.com/microsoft/onnxruntime/releases/download") + set(ORT_URL "${ORT_URL_BASE}/v${ORT_VERSION}/onnxruntime-linux-${ARCH}-${ORT_VERSION}.tgz") + + include(FetchContent) + # https://cmake.org/cmake/help/latest/policy/CMP0135.html + # + # CMP0135 is for solving re-building and re-downloading. + # The NEW policy suppresses warnings for some CMake versions. + if(POLICY CMP0135) + cmake_policy(SET CMP0135 NEW) + endif() + FetchContent_Declare(onnxruntime + URL ${ORT_URL} + URL_HASH SHA256=b072f989d6315ac0e22dcb4771b083c5156d974a3496ac3504c77f4062eb248e + DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/dependencies) + FetchContent_MakeAvailable(onnxruntime) + message(STATUS "Downloaded ONNXrt to ${onnxruntime_SOURCE_DIR}") + set(onnxruntime_INCLUDE_DIR "${onnxruntime_SOURCE_DIR}/include") + find_library(onnxruntime_LIBRARY + NAMES onnxruntime + PATHS ${onnxruntime_SOURCE_DIR}/lib + ${onnxruntime_SOURCE_DIR}/lib64) + add_library(onnxruntime::onnxruntime SHARED IMPORTED) + set_target_properties(onnxruntime::onnxruntime PROPERTIES + IMPORTED_LOCATION "${onnxruntime_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${onnxruntime_INCLUDE_DIR}" + LINKER_LANGUAGE CXX) + set(onnxruntime_FOUND TRUE) +endif() + diff --git a/cmake_files/dependencies.cmake b/cmake_files/dependencies.cmake index 14518ce20..a329df158 100644 --- a/cmake_files/dependencies.cmake +++ b/cmake_files/dependencies.cmake @@ -49,12 +49,6 @@ if(examples) find_package(TIFF REQUIRED) endif() - -if(cppflow) - find_package(cppflow) - find_library(TENSORFLOW_LIB tensorflow REQUIRED) -endif() - # Always find open-mp, since it may be used by sopt if (openmp) find_package(OpenMP) @@ -100,11 +94,10 @@ if(docasa) set(PURIFY_CASACORE TRUE) endif() -set(PURIFY_CPPFLOW FALSE) -if(cppflow) - find_package(cppflow) - find_library(TENSORFLOW_LIB tensorflow REQUIRED) - set(PURIFY_CPPFLOW TRUE) +set(PURIFY_ONNXRT FALSE) +if(onnxrt) + include(LookUpONNXRT) + set(PURIFY_ONNXRT TRUE) endif() # Add script to execute to make sure libraries in the build tree can be found diff --git a/conanfile.py b/conanfile.py index d7094e990..9fb6e3538 100644 --- a/conanfile.py +++ b/conanfile.py @@ -25,7 +25,7 @@ class PurifyConan(ConanFile): "af": ['on', 'off'], "cimg": ['on','off'], "docasa": ['on','off'], - "cppflow": ['on', 'off']} + "onnxrt": ['on', 'off']} default_options = {"docs": 'off', "examples":'off', "tests": 'on', @@ -36,11 +36,11 @@ class PurifyConan(ConanFile): "af": 'off', "cimg": 'off', "docasa": 'on', - "cppflow": 'off'} + "onnxrt": 'off'} def configure(self): - self.options["sopt"].cppflow = self.options.cppflow + self.options["sopt"].onnxrt = self.options.onnxrt self.options["sopt"].dompi = self.options.dompi self.options["sopt"].openmp = self.options.openmp # When building the sopt package, switch off sopt tests and examples, @@ -67,8 +67,9 @@ def requirements(self): if self.options.cimg == 'on': self.requires("cimg/3.0.2") - if self.options.cppflow == 'on': - self.requires("cppflow/2.0.0") + if self.options.onnxrt == 'on': + self.requires("onnxruntime/1.16.3") + def generate(self): tc = CMakeToolchain(self) @@ -83,7 +84,7 @@ def generate(self): tc.cache_variables['doaf'] = self.options.af tc.cache_variables['docimg'] = self.options.cimg tc.cache_variables['docasa'] = self.options.docasa - tc.cache_variables['cppflow'] = self.options.cppflow + tc.cache_variables['onnxrt'] = self.options.onnxrt # List cases where we don't use ccache if ('GITHUB_ACTIONS' in os.environ.keys() and self.options.docs == 'off'): diff --git a/cpp/purify/algorithm_factory.h b/cpp/purify/algorithm_factory.h index 752225a95..a4e8a5c46 100644 --- a/cpp/purify/algorithm_factory.h +++ b/cpp/purify/algorithm_factory.h @@ -201,13 +201,13 @@ fb_factory(const algo_distribution dist, break; } case (g_proximal_type::TFGProximal): { -#ifdef PURIFY_CPPFLOW +#ifdef PURIFY_ONNXRT // Create a shared pointer to an instance of the TFGProximal class gp = std::make_shared>(model_path); break; #else throw std::runtime_error( - "Type TFGProximal not recognized because purify was built with cppflow=off"); + "Type TFGProximal not recognized because purify was built with onnxrt=off"); #endif } default: { From c62d4d25232fd8a32905a7414165fa4e05b7ecaf Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Mon, 15 Jul 2024 10:51:56 +0100 Subject: [PATCH 02/27] update docs --- README.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 5a8118fa1..3381da9d6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Description -**PURIFY** is an open-source collection of routines written in `C++` available under the [license](#license) below. It implements different tools and high-level to perform radio interferometric imaging, _i.e._ to recover images from the Fourier measurements taken by radio interferometric telescopes. +**PURIFY** is an open-source collection of routines written in `C++` available under the [license](#license) below. It implements different tools and high-level to perform radio interferometric imaging, _i.e._ to recover images from the Fourier measurements taken by radio interferometric telescopes. **PURIFY** leverages recent developments in the field of compressive sensing and convex optimization. Low-level functionality to solve the resulting convex optimisation is factored into the open-source companion code, [**SOPT**](https://github.com/astro-informatics/sopt), also written by the authors of **PURIFY**. For further background please see the [reference](#references-and-citation) section. @@ -86,7 +86,7 @@ C++ dependencies as well as the **PURIFY** installation: You can turn the various options on and off by adding flags to the `conan install` command, e.g. ```bash - conan install .. -of . --build missing -o cppflow=on -o openmp=on -o mpi=off + conan install .. -of . --build missing -o onnxrt=on -o openmp=on -o mpi=off conan build .. -of . ``` @@ -118,25 +118,17 @@ On MacOS, you can also install most of the dependencies with Homebrew e.g. ``` -### TensorFlow support +### Machine-learning models support -The **SOPT** library includes an interface to TensorFlow for using trained models +The **SOPT** library includes an interface to ONNXrt for using trained models as priors in the Forward-Backward optimization algorithm. To build **PURIFY** with -TensorFlow capability, some extra steps are currently required. -We aim to simplify the build process in a future release. +ONNXrt capability, you need to enable `ONNXrt` support also in **SOPT**: -1. Install the [TensorFlow C API](https://www.tensorflow.org/install/lang_c) -1. Clone the UCL fork of `cppflow` and create a `conan` package using - - ``` bash - git clone git@github.com:UCL/cppflow.git - conan create /path/to/cppflow/ - ``` -1. Follow the nominal build instructions, making sure you enable the `cppflow` +1. Follow the nominal build instructions, making sure you enable the `onnxrt` option when building **SOPT** ... ```bash - conan create /path/to/purify/sopt/ --build missing -o cppflow=on + conan create /path/to/purify/sopt/ --build missing -o onnxrt=on ``` 1. ... and **PURIFY**: @@ -145,7 +137,7 @@ We aim to simplify the build process in a future release. cd /path/to/purify mkdir build cd build - conan install .. --build missing -o cppflow=on + conan install .. --build missing -o onnrt=on conan build .. ``` From bb6aacc20652b51ee701f5533457063abb537ccb Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Mon, 15 Jul 2024 11:01:01 +0100 Subject: [PATCH 03/27] missed one preprocessor flag --- cpp/purify/algorithm_factory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/purify/algorithm_factory.h b/cpp/purify/algorithm_factory.h index a4e8a5c46..057a4b1f2 100644 --- a/cpp/purify/algorithm_factory.h +++ b/cpp/purify/algorithm_factory.h @@ -24,7 +24,7 @@ #include #include #include -#ifdef PURIFY_CPPFLOW +#ifdef PURIFY_ONNXRT #include #endif From 3bc4165ac83be590c178d71a77283d85e9bf700d Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Mon, 15 Jul 2024 20:45:42 +0100 Subject: [PATCH 04/27] remove Conan support --- .github/workflows/cmake.yml | 57 ++++++-------- .github/workflows/documentation.yml | 110 ++++++++++----------------- README.md | 102 ++++--------------------- conanfile.py | 114 ---------------------------- 4 files changed, 79 insertions(+), 304 deletions(-) delete mode 100644 conanfile.py diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 8c074b603..dd722f230 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -17,9 +17,6 @@ env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release OMP_NUM_THREADS: 2 - CONAN_PRINT_RUN_COMMANDS: 1 - CONAN_CPU_COUNT: 2 - CONAN_SKIP_BROKEN_SYMLINKS_CHECK: 'True' jobs: build: @@ -49,11 +46,11 @@ jobs: - g++-11 - clang++ mpi: - - "on" - - "off" + - "ON" + - "OFF" omp: - - "on" - - "off" + - "ON" + - "OFF" exclude: - cc: gcc-11 cxx: clang++ @@ -93,34 +90,22 @@ jobs: if: ${{ contains(matrix.os, 'ubuntu') }} run: | sudo apt update - sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev - pip install conan + sudo apt install openmpi-bin libopenmpi-dev ccache libyaml-cpp-dev ccache libeigen3-dev libtiff-dev + git clone https://github.com/catchorg/Catch2.git -b v3.4.0 + mkdir Catch2/build + cd Catch2/build + cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${PWD} + make -j$(nproc --ignore 1) install + cd - - name: Install Dependencies on MacOS if: ${{ contains(matrix.os, 'macos') }} run: | - brew install gcc libtiff open-mpi libomp libyaml ccache conan + brew install gcc libtiff open-mpi libomp eigen libyaml ccache catch2 echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH - - name: Install Tensorflow API on Ubuntu - # TODO could this be combined with mac version somehow? if/else? - if: ${{ contains(matrix.os, 'ubuntu') }} - uses: UCL/install-tensorflow-action@main - with: - version: 2.11.0 - os: linux - - - name: Install Tensorflow API on MacOS - if: ${{ contains(matrix.os, 'macos') }} - uses: UCL/install-tensorflow-action@main - with: - version: 2.11.0 - os: darwin - - name: Select Python 3.10 - # otherwise turtlebrowser/get-conan@v1.1 fails on macos-12 - # ref: https://github.com/turtlebrowser/get-conan/issues/4 uses: actions/setup-python@v4 with: python-version: '3.10' @@ -147,15 +132,21 @@ jobs: - name: Build sopt run: | - conan profile detect - conan create ${{github.workspace}}/sopt --build missing -s compiler.cppstd=17 -o dompi=${{matrix.mpi}} -o openmp=${{matrix.omp}} - - - name: Dependencies - run: conan install ${{github.workspace}} -of ${{github.workspace}}/build -s compiler.cppstd=17 --build missing -o docasa=off -o dompi=${{matrix.mpi}} -o openmp=${{matrix.omp}} + export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH + mkdir ${{github.workspace}}/sopt/build + cd ${{github.workspace}}/sopt/build + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} + make -j$(nproc --ignore 1) install - name: Install # Build your program with the given configuration - run: conan build ${{github.workspace}} -of ${{github.workspace}}/build -s compiler.cppstd=17 -o docasa=off -o dompi=${{matrix.mpi}} -o openmp=${{matrix.omp}} + run: | + export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build + mkdir ${{github.workspace}}/build + cd ${{github.workspace}}/build + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} + make -j$(nproc --ignore 1) install - name: Test working-directory: ${{github.workspace}}/build diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 3f82fa0d6..ccb909189 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -7,9 +7,6 @@ on: branches: [ development ] if: github.event.pull_request.draft == false -env: - USE_CONAN: 0 - jobs: make-documentation: runs-on: ubuntu-20.04 @@ -23,26 +20,20 @@ jobs: - name: Install dependencies run: | sudo apt update - sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev doxygen graphviz - if [[ "$USE_CONAN" = 1 ]]; then - pip install conan - else - sudo apt install libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev - sudo apt install libbenchmark-dev libboost-all-dev libyaml-cpp-dev - git clone https://github.com/catchorg/Catch2.git -b v3.4.0 - mkdir Catch2/build - cd Catch2/build - cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build - make -j$(nproc --ignore 1) install - cd - - wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; - cd fftw-3.3.10 - ./configure --prefix=${{github.workspace}}/build --enable-shared - make -j$(nproc --ignore 1) install CFLAGS=-fPIC - # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) - sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake - cd - - fi + sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev doxygen graphviz libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev libbenchmark-dev libboost-all-dev libyaml-cpp-dev + git clone https://github.com/catchorg/Catch2.git -b v3.4.0 + mkdir Catch2/build + cd Catch2/build + cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build + make -j$(nproc --ignore 1) install + cd - + wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; + cd fftw-3.3.10 + ./configure --prefix=${{github.workspace}}/build --enable-shared + make -j$(nproc --ignore 1) install CFLAGS=-fPIC + # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) + sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake + cd - - name: Install Tensorflow API on Ubuntu uses: UCL/install-tensorflow-action@main @@ -59,16 +50,11 @@ jobs: - name: Create cppflow package run: | - if [[ "USE_CONAN" = 1 ]]; then - conan detect profile - conan create ./cppflow -s compiler.cppstd=17 - else - mkdir cppflow/build - cd cppflow/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} - #cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build - make -j$(nproc --ignore 1) install - fi + mkdir cppflow/build + cd cppflow/build + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} + #cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build + make -j$(nproc --ignore 1) install - name: Checkout SOPT uses: actions/checkout@v3 @@ -79,48 +65,34 @@ jobs: - name: Create SOPT package run : | - if [[ "USE_CONAN" = 1 ]]; then - conan create ./sopt -s compiler.cppstd=17 --build missing -o dompi=off -o docasa=off -o openmp=off -o docs=off -o cppflow=on - else - export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH - #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH - export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH - #export CMAKE_PREFIX_PATH=${{github.workspace}}/build/lib/cmake:$CMAKE_PREFIX_PATH - mkdir sopt/build - cd sopt/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON - #cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON - make -j$(nproc --ignore 1) install - fi + export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH + #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH + #export CMAKE_PREFIX_PATH=${{github.workspace}}/build/lib/cmake:$CMAKE_PREFIX_PATH + mkdir sopt/build + cd sopt/build + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON + #cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON + make -j$(nproc --ignore 1) install - name: Configure run: | - if [[ "USE_CONAN" = 1 ]]; then - # Doxygen currently broken in Conan v1 and v2 - #conan install doxygen/1.9.4@#2af713e135f12722e3536808017ba086 --update - conan install ${{github.workspace}} -if ${{github.workspace}}/build -s compiler.cppstd=17 --build missing -o docasa=off -o dompi=off -o openmp=off -o docs=on -o cppflow=on - else - export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH - export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH - mkdir -p ${{github.workspace}}/build - cd ${{github.workspace}}/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON -Dcppflow=ON - fi + export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH + mkdir -p ${{github.workspace}}/build + cd ${{github.workspace}}/build + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON -Dcppflow=ON - name: Build run: | - if [[ "USE_CONAN" = 1 ]]; then - conan build ${{github.workspace}} -of ${{github.workspace}}/build -s compiler.cppstd=17 -o docasa=off -o dompi=off -o openmp=off -o docs=on -o cppflow=on - else - export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH - ##export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build/lib/cmake:$CMAKE_PREFIX_PATH - #export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build:$CMAKE_PREFIX_PATH - #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH - ##export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH - export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH - cd ${{github.workspace}}/build - make -j$(nproc --ignore 1) install - fi + export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH + ##export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build/lib/cmake:$CMAKE_PREFIX_PATH + #export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build:$CMAKE_PREFIX_PATH + #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH + ##export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH + cd ${{github.workspace}}/build + make -j$(nproc --ignore 1) install - name: Deploy to GH pages if: ${{github.event_name == 'push'}} diff --git a/README.md b/README.md index 3381da9d6..5a08f6224 100644 --- a/README.md +++ b/README.md @@ -14,92 +14,34 @@ This documentation outlines the necessary and optional [dependencies](#dependenc ## Dependencies installation -**PURIFY** is written in `C++11`. Required software and libraries, and their minimum supported versions, are listed below. The build system will attempt to automatically download and build the automatically included libraries. (an internet connection is required for this). Most dependencies are handled by the `conan` package manager. +**PURIFY** is written in `C++11`. Required software and libraries, and their minimum supported versions, are listed below. The build system will attempt to automatically download and build the automatically included libraries. (an internet connection is required for this). `C++` dependencies: -### User-provided libraries - -In order to build **PURIFY**, you should have the following installed on your system. - - [CMake](http://www.cmake.org/) v3.5.1 A free software that allows cross-platform compilation -- [conan](https://conan.io/) v2.0.11 `C/C++` package manager. **NOTE** Conan v1 is no loner supported. - [GCC](https://gcc.gnu.org) v7.3.0 GNU compiler for `C++` - [OpenMP](http://openmp.org/wp/) v4.8.4 - Optional - Speeds up some of the operations. - [MPI](https://www.open-mpi.org) v3.1.1 - Optional - Parallelisation paradigm to speed up operations. - -### Automatically included libraries - -The build system of **PURIFY** will attempt to download and build these additional dependencies, depending on the build options passed to `conan`. Most of them are automatically handled by `conan`. - -- [astro-informatics/sopt](https://github.com/astro-informatics/sopt) v4.0.0: Sparse Optimization +- [astro-informatics/sopt](https://github.com/astro-informatics/sopt) v4.1.0: Sparse Optimization Compressed Sensing library. Included as a submodule. -- [UCL/GreatCMakeCookOff](https://github.com/UCL/GreatCMakeCookOff) Collection of `CMake` recipes. - Downloaded automatically if absent. - [Boost](https://www.boost.org/) v1.78.0: A set of free peer-reviewed - portable C++ libraries. Downloaded automatically by conan. -- [fftw3](www.fftw.org) v3.3.9: Fastest Fourier Transform in the West. Downloaded automatically by conan. -- [Eigen3](http://eigen.tuxfamily.org/index.php?title=Main_Page) v3.3.7: Modern `C++` linear algebra. Downloaded automatically by conan. -- [tiff](http://www.libtiff.org/) v4.0.9: Tag Image File Format library. Downloaded automatically by conan. -- [cfitsio](http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html): v4.0.0: Library of `C` and `Fortran` subroutines for reading and writing data files in FITS (Flexible Image Transport System) data format. Downloaded automatically by conan. -- [yaml-cpp](https://github.com/jbeder/yaml-cpp) v0.6.3: YAML parser and emitter in `C++`. Downloaded automatically by conan. + portable C++ libraries. +- [fftw3](www.fftw.org) v3.3.9: Fastest Fourier Transform in the West. +- [Eigen3](http://eigen.tuxfamily.org/index.php?title=Main_Page) v3.3.7: Modern `C++` linear algebra. +- [tiff](http://www.libtiff.org/) v4.0.9: Tag Image File Format library. +- [cfitsio](http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html): v4.0.0: Library of `C` and `Fortran` subroutines for reading and writing data files in FITS (Flexible Image Transport System) data format. +- [yaml-cpp](https://github.com/jbeder/yaml-cpp) v0.6.3: YAML parser and emitter in `C++`. - [casacore](http://casacore.github.io/casacore/) - Optional - Needed to interface with measurement +- [ONNXruntime](https://onnxruntime.ai/) v1.17.1 - Optional - a cross-platform runtime engine based on the Open Neural Network eXchange format. sets. The main **PURIFY** program requires this library (and its dependencies) -- [spdlog](https://github.com/gabime/spdlog) v1.9.2: Optional - Logging library. Downloaded automatically by conan. - [Catch2](https://github.com/catchorg/Catch2) v2.13.9: Optional - A `C++` - unit-testing framework only needed for testing. Downloaded automatically by conan. + unit-testing framework only needed for testing. - [google/benchmark](https://github.com/google/benchmark) v1.6.0: Optional - A `C++` - micro-benchmarking framework only needed for benchmarks. Downloaded automatically by conan. + micro-benchmarking framework only needed for benchmarks. ## Installing and building PURIFY -**Using Conan v2 (recommended)** - -[Conan](https://docs.conan.io/en/latest/installation.html) is a C++ package manager that helps deal with most of the -C++ dependencies as well as the **PURIFY** installation: - -1. Once the mandatory user-provided dependencies are present, - `git clone` from the [GitHub repository](https://github.com/astro-informatics/purify): - - ``` bash - git clone --recurse-submodules https://github.com/astro-informatics/purify.git - ``` -1. Create a `conan` package for `sopt` - - ```bash - conan create /path/to/purify/sopt/ --build missing - ``` - If you get an error about broken symlinks you can set `skip_broken_symlinks_check = True` in - your `~/.conan/conan.conf` file or - [set an environment variable](https://docs.conan.io/en/1.46/reference/env_vars.html#conan-skip-broken-symlinks-check) -1. Then, the program can be built using `conan`: - - ``` bash - cd /path/to/purify - mkdir build - cd build - conan install .. -of . --build missing - conan build .. -of . - ``` - -You can turn the various options on and off by adding flags to the `conan install` command, e.g. - - ```bash - conan install .. -of . --build missing -o onnxrt=on -o openmp=on -o mpi=off - conan build .. -of . - ``` - -The full list of build options can be found in the [conanfile](./conanfile.py). -To install in directory `INSTALL_FOLDER`, add the following options to the conan build command: - - ``` bash - conan build .. -of INSTALL_FOLDER - ``` - - -**Using CMake** - If the dependencies are already available on your system, you can also install **PURIFY** manually like so ``` bash @@ -118,28 +60,12 @@ On MacOS, you can also install most of the dependencies with Homebrew e.g. ``` -### Machine-learning models support +### Machine-learning models The **SOPT** library includes an interface to ONNXrt for using trained models as priors in the Forward-Backward optimization algorithm. To build **PURIFY** with -ONNXrt capability, you need to enable `ONNXrt` support also in **SOPT**: - -1. Follow the nominal build instructions, making sure you enable the `onnxrt` - option when building **SOPT** ... - - ```bash - conan create /path/to/purify/sopt/ --build missing -o onnxrt=on - ``` - -1. ... and **PURIFY**: - - ``` bash - cd /path/to/purify - mkdir build - cd build - conan install .. --build missing -o onnrt=on - conan build .. - ``` +ONNXrt capability, you need to enable `ONNXrt` support also in **SOPT** using +the `onnxrt` option when running the `cmake` command. ## Testing diff --git a/conanfile.py b/conanfile.py deleted file mode 100644 index 9fb6e3538..000000000 --- a/conanfile.py +++ /dev/null @@ -1,114 +0,0 @@ -from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps -from conan.tools.files import symlinks -import os - -class PurifyConan(ConanFile): - name = "purify" - version = "3.0.1" - url = "https://github.com/astro-informatics/purify" - license = "GPL-2.0" - description = "PURIFY is an open-source collection of routines written in C++ available under the license below. It implements different tools and high-level to perform radio interferometric imaging, i.e. to recover images from the Fourier measurements taken by radio interferometric telescopes." - - - settings = "os", "compiler", "build_type", "arch" - requires = ["fftw/3.3.9", "eigen/3.4.0","catch2/3.4.0","benchmark/1.8.2","yaml-cpp/0.7.0", "boost/1.82.0", "cfitsio/4.2.0", "sopt/4.0.0"] - #generators = "CMakeDeps" - exports_sources = "cpp/*", "cmake_files/*", "CMakeLists.txt" - options = {"docs":['on','off'], - "examples":['on','off'], - "tests":['on','off'], - "benchmarks":['on','off'], - "openmp":['on','off'], - "dompi":['on','off'], - "coverage":['on','off'], - "af": ['on', 'off'], - "cimg": ['on','off'], - "docasa": ['on','off'], - "onnxrt": ['on', 'off']} - default_options = {"docs": 'off', - "examples":'off', - "tests": 'on', - "benchmarks": 'off', - "openmp": 'off', - "dompi": 'off', - "coverage": 'off', - "af": 'off', - "cimg": 'off', - "docasa": 'on', - "onnxrt": 'off'} - - def configure(self): - - self.options["sopt"].onnxrt = self.options.onnxrt - self.options["sopt"].dompi = self.options.dompi - self.options["sopt"].openmp = self.options.openmp - # When building the sopt package, switch off sopt tests and examples, - # they are not going to be run. - self.options["sopt"].examples = 'off' - self.options["sopt"].tests = 'off' - - # Exclude boost features we don't need. without_fiber is required when - # building from source on MacOS with gcc. - # The rest are to speed up building from source. - self.options["boost"].without_fiber = True - self.options["boost"].without_python = True - - def requirements(self): - # Override version of zlib to prevent a conflict between versions of zlib required by depedencies - self.requires("zlib/1.2.12", override=True) - - if self.options.examples == 'on': - self.requires("libtiff/4.5.1") - - if self.options.docs == 'on': - self.requires("doxygen/1.9.2") - - if self.options.cimg == 'on': - self.requires("cimg/3.0.2") - - if self.options.onnxrt == 'on': - self.requires("onnxruntime/1.16.3") - - - def generate(self): - tc = CMakeToolchain(self) - - tc.cache_variables['docs'] = self.options.docs - tc.cache_variables['examples'] = self.options.examples - tc.cache_variables['tests'] = self.options.tests - tc.cache_variables['benchmarks'] = self.options.benchmarks - tc.cache_variables['openmp'] = self.options.openmp - tc.cache_variables['dompi'] = self.options.dompi - tc.cache_variables['coverage'] = self.options.coverage - tc.cache_variables['doaf'] = self.options.af - tc.cache_variables['docimg'] = self.options.cimg - tc.cache_variables['docasa'] = self.options.docasa - tc.cache_variables['onnxrt'] = self.options.onnxrt - - # List cases where we don't use ccache - if ('GITHUB_ACTIONS' in os.environ.keys() and self.options.docs == 'off'): - tc.cache_variables['CMAKE_C_COMPILER_LAUNCHER'] = "ccache" - tc.cache_variables['CMAKE_CXX_COMPILER_LAUNCHER'] = "ccache" - - tc.cache_variables['CMAKE_VERBOSE_MAKEFILE:BOOL'] = "ON" - tc.cache_variables['MPIEXEC_MAX_NUMPROCS'] = 2 - tc.generate() - - deps = CMakeDeps(self) - deps.generate() - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def package(self): - cmake = CMake(self) - cmake.configure() - cmake.install() - - def package_info(self): - self.cpp_info.libs = ["purify"] - - From 294e24883e88fc658bc7aa1b1c58ff86ed2d624f Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Mon, 15 Jul 2024 21:06:05 +0100 Subject: [PATCH 05/27] remove leftover cppflow stuff --- .github/workflows/cmake.yml | 31 +++++++++++++++++++++++---- .github/workflows/documentation.yml | 33 ++--------------------------- 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index dd722f230..5d9c516ee 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -90,20 +90,34 @@ jobs: if: ${{ contains(matrix.os, 'ubuntu') }} run: | sudo apt update - sudo apt install openmpi-bin libopenmpi-dev ccache libyaml-cpp-dev ccache libeigen3-dev libtiff-dev + sudo apt install openmpi-bin libopenmpi-dev ccache graphviz libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev libbenchmark-dev libboost-all-dev libyaml-cpp-dev git clone https://github.com/catchorg/Catch2.git -b v3.4.0 mkdir Catch2/build cd Catch2/build cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${PWD} make -j$(nproc --ignore 1) install cd - + wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; + cd fftw-3.3.10 + ./configure --prefix=${{github.workspace}}/build --enable-shared + make -j$(nproc --ignore 1) install CFLAGS=-fPIC + # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) + sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake + cd - - name: Install Dependencies on MacOS if: ${{ contains(matrix.os, 'macos') }} run: | - brew install gcc libtiff open-mpi libomp eigen libyaml ccache catch2 + brew install gcc libtiff open-mpi libomp eigen libyaml ccache catch2 cfitsio echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH + wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; + cd fftw-3.3.10 + ./configure --prefix=${{github.workspace}}/build --enable-shared + make -j$(nproc --ignore 1) install CFLAGS=-fPIC + # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) + sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake + cd - - name: Select Python 3.10 uses: actions/setup-python@v4 @@ -130,19 +144,28 @@ jobs: # - name: Clear ccache # run: ccache --clear + - name: Checkout SOPT + uses: actions/checkout@v3 + with: + repository: astro-informatics/sopt.git + path: sopt + ref: development + - name: Build sopt run: | - export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH mkdir ${{github.workspace}}/sopt/build cd ${{github.workspace}}/sopt/build cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} make -j$(nproc --ignore 1) install + - name: Install # Build your program with the given configuration run: | + export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH - export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build + export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH mkdir ${{github.workspace}}/build cd ${{github.workspace}}/build cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index ccb909189..e992dc633 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -35,27 +35,6 @@ jobs: sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake cd - - - name: Install Tensorflow API on Ubuntu - uses: UCL/install-tensorflow-action@main - with: - version: 2.11.0 - os: linux - - - name: Checkout cppflow repo - uses: actions/checkout@v3 - with: - repository: UCL/cppflow.git - path: cppflow - ref: master - - - name: Create cppflow package - run: | - mkdir cppflow/build - cd cppflow/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} - #cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build - make -j$(nproc --ignore 1) install - - name: Checkout SOPT uses: actions/checkout@v3 with: @@ -65,31 +44,23 @@ jobs: - name: Create SOPT package run : | - export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH #export CMAKE_PREFIX_PATH=${{github.workspace}}/build/lib/cmake:$CMAKE_PREFIX_PATH mkdir sopt/build cd sopt/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON - #cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF make -j$(nproc --ignore 1) install - name: Configure run: | - export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON -Dcppflow=ON + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON - name: Build run: | - export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH - ##export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build/lib/cmake:$CMAKE_PREFIX_PATH - #export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build:$CMAKE_PREFIX_PATH - #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH - ##export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH cd ${{github.workspace}}/build make -j$(nproc --ignore 1) install From 47e035ac455bb67f5f632943713ab959c203c56d Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Mon, 15 Jul 2024 21:37:32 +0100 Subject: [PATCH 06/27] set cmake prefix for catch2 --- .github/workflows/cmake.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5d9c516ee..6be64f78d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -108,9 +108,15 @@ jobs: - name: Install Dependencies on MacOS if: ${{ contains(matrix.os, 'macos') }} run: | - brew install gcc libtiff open-mpi libomp eigen libyaml ccache catch2 cfitsio + brew install gcc libtiff open-mpi libomp eigen libyaml ccache cfitsio echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH + git clone https://github.com/catchorg/Catch2.git -b v3.4.0 + mkdir Catch2/build + cd Catch2/build + cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${PWD} + make -j$(nproc --ignore 1) install + cd - wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; cd fftw-3.3.10 ./configure --prefix=${{github.workspace}}/build --enable-shared @@ -154,6 +160,7 @@ jobs: - name: Build sopt run: | export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH mkdir ${{github.workspace}}/sopt/build cd ${{github.workspace}}/sopt/build cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} From 0a16ef4723d4c9f1165ca377cadaeeacb787bc2b Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Tue, 16 Jul 2024 08:56:11 +0100 Subject: [PATCH 07/27] protect against existing directory --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6be64f78d..c9f1726d5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -161,7 +161,7 @@ jobs: run: | export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH - mkdir ${{github.workspace}}/sopt/build + mkdir -p ${{github.workspace}}/sopt/build cd ${{github.workspace}}/sopt/build cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} make -j$(nproc --ignore 1) install @@ -173,7 +173,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH - mkdir ${{github.workspace}}/build + mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} make -j$(nproc --ignore 1) install From d5149a0c62ae36811b86219fb15c7cb637fcf900 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Tue, 16 Jul 2024 09:29:25 +0100 Subject: [PATCH 08/27] add debugging output --- .github/workflows/cmake.yml | 2 +- cpp/CMakeLists.txt | 1 + cpp/tests/CMakeLists.txt | 6 ------ 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c9f1726d5..77f3516f0 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -182,4 +182,4 @@ jobs: working-directory: ${{github.workspace}}/build # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure ${{github.workspace}}/build diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 520cd28ca..5943bb939 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -26,6 +26,7 @@ add_include_dir( ) +message(STATUS "Cubature_LIBRARY_DIR=${Cubature_LIBRARY_DIR}") link_directories(${FFTW3_LIBRARY_DIRS} ${YAML_CPP_LIBRARY_DIR} ${Cubature_LIBRARY_DIR}) add_subdirectory(purify) if(tests OR examples OR benchmarks) diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index 21929136f..b5f8cc9ac 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -1,9 +1,6 @@ include_directories("${PROJECT_SOURCE_DIR}/cpp" "${PROJECT_BINARY_DIR}/include") add_library(common_catch_main_object OBJECT "common_catch_main.cc") -if(spdlog_FOUND) - target_link_libraries(common_catch_main_object spdlog::spdlog) -endif() if(Catch2_FOUND) target_link_libraries(common_catch_main_object Catch2::Catch2) endif() @@ -51,9 +48,6 @@ if(PURIFY_MPI) add_library(common_mpi_catch_main_object OBJECT "common_mpi_catch_main.cc") target_include_directories(common_mpi_catch_main_object PUBLIC ${PROJECT_BINARY_DIR}/include ${MPI_CXX_INCLUDE_PATH}) - if(spdlog_FOUND) - target_link_libraries(common_mpi_catch_main_object spdlog::spdlog) - endif() if(Catch2_FOUND) target_link_libraries(common_mpi_catch_main_object Catch2::Catch2) endif() From 0fe84362ed9e87c27d0f8ee3fbab338d791a4f94 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Tue, 16 Jul 2024 10:34:53 +0100 Subject: [PATCH 09/27] why cannot it not find cubature? --- .github/workflows/cmake.yml | 4 +++- cmake_files/dependencies.cmake | 14 ++++++++------ cpp/CMakeLists.txt | 1 - 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 77f3516f0..c53ae2ccc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -182,4 +182,6 @@ jobs: working-directory: ${{github.workspace}}/build # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure ${{github.workspace}}/build + run: | + export LD_LIBRARY_PATH=${{github.workspace}}/build/external/lib:${LD_LIBRARY_PATH} + ctest -C ${{env.BUILD_TYPE}} --output-on-failure diff --git a/cmake_files/dependencies.cmake b/cmake_files/dependencies.cmake index a329df158..eb2f90562 100644 --- a/cmake_files/dependencies.cmake +++ b/cmake_files/dependencies.cmake @@ -24,6 +24,14 @@ find_package(Boost COMPONENTS system filesystem REQUIRED) find_package(yaml-cpp REQUIRED) find_package(sopt REQUIRED) +set(PURIFY_ONNXRT FALSE) +if (onnxrt) + if (${sopt_HAS_ORT}) + set(PURIFY_ONNXRT TRUE) + else() + message(FATAL_ERROR "SOPT built without ONNXrt support") + endif() +endif() find_package(Cubature QUIET) if(NOT Cubature_FOUND) @@ -94,11 +102,5 @@ if(docasa) set(PURIFY_CASACORE TRUE) endif() -set(PURIFY_ONNXRT FALSE) -if(onnxrt) - include(LookUpONNXRT) - set(PURIFY_ONNXRT TRUE) -endif() - # Add script to execute to make sure libraries in the build tree can be found add_to_ld_path("${EXTERNAL_ROOT}/lib") diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 5943bb939..520cd28ca 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -26,7 +26,6 @@ add_include_dir( ) -message(STATUS "Cubature_LIBRARY_DIR=${Cubature_LIBRARY_DIR}") link_directories(${FFTW3_LIBRARY_DIRS} ${YAML_CPP_LIBRARY_DIR} ${Cubature_LIBRARY_DIR}) add_subdirectory(purify) if(tests OR examples OR benchmarks) From 0057a6cd45346d5824d37e5c24599aba1fc9bf70 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Tue, 16 Jul 2024 11:36:06 +0100 Subject: [PATCH 10/27] add boost --- .github/workflows/cmake.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c53ae2ccc..a4394a38c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -94,35 +94,35 @@ jobs: git clone https://github.com/catchorg/Catch2.git -b v3.4.0 mkdir Catch2/build cd Catch2/build - cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${PWD} + cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local make -j$(nproc --ignore 1) install cd - wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; cd fftw-3.3.10 - ./configure --prefix=${{github.workspace}}/build --enable-shared + ./configure --prefix=${{github.workspace}}/local --enable-shared make -j$(nproc --ignore 1) install CFLAGS=-fPIC # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) - sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake + sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake cd - - name: Install Dependencies on MacOS if: ${{ contains(matrix.os, 'macos') }} run: | - brew install gcc libtiff open-mpi libomp eigen libyaml ccache cfitsio + brew install gcc libtiff open-mpi libomp eigen libyaml ccache cfitsio boost echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH git clone https://github.com/catchorg/Catch2.git -b v3.4.0 mkdir Catch2/build cd Catch2/build - cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${PWD} + cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local make -j$(nproc --ignore 1) install cd - wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; cd fftw-3.3.10 - ./configure --prefix=${{github.workspace}}/build --enable-shared + ./configure --prefix=${{github.workspace}}/local --enable-shared make -j$(nproc --ignore 1) install CFLAGS=-fPIC # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) - sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake + sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake cd - - name: Select Python 3.10 @@ -159,29 +159,29 @@ jobs: - name: Build sopt run: | - export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH - export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH + #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/sopt/build cd ${{github.workspace}}/sopt/build - cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} make -j$(nproc --ignore 1) install - name: Install # Build your program with the given configuration run: | - export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH - export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH - export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH + #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH + #export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build - cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} make -j$(nproc --ignore 1) install - name: Test - working-directory: ${{github.workspace}}/build + working-directory: ${{github.workspace}}/local # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: | - export LD_LIBRARY_PATH=${{github.workspace}}/build/external/lib:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH=${{github.workspace}}/local:${LD_LIBRARY_PATH} ctest -C ${{env.BUILD_TYPE}} --output-on-failure From e81e6de98f39e2ce41f31a7db2735bed4a60f4cc Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Tue, 16 Jul 2024 11:46:12 +0100 Subject: [PATCH 11/27] add yaml-cpp to MacOS --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index a4394a38c..d1320afc5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -108,7 +108,7 @@ jobs: - name: Install Dependencies on MacOS if: ${{ contains(matrix.os, 'macos') }} run: | - brew install gcc libtiff open-mpi libomp eigen libyaml ccache cfitsio boost + brew install gcc libtiff open-mpi libomp eigen libyaml ccache cfitsio boost yaml-cpp echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH git clone https://github.com/catchorg/Catch2.git -b v3.4.0 @@ -179,7 +179,7 @@ jobs: make -j$(nproc --ignore 1) install - name: Test - working-directory: ${{github.workspace}}/local + working-directory: ${{github.workspace}}/build # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: | From 595bf03570b2bdcf481d73ff30328b3644f5a8ee Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Tue, 16 Jul 2024 11:58:07 +0100 Subject: [PATCH 12/27] help gcc a little --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d1320afc5..409ed883d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -183,5 +183,5 @@ jobs: # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: | - export LD_LIBRARY_PATH=${{github.workspace}}/local:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH=${{github.workspace}}/local:${{github.workspace}}/local/external/lib:${LD_LIBRARY_PATH} ctest -C ${{env.BUILD_TYPE}} --output-on-failure From 5fec0610e981228768d1fc80df6950e713a60e8f Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Tue, 16 Jul 2024 12:17:22 +0100 Subject: [PATCH 13/27] put correct install path for Cubature, d'oh --- cmake_files/LookUpCubature.cmake | 5 ++-- cmake_files/LookUpONNXRT.cmake | 41 -------------------------------- 2 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 cmake_files/LookUpONNXRT.cmake diff --git a/cmake_files/LookUpCubature.cmake b/cmake_files/LookUpCubature.cmake index ac8b2504f..64c4f27ba 100644 --- a/cmake_files/LookUpCubature.cmake +++ b/cmake_files/LookUpCubature.cmake @@ -14,6 +14,7 @@ if(NOT Cubature_GIT_TAG) set(Cubature_GIT_TAG master) endif() +set(Cubature_DIR "${CMAKE_INSTALL_PREFIX}/external") ExternalProject_Add( Lookup-Cubature GIT_REPOSITORY ${Cubature_GIT_REPOSITORY} @@ -21,7 +22,7 @@ ExternalProject_Add( PREFIX "${CMAKE_BINARY_DIR}/external" #INSTALL_DIR ${EXTERNAL_ROOT} CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external + -DCMAKE_INSTALL_PREFIX=${Cubature_DIR} -DCMAKE_INSTALL_LIBDIR=${CMAKE_SHARED_LIBRARY_PREFIX} # Wrap download, configure and build steps in a script to log output UPDATE_COMMAND "" @@ -30,8 +31,6 @@ ExternalProject_Add( LOG_BUILD ON LOG_INSTALL ON ) -ExternalProject_Get_Property(Lookup-Cubature install_dir) -set(Cubature_DIR "${install_dir}") set(Cubature_INCLUDE_DIR "${Cubature_DIR}/include") set(Cubature_LIBRARY_DIR "${Cubature_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}") set(Cubature_LIBRARIES "cubature") diff --git a/cmake_files/LookUpONNXRT.cmake b/cmake_files/LookUpONNXRT.cmake deleted file mode 100644 index de4d3a3d7..000000000 --- a/cmake_files/LookUpONNXRT.cmake +++ /dev/null @@ -1,41 +0,0 @@ - -find_package(onnxruntime QUIET) -if(NOT ${onnxruntime_FOUND}) - message(STATUS "ONNXrt not found. Attempt to install...") - EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCH ) - message( STATUS "Detected architecture: ${ARCH}" ) - if ("${ARCH}" STREQUAL "x86_64") - set(ARCH "x64") - endif() - set(ORT_VERSION "1.16.3") - - set(ORT_URL_BASE "https://github.com/microsoft/onnxruntime/releases/download") - set(ORT_URL "${ORT_URL_BASE}/v${ORT_VERSION}/onnxruntime-linux-${ARCH}-${ORT_VERSION}.tgz") - - include(FetchContent) - # https://cmake.org/cmake/help/latest/policy/CMP0135.html - # - # CMP0135 is for solving re-building and re-downloading. - # The NEW policy suppresses warnings for some CMake versions. - if(POLICY CMP0135) - cmake_policy(SET CMP0135 NEW) - endif() - FetchContent_Declare(onnxruntime - URL ${ORT_URL} - URL_HASH SHA256=b072f989d6315ac0e22dcb4771b083c5156d974a3496ac3504c77f4062eb248e - DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/dependencies) - FetchContent_MakeAvailable(onnxruntime) - message(STATUS "Downloaded ONNXrt to ${onnxruntime_SOURCE_DIR}") - set(onnxruntime_INCLUDE_DIR "${onnxruntime_SOURCE_DIR}/include") - find_library(onnxruntime_LIBRARY - NAMES onnxruntime - PATHS ${onnxruntime_SOURCE_DIR}/lib - ${onnxruntime_SOURCE_DIR}/lib64) - add_library(onnxruntime::onnxruntime SHARED IMPORTED) - set_target_properties(onnxruntime::onnxruntime PROPERTIES - IMPORTED_LOCATION "${onnxruntime_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${onnxruntime_INCLUDE_DIR}" - LINKER_LANGUAGE CXX) - set(onnxruntime_FOUND TRUE) -endif() - From 5192e96c62d7f125c48a6f6aae2d7aaba9e68d54 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Tue, 16 Jul 2024 12:45:56 +0100 Subject: [PATCH 14/27] missed the lib --- .github/workflows/cmake.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 409ed883d..9ea00aaa8 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -73,6 +73,8 @@ jobs: cc: gcc-11 - os: macos-14 mpi: "on" + - os: macos-14 + cxx: g++-11 - cxx: clang++ omp: "on" @@ -183,5 +185,5 @@ jobs: # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: | - export LD_LIBRARY_PATH=${{github.workspace}}/local:${{github.workspace}}/local/external/lib:${LD_LIBRARY_PATH} + export LD_LIBRARY_PATH=${{github.workspace}}/local/lib:${{github.workspace}}/local/external/lib:${LD_LIBRARY_PATH} ctest -C ${{env.BUILD_TYPE}} --output-on-failure From 4f23771973db991c41e06b3ef1eea81a9b4bc88d Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 12 Sep 2024 10:42:22 +0100 Subject: [PATCH 15/27] address comments --- .github/workflows/documentation.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e992dc633..654fdeefa 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -21,12 +21,6 @@ jobs: run: | sudo apt update sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev doxygen graphviz libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev libbenchmark-dev libboost-all-dev libyaml-cpp-dev - git clone https://github.com/catchorg/Catch2.git -b v3.4.0 - mkdir Catch2/build - cd Catch2/build - cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build - make -j$(nproc --ignore 1) install - cd - wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; cd fftw-3.3.10 ./configure --prefix=${{github.workspace}}/build --enable-shared @@ -44,9 +38,7 @@ jobs: - name: Create SOPT package run : | - #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH - #export CMAKE_PREFIX_PATH=${{github.workspace}}/build/lib/cmake:$CMAKE_PREFIX_PATH mkdir sopt/build cd sopt/build cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF @@ -57,7 +49,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON -Dtests=OFF - name: Build run: | From 8b3cd2c03dcde76d0cd049f4b8e4d5b91dee84f3 Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Thu, 12 Sep 2024 10:45:25 +0100 Subject: [PATCH 16/27] Move duplication to separate steps --- .github/workflows/cmake.yml | 81 ++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 46 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9ea00aaa8..511bb7649 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -79,33 +79,38 @@ jobs: omp: "on" steps: - - uses: actions/checkout@v3 - with: - submodules: recursive + - uses: actions/checkout@v4 # Enable tmate debugging of manually-triggered workflows if the input option was provided - name: Setup tmate session uses: mxschmitt/action-tmate@v3 if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + run: echo "{date_and_time}={$(date +'%Y-%m-%d-%H;%M;%S')}" >> $GITHUB_OUTPUT + - name: Set ccache cache directory + shell: bash + run: echo "CCACHE_DIR=${{runner.workspace}}/.ccache" >> "${GITHUB_ENV}" + - name: Cache ccache files + uses: actions/cache@v3 + with: + path: ${{runner.workspace}}/.ccache + key: ${{matrix.os}}-${{matrix.cxx}}-${{matrix.mpi}}-${{matrix.omp}}-${{ steps.ccache_cache_timestamp.outputs.date_and_time }} + restore-keys: | + ${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }} + ${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }} + ${{ matrix.os }}-${{ matrix.cxx }} + ${{ matrix.os }} + +# - name: Clear ccache +# run: ccache --clear + - name: Install Dependencies on Ubunutu if: ${{ contains(matrix.os, 'ubuntu') }} run: | sudo apt update sudo apt install openmpi-bin libopenmpi-dev ccache graphviz libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev libbenchmark-dev libboost-all-dev libyaml-cpp-dev - git clone https://github.com/catchorg/Catch2.git -b v3.4.0 - mkdir Catch2/build - cd Catch2/build - cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local - make -j$(nproc --ignore 1) install - cd - - wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; - cd fftw-3.3.10 - ./configure --prefix=${{github.workspace}}/local --enable-shared - make -j$(nproc --ignore 1) install CFLAGS=-fPIC - # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) - sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake - cd - - name: Install Dependencies on MacOS if: ${{ contains(matrix.os, 'macos') }} @@ -113,47 +118,32 @@ jobs: brew install gcc libtiff open-mpi libomp eigen libyaml ccache cfitsio boost yaml-cpp echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH - git clone https://github.com/catchorg/Catch2.git -b v3.4.0 + + - name: Checkout Catch2 + uses: actions/checkout@v4 + with: + repository: catchorg/Catch2.git + path: Catch2 + ref: v3.4.0 + + - name: Build Catch2 + run: | mkdir Catch2/build cd Catch2/build cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local make -j$(nproc --ignore 1) install - cd - + + - name: Install FFTW + run: | wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; cd fftw-3.3.10 ./configure --prefix=${{github.workspace}}/local --enable-shared make -j$(nproc --ignore 1) install CFLAGS=-fPIC # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake - cd - - - - name: Select Python 3.10 - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - run: echo "{date_and_time}={$(date +'%Y-%m-%d-%H;%M;%S')}" >> $GITHUB_OUTPUT - - name: Set ccache cache directory - shell: bash - run: echo "CCACHE_DIR=${{runner.workspace}}/.ccache" >> "${GITHUB_ENV}" - - name: Cache ccache files - uses: actions/cache@v3 - with: - path: ${{runner.workspace}}/.ccache - key: ${{matrix.os}}-${{matrix.cxx}}-${{matrix.mpi}}-${{matrix.omp}}-${{ steps.ccache_cache_timestamp.outputs.date_and_time }} - restore-keys: | - ${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }} - ${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }} - ${{ matrix.os }}-${{ matrix.cxx }} - ${{ matrix.os }} - -# - name: Clear ccache -# run: ccache --clear - name: Checkout SOPT - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: astro-informatics/sopt.git path: sopt @@ -168,7 +158,6 @@ jobs: cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} make -j$(nproc --ignore 1) install - - name: Install # Build your program with the given configuration run: | From e0cfc9ab452fbc795b8692843f32d34bb6e0e5a9 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 12 Sep 2024 10:50:20 +0100 Subject: [PATCH 17/27] address review comments --- .github/workflows/cmake.yml | 3 --- README.md | 2 ++ cmake_files/dependencies.cmake | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9ea00aaa8..8945f8823 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -162,7 +162,6 @@ jobs: - name: Build sopt run: | export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH - #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/sopt/build cd ${{github.workspace}}/sopt/build cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} @@ -173,8 +172,6 @@ jobs: # Build your program with the given configuration run: | export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH - #export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH - #export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} diff --git a/README.md b/README.md index 5a08f6224..e7fbef17e 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ This documentation outlines the necessary and optional [dependencies](#dependenc - [google/benchmark](https://github.com/google/benchmark) v1.6.0: Optional - A `C++` micro-benchmarking framework only needed for benchmarks. +For examples on how to install dependencies on Ubuntu and MacOS, see the +[cmake.yml](https://github.com/astro-informatics/purify/blob/development/.github/workflows/cmake.yml). ## Installing and building PURIFY diff --git a/cmake_files/dependencies.cmake b/cmake_files/dependencies.cmake index eb2f90562..0cc2da4cb 100644 --- a/cmake_files/dependencies.cmake +++ b/cmake_files/dependencies.cmake @@ -19,6 +19,7 @@ endif() find_package(CFitsIO MODULE REQUIRED) +cmake_policy(SET CMP0167 OLD) find_package(Boost COMPONENTS system filesystem REQUIRED) find_package(yaml-cpp REQUIRED) @@ -59,6 +60,7 @@ endif() # Always find open-mp, since it may be used by sopt if (openmp) + cmake_policy(SET CMP0074 NEW) find_package(OpenMP) if (OPENMP_FOUND) # Set PURIFY_OPENMP to TRUE when OpenMP is both found and requested From 6372d63df304b37929481a851b593ab89ea112bd Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 12 Sep 2024 10:53:53 +0100 Subject: [PATCH 18/27] switch off tests in SOPT for documentation --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 654fdeefa..c7a6bc3ac 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -41,7 +41,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH mkdir sopt/build cd sopt/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF make -j$(nproc --ignore 1) install - name: Configure From 9a0ea2498734aecd0774e5676c6cb3497ce27457 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 12 Sep 2024 11:01:40 +0100 Subject: [PATCH 19/27] enable Purify tests and examples in docs --- .github/workflows/documentation.yml | 33 ++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index c7a6bc3ac..8bcf7b932 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -22,12 +22,29 @@ jobs: sudo apt update sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev doxygen graphviz libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev libbenchmark-dev libboost-all-dev libyaml-cpp-dev wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; - cd fftw-3.3.10 - ./configure --prefix=${{github.workspace}}/build --enable-shared - make -j$(nproc --ignore 1) install CFLAGS=-fPIC - # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) - sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake - cd - + + - name: Checkout Catch2 + uses: actions/checkout@v4 + with: + repository: catchorg/Catch2.git + path: Catch2 + ref: v3.4.0 + + - name: Build Catch2 + run: | + mkdir Catch2/build + cd Catch2/build + cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local + make -j$(nproc --ignore 1) install + + - name: Install FFTW + run: | + wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz; + cd fftw-3.3.10 + ./configure --prefix=${{github.workspace}}/local --enable-shared + make -j$(nproc --ignore 1) install CFLAGS=-fPIC + # Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332) + sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake - name: Checkout SOPT uses: actions/checkout@v3 @@ -41,7 +58,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH mkdir sopt/build cd sopt/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF make -j$(nproc --ignore 1) install - name: Configure @@ -49,7 +66,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON -Dtests=OFF + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON - name: Build run: | From 968bcdaf90d6e5e89f3d863f3c72b5418af3a075 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 12 Sep 2024 11:09:09 +0100 Subject: [PATCH 20/27] build -> local --- .github/workflows/documentation.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8bcf7b932..998720b66 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -55,7 +55,7 @@ jobs: - name: Create SOPT package run : | - export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir sopt/build cd sopt/build cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF @@ -63,14 +63,14 @@ jobs: - name: Configure run: | - export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON - name: Build run: | - export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH + export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH cd ${{github.workspace}}/build make -j$(nproc --ignore 1) install From d059a9d9137fc4e293baa59f02c42caf120841ca Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 12 Sep 2024 11:22:39 +0100 Subject: [PATCH 21/27] cleanups --- .github/workflows/documentation.yml | 2 +- cpp/purify/CMakeLists.txt | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 998720b66..c712b3b0d 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -66,7 +66,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/locaL -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON - name: Build run: | diff --git a/cpp/purify/CMakeLists.txt b/cpp/purify/CMakeLists.txt index 8a1e75075..1e56b6ecb 100644 --- a/cpp/purify/CMakeLists.txt +++ b/cpp/purify/CMakeLists.txt @@ -75,19 +75,6 @@ target_include_directories(libpurify PUBLIC $ $) -if (cppflow) - target_link_libraries(libpurify "${TENSORFLOW_LIB}") - # Make cppflow include directory public. Install interface can't point to source directory, - # so it needs to be separately defined, explained in - # https://stackoverflow.com/questions/25676277/cmake-target-include-directories-prints-an-error-when-i-try-to-add-the-source - # Add /usr/local/include for default location of TensorFlow headers - target_include_directories(libpurify PUBLIC - $ - $ - $ - ) -endif() - add_include_dir( ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIR} @@ -124,12 +111,6 @@ if(PURIFY_CASACORE_LOOKUP) add_dependencies(libpurify Lookup-CasaCore) endif() -# Add spdlog as direct dependency -if(spdlog_FOUND) - target_link_libraries(libpurify spdlog::spdlog) - target_include_directories(libpurify SYSTEM PUBLIC ${spdlog_INCLUDE_DIR}) -endif() - install(FILES ${HEADERS} DESTINATION include/purify) install(TARGETS libpurify EXPORT PurifyTargets From 3b59a0594389aec1d511c4358620178311e135fc Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 12 Sep 2024 11:26:36 +0100 Subject: [PATCH 22/27] typo --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index c712b3b0d..a6f19fa6d 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -66,7 +66,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/locaL -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON + cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON - name: Build run: | From 230c27f6554b4adcba0fe84cca1e29932fdbf071 Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Thu, 12 Sep 2024 11:32:34 +0100 Subject: [PATCH 23/27] Speed up sopt build --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 729cbe546..afbc93bc9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -154,7 +154,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/sopt/build cd ${{github.workspace}}/sopt/build - cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} -Dtests=OFF -Dexamples=OFF make -j$(nproc --ignore 1) install - name: Install From 18f49d208bedca49a652333f945964d304e18482 Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Thu, 12 Sep 2024 11:40:02 +0100 Subject: [PATCH 24/27] Do cmake and make in same step --- .github/workflows/documentation.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index a6f19fa6d..30160ddb6 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -67,11 +67,6 @@ jobs: mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON - - - name: Build - run: | - export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH - cd ${{github.workspace}}/build make -j$(nproc --ignore 1) install - name: Deploy to GH pages From d2b30013100b3352fa5a13fa7ce5ff77bc7a69a0 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 12 Sep 2024 11:42:57 +0100 Subject: [PATCH 25/27] debug install path --- .github/workflows/documentation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 30160ddb6..2cdcc8467 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -58,7 +58,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir sopt/build cd sopt/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD}/local -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF make -j$(nproc --ignore 1) install - name: Configure @@ -66,7 +66,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build - cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON make -j$(nproc --ignore 1) install - name: Deploy to GH pages From 0fcc525a9ede05bee62bca57960c1770b8da4d65 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 12 Sep 2024 11:47:20 +0100 Subject: [PATCH 26/27] replace PWD --- .github/workflows/documentation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 2cdcc8467..f39a33e62 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -58,7 +58,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir sopt/build cd sopt/build - cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD}/local -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${github.workspace}/local -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF make -j$(nproc --ignore 1) install - name: Configure @@ -66,7 +66,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build - cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${github.workspace}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON make -j$(nproc --ignore 1) install - name: Deploy to GH pages From 6c30d50018dd6007a5e4e3314bd14d7d1aaef054 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 12 Sep 2024 11:50:40 +0100 Subject: [PATCH 27/27] use double curly braces --- .github/workflows/documentation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index f39a33e62..259e25345 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -58,7 +58,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir sopt/build cd sopt/build - cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${github.workspace}/local -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF make -j$(nproc --ignore 1) install - name: Configure @@ -66,7 +66,7 @@ jobs: export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH mkdir -p ${{github.workspace}}/build cd ${{github.workspace}}/build - cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${github.workspace}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON + cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON make -j$(nproc --ignore 1) install - name: Deploy to GH pages