From 175f1d8e9bb34250e087efd6e2dd457bb5ff7cbb Mon Sep 17 00:00:00 2001 From: gnikit Date: Sun, 9 Jun 2024 12:47:35 +0100 Subject: [PATCH 1/4] ci: use fortran-setup for GCC version testing --- .github/workflows/CI.yml | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e5b706361..dbc1db368 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,17 +20,18 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-12] - gcc_v: [10, 11, 12, 13] # Version of GFortran we want to use. + toolchain: + - {compiler: gcc, version: 10} + - {compiler: gcc, version: 11} + - {compiler: gcc, version: 12} + - {compiler: gcc, version: 13} build: [cmake] include: - os: ubuntu-latest - gcc_v: 10 build: cmake-inline + toolchain: + - {compiler: gcc, version: 10} env: - FC: gfortran-${{ matrix.gcc_v }} - CC: gcc-${{ matrix.gcc_v }} - CXX: g++-${{ matrix.gcc_v }} - GCC_V: ${{ matrix.gcc_v }} BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }} steps: @@ -45,22 +46,12 @@ jobs: - name: Install fypp run: pip install --upgrade fypp - - name: Install GCC compilers Linux - if: contains( matrix.os, 'ubuntu') - run: | - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo apt-get update - sudo apt-get install -y gcc-${GCC_V} g++-${GCC_V} gfortran-${GCC_V} - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ - --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ - --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \ - --slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V} - - - name: Install GCC compilers macOS - if: contains( matrix.os, 'macos') - run: | - brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true - brew link gcc@${GCC_V} + - name: Setup Fortran compiler + uses: fortran-lang/setup-fortran@v1.6.1 + id: setup-fortran + with: + compiler: ${{ matrix.toolchain.compiler }} + version: ${{ matrix.toolchain.version }} - name: Configure with CMake if: ${{ contains(matrix.build, 'cmake') }} From d91e93357b1155b44eaa837d78025cd83ce45c45 Mon Sep 17 00:00:00 2001 From: gnikit Date: Sun, 9 Jun 2024 14:03:30 +0100 Subject: [PATCH 2/4] ci: use setup-fortran for Intel compiler CI --- .github/workflows/CI.yml | 159 ++------------------------------------- 1 file changed, 5 insertions(+), 154 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index dbc1db368..637c2eddb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -25,12 +25,17 @@ jobs: - {compiler: gcc, version: 11} - {compiler: gcc, version: 12} - {compiler: gcc, version: 13} + - {compiler: intel, version: '2024.1'} + - {compiler: intel-classic, version: '2021.9'} build: [cmake] include: - os: ubuntu-latest build: cmake-inline toolchain: - {compiler: gcc, version: 10} + exclude: + - os: macos-12 + toolchain: {compiler: intel, version: '2024.1'} env: BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }} @@ -82,157 +87,3 @@ jobs: - name: Install project if: ${{ contains(matrix.build, 'cmake') }} run: cmake --install ${{ env.BUILD_DIR }} - - intel-build-llvm: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - fc: [ifx] - cc: [icx] - cxx: [icpx] - env: - FC: ${{ matrix.fc }} - CC: ${{ matrix.cc }} - CXX: ${{ matrix.cxx }} - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python 3.x - uses: actions/setup-python@v5 - with: - python-version: 3.x - - - name: Add Intel repository (Linux) - if: contains(matrix.os, 'ubuntu') - run: | - wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null - echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - sudo apt-get update - - - name: Install Intel oneAPI compiler (Linux) - if: contains(matrix.os, 'ubuntu') - run: | - sudo apt-get install intel-oneapi-compiler-fortran - sudo apt-get install intel-oneapi-compiler-dpcpp-cpp - - - name: Setup Intel oneAPI environment - run: | - source /opt/intel/oneapi/setvars.sh - printenv >> $GITHUB_ENV - - - name: Install fypp - run: pip install --upgrade fypp - - - name: Configure with CMake - run: >- - cmake -Wdev - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_MAXIMUM_RANK:String=4 - -DCMAKE_INSTALL_PREFIX=$PWD/_dist - -S . -B build - - - name: Build and compile - run: cmake --build build - - - name: catch build fail - run: cmake --build build --verbose --parallel 1 - if: failure() - - - name: test - run: ctest --parallel --output-on-failure --no-tests=error - working-directory: build - - - name: Install project - run: cmake --install build - - intel-build-classic: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-12] - fc: [ifort] - cc: [icc] - cxx: [icpc] - env: - MACOS_HPCKIT_URL: >- - https://registrationcenter-download.intel.com/akdlm/IRC_NAS/a99cb1c5-5af6-4824-9811-ae172d24e594/m_HPCKit_p_2023.1.0.44543.dmg - MACOS_FORTRAN_COMPONENTS: all - FC: ${{ matrix.fc }} - CC: ${{ matrix.cc }} - CXX: ${{ matrix.cxx }} - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python 3.x - uses: actions/setup-python@v5 - with: - python-version: 3.x - - - name: Prepare for cache restore (OSX) - if: contains(matrix.os, 'macos') - run: | - sudo mkdir -p /opt/intel - sudo chown $USER /opt/intel - - - name: Cache Intel install (OSX) - if: contains(matrix.os, 'macos') - id: cache-install - uses: actions/cache@v2 - with: - path: /opt/intel/oneapi - key: install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }} - - - name: Install Intel oneAPI compiler (OSX) - if: contains(matrix.os, 'macos') && steps.cache-install.outputs.cache-hit != 'true' - run: | - curl --output webimage.dmg --url "$URL" --retry 5 --retry-delay 5 - hdiutil attach webimage.dmg - if [ -z "$COMPONENTS" ]; then - sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --eula=accept --continue-with-optional-error=yes --log-dir=. - installer_exit_code=$? - else - sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$COMPONENTS" --eula=accept --continue-with-optional-error=yes --log-dir=. - installer_exit_code=$? - fi - hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet - exit $installer_exit_code - env: - URL: ${{ env.MACOS_HPCKIT_URL }} - COMPONENTS: ${{ env.MACOS_FORTRAN_COMPONENTS }} - - - name: Setup Intel oneAPI environment - run: | - source /opt/intel/oneapi/setvars.sh - printenv >> $GITHUB_ENV - - - name: Install fypp - run: pip install --upgrade fypp - - - name: Configure with CMake - run: >- - cmake -Wdev - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_MAXIMUM_RANK:String=4 - -DCMAKE_INSTALL_PREFIX=$PWD/_dist - -S . -B build - - - name: Build and compile - run: cmake --build build - - - name: catch build fail - run: cmake --build build --verbose --parallel 1 - if: failure() - - - name: test - run: ctest --parallel --output-on-failure --no-tests=error - working-directory: build - - - name: Install project - run: cmake --install build From 640c1278978e57285772d9068fec1130594b258b Mon Sep 17 00:00:00 2001 From: gnikit Date: Sun, 9 Jun 2024 15:58:25 +0100 Subject: [PATCH 3/4] ci: disable gcc-13 on macos-12 --- .github/workflows/CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 637c2eddb..bc5495c0a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -36,6 +36,8 @@ jobs: exclude: - os: macos-12 toolchain: {compiler: intel, version: '2024.1'} + - os: macos-12 + toolchain: {compiler: gcc, version: 13} env: BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }} From 41d734aab0f34bd2635e72ffc645992c33786f4a Mon Sep 17 00:00:00 2001 From: gnikit Date: Sun, 9 Jun 2024 15:58:41 +0100 Subject: [PATCH 4/4] ci: switch generator to Ninja --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bc5495c0a..6988259d3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -51,7 +51,7 @@ jobs: python-version: 3.x - name: Install fypp - run: pip install --upgrade fypp + run: pip install --upgrade fypp ninja - name: Setup Fortran compiler uses: fortran-lang/setup-fortran@v1.6.1 @@ -63,7 +63,7 @@ jobs: - name: Configure with CMake if: ${{ contains(matrix.build, 'cmake') }} run: >- - cmake -Wdev + cmake -Wdev -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAXIMUM_RANK:String=4 -DCMAKE_INSTALL_PREFIX=$PWD/_dist