diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index eeac03544..587fb5762 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -85,3 +85,59 @@ jobs: make -f Makefile.manual FYPPFLAGS="-DMAXRANK=4" make -f Makefile.manual test make -f Makefile.manual clean + + intel-build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04] + fc: [ifort] + env: + FC: ${{ matrix.fc }} + + steps: + - name: Checkout code + uses: actions/checkout@v1 + + - name: Set up Python 3.x + uses: actions/setup-python@v1 + with: + python-version: 3.x + + - name: Install CMake Linux + if: contains(matrix.os, 'ubuntu') + run: ci/install_cmake.sh + + - name: Add Intel repository + if: contains(matrix.os, 'ubuntu') + run: | + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + echo "deb 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 + if: contains(matrix.os, 'ubuntu') + run: | + sudo apt-get install intel-oneapi-ifort + 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=4 -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 + working-directory: build diff --git a/CMakeLists.txt b/CMakeLists.txt index 6143b5ab5..d62689913 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,9 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU) endif() elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) add_compile_options(-warn declarations,general,usage,interfaces,unused) - add_compile_options(-standard-semantics) + if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_EQUAL 20.2.1.20200827) + add_compile_options(-standard-semantics) + endif() if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0) add_compile_options(-stand f15) else() @@ -35,7 +37,7 @@ endif() # --- compiler feature checks include(CheckFortranSourceCompiles) include(CheckFortranSourceRuns) -check_fortran_source_compiles("error stop i; end" f18errorstop SRC_EXT f90) +check_fortran_source_runs("i=0; error stop i; end" f18errorstop SRC_EXT f90) check_fortran_source_compiles("real, allocatable :: array(:, :, :, :, :, :, :, :, :, :); end" f03rank SRC_EXT f90) check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128)