Skip to content

Add CI testing with Intel Fortran compiler #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)

Expand Down