Skip to content

Commit 646b405

Browse files
authored
fix failing macos tests (#6)
* info-on-mac * set mkl version explicitly * more debug on mac * fix variable typo for linux mkl version * only test on ubuntu * matrix * matrix * fix version selection * check both classic and new * verify dmg * check hpckit * check hpckit * restrict basekit versions * pass install_mkl and test mkl * set input in main action * set input in main action * set input in script * fix typo * change linker options * source env * export DYLD path for Mac * include explicit library path in linker * export mklroot in script * export mklroot to GH env * export mklroot to GH env * export mklroot in script * correct typo * another typo * debug env vars * debug env vars * debug env vars * debug env vars * debug env vars * debug env vars * debug env vars * debug env vars * typo and relative reference mklroot * debug mklroot path * debug mklroot path * typo * find include dir * find include dir * debug mac os dyld path * check all ubuntu * no mkl for gcc and nvidia-hpc * mkl lates * check compiler vars * mkl dir for macos * debug * debug * adapt test structure * remove double testing * conditional in bash * conditional in bash * conditional in bash * conditional in bash * typo * pass missing variable * test them all * test them all * check macos mkl path * set full library path in script * export DYLD in env * test them all * exclude mkl tests on windows * exclude mkl tests on windows * check for dyld * rename mkllib in gh env * shuffle version mapping for mac * export DYLD in script * shuffle mkl version numbers * find installed mkl version * try without mkl * try without mkl * find installed mkl version * find installed mkl version * shuffle mkl vs ifort version * find mkl for 2021.5 * skip mkl for 2021.5 macos and remove double export of dyld * less chatty, .5 exception * last changes? * test 2021.5 only * test them all * export dyld in action
1 parent 2b7dceb commit 646b405

File tree

8 files changed

+184
-32
lines changed

8 files changed

+184
-32
lines changed

Diff for: .github/actions/test-fc/action.yml

+16
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,22 @@ runs:
6565
}
6666
rm hw.exe
6767
68+
- name: Test compile Fortran (pwsh)
69+
working-directory: test
70+
if: ${{ (success() || failure()) && runner.os == 'Windows' }}
71+
shell: pwsh
72+
run: |
73+
${{ env.FC }} -o hw.exe hw.f90
74+
$output=$(& ".\hw.exe")
75+
if ($output -match "hello world") {
76+
write-output $output
77+
} else {
78+
write-output "unexpected output: $output"
79+
exit 1
80+
}
81+
rm hw.exe
82+
83+
6884
- name: Test compile Fortran (powershell)
6985
working-directory: test
7086
if: ${{ (success() || failure()) && runner.os == 'Windows' }}

Diff for: .github/actions/test-mkl/action.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test mkl
2+
description: Test installation of mkl libraries
3+
inputs:
4+
compiler:
5+
description: "Toolchain or compiler to install"
6+
required: true
7+
version:
8+
description: "Version of toolchain or compiler"
9+
required: true
10+
install_mkl:
11+
description: "If MKL should be installed along with the compiler"
12+
required: false
13+
default: "false"
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Test compile and link mkl (bash)
18+
working-directory: test
19+
shell: bash
20+
run: |
21+
if [[ "${{ inputs.compiler }}" =~ "intel" ]] && [[ "${{ inputs.install_mkl }}" == "true" ]] && ([[ "${{ inputs.version }}" != "2021.5" ]] && [[ "$runner.os" != "macOS" ]]); then
22+
if [ "$RUNNER_OS" == "macOS" ]; then
23+
export DYLD_LIBRARY_PATH="${{ env.MKLLIB }}:$DYLD_LIBRARY_PATH"
24+
fi
25+
linking="-L${{ env.MKLLIB }} -lmkl_intel_lp64 -lmkl_sequential -lmkl_core"
26+
# hello world with blas call program
27+
${{ env.FC }} $args $linking -o hw_mkl hw_mkl.f90
28+
output=$(./hw_mkl '2>&1')
29+
[[ "$output" == *"hello world 9.00000000000000"* ]] && echo "$output" || (echo "Unexpected Fortran program 'hw_mkl' output: $output"; exit 1)
30+
rm hw_mkl
31+
fi

Diff for: .github/compat/long_compat.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
runner,compiler,version,support
2+
macos-13,intel-classic,2021.5,✓runner,compiler,version,support
23
macos-11,gcc,10,✓
34
macos-11,gcc,11,✓
45
macos-11,gcc,12,✓

