From df25df941d468e58a4e06c4b8bb482a87e27a5f2 Mon Sep 17 00:00:00 2001 From: Marc Modat Date: Thu, 28 Jul 2022 14:19:20 +0100 Subject: [PATCH] Issue #85: Adding macos and win --- .github/workflows/build_niftyreg.yml | 69 +++++++++++++++++++++++++--- niftyreg_build_version.txt | 2 +- 2 files changed, 64 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_niftyreg.yml b/.github/workflows/build_niftyreg.yml index bccf8987..0804910a 100644 --- a/.github/workflows/build_niftyreg.yml +++ b/.github/workflows/build_niftyreg.yml @@ -4,9 +4,9 @@ jobs: build: runs-on: ${{ matrix.os }} strategy: - max-parallel: 1 + max-parallel: 3 matrix: - os: [ubuntu-20.04] + os: [ubuntu-20.03, macos-11, windows-2022] include: - os: ubuntu-20.04 c-compiler: "gcc" @@ -14,21 +14,46 @@ jobs: use_cuda: "OFF" use_opencl: "OFF" use_openmp: "OFF" + - os: macos-11 + c-compiler: "gcc" + cxx-compiler: "g++" + use_cuda: "OFF" + use_opencl: "OFF" + use_openmp: "OFF" + - os: windows-2022 + c-compiler: "cl.exe" + cxx-compiler: "cl.exe" + use_cuda: "OFF" + use_opencl: "OFF" + use_openmp: "OFF" + vcvars64: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" steps: - uses: actions/checkout@v3 - name: Get CMake uses: lukka/get-cmake@latest + - name: Install Catch2 + if: matrix.os != "windows-2022" + run: | + git clone https://github.com/catchorg/Catch2.git + cd Catch2 + cmake -Bbuild -H. -DBUILD_TESTING=OFF + sudo cmake --build build/ --target install + shell: bash - name: Install Catch2 + if: matrix.os == "windows-2022" run: | + call "${{ matrix.vcvars64 }}" git clone https://github.com/catchorg/Catch2.git cd Catch2 cmake -Bbuild -H. -DBUILD_TESTING=OFF sudo cmake --build build/ --target install + shell: cmd - name: Configure NiftyReg + if: matrix.os != "windows-2022" run: | mkdir build cd build @@ -42,15 +67,47 @@ jobs: -DUSE_OPENMP=${{ matrix.use_openmp }} \ -DBUILD_TESTING=ON \ .. - cd .. shell: bash - - name: Build NiftyReg + - name: Configure NiftyReg + if: matrix.os = "windows-2022" run: | + mkdir build cd build - make + call "${{ matrix.vcvars64 }}" + cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} \ + -DCMAKE_C_COMPILER=${{ matrix.c-compiler }} \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_ALL_DEP=ON \ + -DUSE_CUDA=${{ matrix.use_cuda }} \ + -DUSE_OPENCL=${{ matrix.use_opencl }} \ + -DUSE_SSE=ON \ + -DUSE_OPENMP=${{ matrix.use_openmp }} \ + -DBUILD_TESTING=ON \ + .. + shell: cmd + + - name: Build NiftyReg + if: matrix.os != "windows-2022" + run: make + shell: bash + + - name: Build NiftyReg + if: matrix.os == "windows-2022" + run: make + shell: cmd - name: Run tests - run: ctest -V + if: matrix.os != "windows-2022" + run: | + call "${{ matrix.vcvars64 }}" + ctest -V shell: bash + - name: Run tests + if: matrix.os == "windows-2022" + run: | + call "${{ matrix.vcvars64 }}" + ctest -V + shell: cmd + diff --git a/niftyreg_build_version.txt b/niftyreg_build_version.txt index d88e3136..dde92ddc 100644 --- a/niftyreg_build_version.txt +++ b/niftyreg_build_version.txt @@ -1 +1 @@ -81 +82