Skip to content

Add Intel compiler workflow for OSX #367

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
Apr 23, 2021
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
45 changes: 42 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-latest, macos-latest]
fc: [ifort]
env:
MACOS_HPCKIT_URL: >-
https://registrationcenter-download.intel.com/akdlm/irc_nas/17398/m_HPCKit_p_2021.1.0.2681_offline.dmg
MACOS_FORTRAN_COMPONENTS: >-
intel.oneapi.mac.ifort-compiler
FC: ${{ matrix.fc }}

steps:
Expand All @@ -117,7 +121,21 @@ jobs:
if: contains(matrix.os, 'ubuntu')
run: ci/install_cmake.sh

- name: Add Intel repository
- 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: Add Intel repository (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
Expand All @@ -126,10 +144,31 @@ jobs:
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
- name: Install Intel oneAPI compiler (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get install intel-oneapi-compiler-fortran

- 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

Expand Down
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
endif()
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
add_compile_options(-warn declarations,general,usage,interfaces,unused)
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 Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ GCC Fortran | 8 | Windows Server 2019 | x86_64
GCC Fortran (MSYS) | 10 | Windows Server 2019 | x86_64
GCC Fortran (MinGW) | 10 | Windows Server 2019 | x86_64, i686
Intel oneAPI classic | 2021.1 | Ubuntu 20.04 | x86_64
Intel oneAPI classic | 2021.1 | MacOS Catalina 10.15 | x86_64

The following combinations are known to work, but they are not tested in the CI:

Expand Down