Diff for: .github/workflows/test.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Test
33
# Push and pull request run in assert mode.
44
# Schedule and dispatch run in report mode.
55
on:
6-
push:
7-
paths-ignore:
8-
- '**.md'
6+
# push:
7+
# paths-ignore:
8+
# - '**.md'
99
pull_request:
1010
branches:
1111
- main
@@ -71,6 +71,7 @@ jobs:
7171
with:
7272
compiler: ${{ matrix.toolchain.compiler }}
7373
version: ${{ matrix.toolchain.version }}
74+
install_mkl: true
7475

7576
- name: Test Fortran compiler
7677
if: steps.setup-fortran.outcome == 'success'
@@ -79,6 +80,14 @@ jobs:
7980
compiler: ${{ matrix.toolchain.compiler }}
8081
version: ${{ matrix.toolchain.version }}
8182

83+
- name: Test MKL libraries
84+
if: steps.setup-fortran.outcome == 'success' && runner.os != 'windows'
85+
uses: ./.github/actions/test-mkl
86+
with:
87+
compiler: ${{ matrix.toolchain.compiler }}
88+
version: ${{ matrix.toolchain.version }}
89+
install_mkl: true
90+
8291
- name: Test C compiler
8392
continue-on-error: true
8493
if: needs.options.outputs.mode == 'report' && steps.setup-fortran.outcome == 'success'

Diff for: README.md

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
- {compiler: gcc, version: 13}
3636
- {compiler: intel, version: '2023.2'}
3737
- {compiler: intel-classic, version: '2021.10'}
38+
- {compiler: intel-classic, version: '2021.10', install_mkl: 'true'}
3839
- {compiler: nvidia-hpc, version: '23.11'}
3940
include:
4041
- os: ubuntu-latest
@@ -68,6 +69,7 @@ jobs:
6869
- *intel-classic* (for `ifort`)
6970
- *nvidia-hpc* (for `nvfortran`)
7071
- *version*: Version of the compiler toolchain. See [runner compatibility](#runner-compatibility) charts below.
72+
- *install_mkl*: If MKL libraries should be installed alongsider the intel compiler. Defaults to `false`.
7173

7274

7375
## Outputs
@@ -112,6 +114,8 @@ Toolchain support varies across GitHub-hosted runner images.
112114

113115
**Note:** Intel's `ifx` compiler is not supported on macOS, so the `intel` option redirects to `intel-classic` (`ifort`).
114116

117+
**Note:** MKL libraries can only be installed for the Intel Fortran compiler, and only on linux and MacOS operating systems; with the exception of intel-classic 2021.5, for which no compatible library is available.
118+
115119
## License
116120

117121
Licensed under the Apache License, Version 2.0 (the “License”);

Diff for: action.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ inputs:
88
version:
99
description: "Version of toolchain or compiler"
1010
required: false
11+
install_mkl:
12+
description: "If MKL should be installed along with the compiler"
13+
required: false
14+
default: "false"
1115
outputs:
1216
fc:
1317
description: "Path to Fortran compiler"
@@ -50,6 +54,7 @@ runs:
5054
env:
5155
COMPILER: ${{ inputs.compiler }}
5256
VERSION: ${{ inputs.version }}
57+
INSTALL_MKL: ${{ inputs.install_mkl }}
5358
run: |
5459
action_path=$(echo '/${{ github.action_path }}' | sed -e 's/\\/\//g' -e 's/://')
5560
source "$action_path/setup-fortran.sh"
@@ -64,11 +69,11 @@ runs:
6469
;;
6570
intel-classic)
6671
version=${VERSION:-2023.2.0}
67-
install_intel $platform true
72+
install_intel $platform true ${{ inputs.install_mkl }}
6873
;;
6974
intel)
7075
version=${VERSION:-2023.2.0}
71-
install_intel $platform false
76+
install_intel $platform false ${{ inputs.install_mkl }}
7277
;;
7378
nvidia-hpc)
7479
version=${VERSION:-23.11}
@@ -133,6 +138,7 @@ runs:
133138
echo fc=$FC>>$GITHUB_OUTPUT
134139
echo cc=$CC>>$GITHUB_OUTPUT
135140
echo cxx=$CXX>>$GITHUB_OUTPUT
141+
echo MKLLIB=$MKLLIB>>$GITHUB_OUTPUT
136142
fi
137143
138144
# intel oneapi flag to indicate env has been activated

0 commit comments

Comments
 (0)