Fixes that appear necessary for some compilers. #332
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| # Controls when the action will run | |
| on: | |
| # Trigger the workflow on all pushes, except on tag creation | |
| push: | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| - '**' | |
| # Trigger the workflow on all pull requests | |
| pull_request: ~ | |
| # Allow workflow to be dispatched on demand | |
| workflow_dispatch: ~ | |
| env: | |
| FIAT_TOOLS: ${{ github.workspace }}/.github/tools | |
| CTEST_PARALLEL_LEVEL: 1 | |
| CACHE_SUFFIX: v2 # Increase to force new cache to be created | |
| jobs: | |
| ci: | |
| name: ci | |
| strategy: | |
| fail-fast: false # false: try to complete all jobs | |
| matrix: | |
| build_type: [Release,Debug] | |
| name: | |
| - linux gnu-10 | |
| - linux gnu-12 | |
| - linux gnu-14 | |
| - linux clang-18 | |
| - linux intel | |
| - linux intel-classic | |
| - linux nvhpc-25.1 | |
| - macos | |
| include: | |
| - name: linux gnu-10 | |
| os: ubuntu-22.04 | |
| compiler: gnu-10 | |
| compiler_cc: gcc-10 | |
| compiler_cxx: g++-10 | |
| compiler_fc: gfortran-10 | |
| caching: true | |
| coverage: false | |
| - name: linux gnu-12 | |
| os: ubuntu-22.04 | |
| compiler: gnu-10 | |
| compiler_cc: gcc-10 | |
| compiler_cxx: g++-10 | |
| compiler_fc: gfortran-10 | |
| caching: true | |
| coverage: true | |
| - name: linux gnu-14 | |
| os: ubuntu-24.04 | |
| compiler: gnu-14 | |
| compiler_cc: gcc-14 | |
| compiler_cxx: g++-14 | |
| compiler_fc: gfortran-14 | |
| caching: true | |
| coverage: false | |
| - name: linux clang-18 | |
| os: ubuntu-24.04 | |
| compiler: clang-18 | |
| compiler_cc: clang-18 | |
| compiler_cxx: clang++-18 | |
| compiler_fc: gfortran-14 | |
| caching: true | |
| coverage: false | |
| - name : linux intel | |
| os: ubuntu-24.04 | |
| compiler: intel | |
| compiler_cc: icx | |
| compiler_cxx: icpx | |
| compiler_fc: ifx | |
| caching: true | |
| coverage: false | |
| - name : linux intel-classic | |
| os: ubuntu-22.04 | |
| compiler: intel-classic | |
| compiler_cc: icc | |
| compiler_cxx: icpc | |
| compiler_fc: ifort | |
| caching: true | |
| coverage: false | |
| - name: linux nvhpc-25.1 | |
| os: ubuntu-24.04 | |
| compiler: nvhpc-25.1 | |
| compiler_cc: nvc | |
| compiler_cxx: nvc++ | |
| compiler_fc: nvfortran | |
| cmake_options: -DCMAKE_CXX_FLAGS=--diag_suppress177 | |
| caching: true | |
| coverage: false | |
| - name: macos | |
| # Xcode compiler requires empty environment variables, so we pass null (~) here | |
| os: macos-14 | |
| compiler: clang-15 | |
| compiler_cc: ~ | |
| compiler_cxx: ~ | |
| compiler_fc: gfortran-13 | |
| caching: true | |
| coverage: false | |
| cmake_options: -DMPI_SLOTS=4 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v2 | |
| - name: Environment | |
| run: | | |
| echo "DEPS_DIR=${{ runner.temp }}/deps" >> $GITHUB_ENV | |
| echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV | |
| echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV | |
| echo "FC=${{ matrix.compiler_fc }}" >> $GITHUB_ENV | |
| if [[ "${{ matrix.os }}" =~ macos ]]; then | |
| brew install ninja | |
| else | |
| sudo apt-get update | |
| sudo apt-get install ninja-build | |
| fi | |
| printenv | |
| - name: Free Disk Space (Ubuntu) | |
| # Free up disk space for nvhpc | |
| uses: jlumbroso/free-disk-space@main | |
| if: contains( matrix.compiler, 'nvhpc' ) | |
| continue-on-error: true | |
| with: | |
| # this might remove tools that are actually needed, | |
| # if set to "true" but frees about 6 GB | |
| tool-cache: false | |
| # all of these default to true, but feel free to set to | |
| # "false" if necessary for your workflow | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: false # takes too long | |
| docker-images: false # takes too long | |
| swap-storage: true | |
| - name: Retrieve cached dependencies | |
| if: matrix.caching | |
| id: deps-restore-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ env.DEPS_DIR }} | |
| key: deps-${{ matrix.os }}-${{ matrix.compiler }}-${{ env.CACHE_SUFFIX }} | |
| - name: Install NVHPC compiler | |
| if: contains( matrix.compiler, 'nvhpc' ) | |
| shell: bash -eux {0} | |
| run: | | |
| ${FIAT_TOOLS}/install-nvhpc.sh --prefix /opt/nvhpc --version 25.1 | |
| source /opt/nvhpc/env.sh | |
| echo "${NVHPC_DIR}/compilers/bin" >> $GITHUB_PATH | |
| echo "NVHPC_ROOT=${NVHPC_DIR}" >> $GITHUB_ENV | |
| [ -z ${MPI_HOME+x} ] || echo "MPI_HOME=${MPI_HOME}" >> $GITHUB_ENV | |
| echo "FIAT_TEST_IGNORE_MPI_OUTPUT=1" >> $GITHUB_ENV | |
| - name: Install Intel oneAPI compiler | |
| if: contains( matrix.compiler, 'intel' ) | |
| run: | | |
| ${FIAT_TOOLS}/install-intel-oneapi.sh | |
| source /opt/intel/oneapi/setvars.sh | |
| printenv >> $GITHUB_ENV | |
| echo "CACHE_SUFFIX=$CC-$($CC -dumpversion)" >> $GITHUB_ENV | |
| - name: Install MPI | |
| shell: bash -eux {0} | |
| run: | | |
| FCFLAGS=-fPIC CFLAGS=-fPIC FFLAGS=-fPIC ${FIAT_TOOLS}/install-mpi.sh --mpi openmpi --prefix ${DEPS_DIR}/openmpi | |
| if [[ "${{ matrix.os }}" =~ macos ]]; then | |
| echo "CACHE_SUFFIX=${CACHE_SUFFIX}-mpi_$(mpirun --version | head -1 | awk '{print $4}')" >> $GITHUB_ENV | |
| fi | |
| [ -f ${DEPS_DIR}/openmpi/env.sh ] && source ${DEPS_DIR}/openmpi/env.sh | |
| [ -z ${MPI_HOME+x} ] || echo "MPI_HOME=${MPI_HOME}" >> $GITHUB_ENV | |
| - name: Save cached dependencies | |
| # There seems to be a problem with cached NVHPC dependencies, leading to SIGILL perhaps due to slightly different architectures | |
| if: matrix.caching && matrix.build_type == 'Debug' | |
| id: deps-save-cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ env.DEPS_DIR }} | |
| key: ${{ steps.deps-restore-cache.outputs.cache-primary-key }} | |
| - name: Set Build & Test Environment | |
| run: | | |
| # Add mpirun to path for testing | |
| [ -z ${MPI_HOME+x} ] || echo "${MPI_HOME}/bin" >> $GITHUB_PATH | |
| - name: Build & Test | |
| id: build-test | |
| uses: ecmwf-actions/build-package@v2 | |
| with: | |
| self_coverage: ${{ matrix.coverage }} | |
| force_build: true | |
| cache_suffix: "${{ matrix.build_type }}-${{ env.CACHE_SUFFIX }}" | |
| recreate_cache: ${{ matrix.caching == false }} | |
| dependencies: | | |
| ecmwf/ecbuild | |
| ecmwf/eckit | |
| ecmwf/fckit | |
| dependency_branch: develop | |
| dependency_cmake_options: | | |
| ecmwf/eckit: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF -DENABLE_ECKIT_CMD=OFF -DENABLE_ECKIT_SQL=OFF -DENABLE_MPI=ON -DENABLE_OMP=OFF" | |
| ecmwf/fckit: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF" | |
| cmake_options: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_options }} -DENABLE_MPI=ON" | |
| ctest_options: "${{ matrix.ctest_options }}" | |
| # - name: Verify tools | |
| # run: | | |
| # export PATH=${{ steps.build-test.outputs.bin_path }}:$PATH | |
| # | |
| # echo "+ fiat --info" | |
| # fiat --info | |
| # - name: Codecov Upload | |
| # if: steps.build-test.outputs.coverage_file | |
| # uses: codecov/codecov-action@v2 | |
| # with: | |
| # files: ${{ steps.build-test.outputs.coverage_file }} |