Skip to content

Commit 274bd69

Browse files
authored
Add Intel compiler workflow for OSX (#367)
- remove standard semantics for Intel builds
1 parent ac0f957 commit 274bd69

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

.github/workflows/CI.yml

+42-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,13 @@ jobs:
9999
strategy:
100100
fail-fast: false
101101
matrix:
102-
os: [ubuntu-20.04]
102+
os: [ubuntu-latest, macos-latest]
103103
fc: [ifort]
104104
env:
105+
MACOS_HPCKIT_URL: >-
106+
https://registrationcenter-download.intel.com/akdlm/irc_nas/17398/m_HPCKit_p_2021.1.0.2681_offline.dmg
107+
MACOS_FORTRAN_COMPONENTS: >-
108+
intel.oneapi.mac.ifort-compiler
105109
FC: ${{ matrix.fc }}
106110

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

120-
- name: Add Intel repository
124+
- name: Prepare for cache restore (OSX)
125+
if: contains(matrix.os, 'macos')
126+
run: |
127+
sudo mkdir -p /opt/intel
128+
sudo chown $USER /opt/intel
129+
130+
- name: Cache Intel install (OSX)
131+
if: contains(matrix.os, 'macos')
132+
id: cache-install
133+
uses: actions/cache@v2
134+
with:
135+
path: /opt/intel/oneapi
136+
key: install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }}
137+
138+
- name: Add Intel repository (Linux)
121139
if: contains(matrix.os, 'ubuntu')
122140
run: |
123141
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
@@ -126,10 +144,31 @@ jobs:
126144
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
127145
sudo apt-get update
128146
129-
- name: Install Intel oneAPI compiler
147+
- name: Install Intel oneAPI compiler (Linux)
130148
if: contains(matrix.os, 'ubuntu')
131149
run: |
132150
sudo apt-get install intel-oneapi-compiler-fortran
151+
152+
- name: Install Intel oneAPI compiler (OSX)
153+
if: contains(matrix.os, 'macos') && steps.cache-install.outputs.cache-hit != 'true'
154+
run: |
155+
curl --output webimage.dmg --url "$URL" --retry 5 --retry-delay 5
156+
hdiutil attach webimage.dmg
157+
if [ -z "$COMPONENTS" ]; then
158+
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --eula=accept --continue-with-optional-error=yes --log-dir=.
159+
installer_exit_code=$?
160+
else
161+
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$COMPONENTS" --eula=accept --continue-with-optional-error=yes --log-dir=.
162+
installer_exit_code=$?
163+
fi
164+
hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet
165+
exit $installer_exit_code
166+
env:
167+
URL: ${{ env.MACOS_HPCKIT_URL }}
168+
COMPONENTS: ${{ env.MACOS_FORTRAN_COMPONENTS }}
169+
170+
- name: Setup Intel oneAPI environment
171+
run: |
133172
source /opt/intel/oneapi/setvars.sh
134173
printenv >> $GITHUB_ENV
135174

CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
3232
endif()
3333
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
3434
add_compile_options(-warn declarations,general,usage,interfaces,unused)
35-
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_EQUAL 20.2.1.20200827)
36-
add_compile_options(-standard-semantics)
37-
endif()
3835
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
3936
add_compile_options(-stand f15)
4037
else()

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ GCC Fortran | 8 | Windows Server 2019 | x86_64
9393
GCC Fortran (MSYS) | 10 | Windows Server 2019 | x86_64
9494
GCC Fortran (MinGW) | 10 | Windows Server 2019 | x86_64, i686
9595
Intel oneAPI classic | 2021.1 | Ubuntu 20.04 | x86_64
96+
Intel oneAPI classic | 2021.1 | MacOS Catalina 10.15 | x86_64
9697

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

0 commit comments

Comments
 (0)