From 56f36a109142bdebe9b2d42d82e739cf0b941b5b Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 13 Sep 2023 14:09:58 +0200 Subject: [PATCH 01/17] install intel mkl libraries in addition to the compiler (#1) * also install intel mkl libraries in apt * trigger checks * trigger checks --- setup-fortran.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-fortran.sh b/setup-fortran.sh index 7f9cc15..c4112e9 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -287,7 +287,7 @@ install_intel_apt() sudo apt-get update sudo apt-get install \ - intel-oneapi-compiler-{fortran,dpcpp-cpp-and-cpp-classic}-$version + intel-oneapi-compiler-{fortran,dpcpp-cpp-and-cpp-classic}-$version intel-oneapi-mkl source /opt/intel/oneapi/setvars.sh export_intel_vars From adbf96a618f236f6555aa1f8c48ca5b8ea5b7b59 Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 13 Sep 2023 14:11:56 +0200 Subject: [PATCH 02/17] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index b6fc225..4e107f2 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -name: "Setup Fortran" +name: "Setup Fortran and libraries" description: "Setup Fortran compiler and toolchain" inputs: compiler: From f731ad700f1a7cf1af16d9041421fe7aa28182e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 21:41:18 +0200 Subject: [PATCH 03/17] Update compatibility matrix (#3) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- README.md | 18 +++++++++--------- compat.csv | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 27942b5..fe28fca 100644 --- a/README.md +++ b/README.md @@ -85,15 +85,15 @@ These are made available to subsequent workflow steps via the [`GITHUB_ENV` envi Support for the GCC toolchain varies across GitHub-hosted runner images. -| runner | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -|:-------------|:--------|:--------|:--------|:--------|:--------|:--------|:--------| -| macos-11 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| macos-12 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| macos-13 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| ubuntu-20.04 | | ✓ | ✓ | ✓ | ✓ | ✓ | | -| ubuntu-22.04 | | | | ✓ | ✓ | ✓ | ✓ | -| windows-2019 | | | ✓ | ✓ | ✓ | ✓ | ✓ | -| windows-2022 | | | ✓ | ✓ | ✓ | ✓ | ✓ | +| runner | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | +|:-------------|:--------|:--------|:--------|:--------|:--------|:--------|:--------|:--------| +| macos-11 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| macos-12 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| macos-13 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| ubuntu-20.04 | | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | +| ubuntu-22.04 | | | | ✓ | ✓ | ✓ | ✓ | ✓ | +| windows-2019 | | | ✓ | ✓ | ✓ | ✓ | ✓ | | +| windows-2022 | | | ✓ | ✓ | ✓ | ✓ | ✓ | | **Note:** version 13 of the GNU toolchain is not yet available on Windows. diff --git a/compat.csv b/compat.csv index 5c6431d..0a9f945 100644 --- a/compat.csv +++ b/compat.csv @@ -1,8 +1,8 @@ -runner,6,7,8,9,10,11,12 -macos-11,✓,✓,✓,✓,✓,✓,✓ -macos-12,✓,✓,✓,✓,✓,✓,✓ -macos-13,✓,✓,✓,✓,✓,✓,✓ -ubuntu-20.04,,✓,✓,✓,✓,✓, -ubuntu-22.04,,,,✓,✓,✓,✓ -windows-2019,,,✓,✓,✓,✓,✓ -windows-2022,,,✓,✓,✓,✓,✓ +runner,6,7,8,9,10,11,12,13 +macos-11,✓,✓,✓,✓,✓,✓,✓,✓ +macos-12,✓,✓,✓,✓,✓,✓,✓,✓ +macos-13,✓,✓,✓,✓,✓,✓,✓,✓ +ubuntu-20.04,,✓,✓,✓,✓,✓,,✓ +ubuntu-22.04,,,,✓,✓,✓,✓,✓ +windows-2019,,,✓,✓,✓,✓,✓, +windows-2022,,,✓,✓,✓,✓,✓, From 687069dfdbd2fb465f2eccf69321698324f66541 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 21:41:40 +0200 Subject: [PATCH 04/17] Update compatibility matrix (#2) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> From 81c48476a1412dee8854bb7b27b2c5c8b6a7431d Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Thu, 14 Sep 2023 21:42:15 +0200 Subject: [PATCH 05/17] V0 (#4) * add version number to apt mkl install * hpc basekit for macos --- setup-fortran.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/setup-fortran.sh b/setup-fortran.sh index c4112e9..12dc9aa 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -287,7 +287,7 @@ install_intel_apt() sudo apt-get update sudo apt-get install \ - intel-oneapi-compiler-{fortran,dpcpp-cpp-and-cpp-classic}-$version intel-oneapi-mkl + intel-oneapi-compiler-{fortran,dpcpp-cpp-and-cpp-classic}-$version intel-oneapi-mkl-$version source /opt/intel/oneapi/setvars.sh export_intel_vars @@ -358,6 +358,17 @@ install_intel_dmg() ;; esac + require_fetch + $fetch $MACOS_BASEKIT_URL > m_BASEKit.dmg + hdiutil attach m_BASEKit.dmg + sudo /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ + --action install \ + --eula=accept \ + --continue-with-optional-error=yes \ + --log-dir=. + hdiutil detach /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)" -quiet + rm m_BASEKit.dmg + require_fetch $fetch $MACOS_HPCKIT_URL > m_HPCKit.dmg hdiutil attach m_HPCKit.dmg From 646b4050ba0e8e30372c6597606f817da2a3c619 Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Thu, 7 Mar 2024 10:12:36 +0100 Subject: [PATCH 06/17] 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 --- .github/actions/test-fc/action.yml | 16 ++++ .github/actions/test-mkl/action.yml | 31 +++++++ .github/compat/long_compat.csv | 1 + .github/workflows/test.yml | 15 +++- README.md | 4 + action.yml | 10 ++- setup-fortran.sh | 126 ++++++++++++++++++++++------ test/hw_mkl.f90 | 13 +++ 8 files changed, 184 insertions(+), 32 deletions(-) create mode 100644 .github/actions/test-mkl/action.yml create mode 100644 test/hw_mkl.f90 diff --git a/.github/actions/test-fc/action.yml b/.github/actions/test-fc/action.yml index 6c1a596..dec0116 100644 --- a/.github/actions/test-fc/action.yml +++ b/.github/actions/test-fc/action.yml @@ -65,6 +65,22 @@ runs: } rm hw.exe + - name: Test compile Fortran (pwsh) + working-directory: test + if: ${{ (success() || failure()) && runner.os == 'Windows' }} + shell: pwsh + run: | + ${{ env.FC }} -o hw.exe hw.f90 + $output=$(& ".\hw.exe") + if ($output -match "hello world") { + write-output $output + } else { + write-output "unexpected output: $output" + exit 1 + } + rm hw.exe + + - name: Test compile Fortran (powershell) working-directory: test if: ${{ (success() || failure()) && runner.os == 'Windows' }} diff --git a/.github/actions/test-mkl/action.yml b/.github/actions/test-mkl/action.yml new file mode 100644 index 0000000..6016979 --- /dev/null +++ b/.github/actions/test-mkl/action.yml @@ -0,0 +1,31 @@ +name: Test mkl +description: Test installation of mkl libraries +inputs: + compiler: + description: "Toolchain or compiler to install" + required: true + version: + description: "Version of toolchain or compiler" + required: true + install_mkl: + description: "If MKL should be installed along with the compiler" + required: false + default: "false" +runs: + using: "composite" + steps: + - name: Test compile and link mkl (bash) + working-directory: test + shell: bash + run: | + if [[ "${{ inputs.compiler }}" =~ "intel" ]] && [[ "${{ inputs.install_mkl }}" == "true" ]] && ([[ "${{ inputs.version }}" != "2021.5" ]] && [[ "$runner.os" != "macOS" ]]); then + if [ "$RUNNER_OS" == "macOS" ]; then + export DYLD_LIBRARY_PATH="${{ env.MKLLIB }}:$DYLD_LIBRARY_PATH" + fi + linking="-L${{ env.MKLLIB }} -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" + # hello world with blas call program + ${{ env.FC }} $args $linking -o hw_mkl hw_mkl.f90 + output=$(./hw_mkl '2>&1') + [[ "$output" == *"hello world 9.00000000000000"* ]] && echo "$output" || (echo "Unexpected Fortran program 'hw_mkl' output: $output"; exit 1) + rm hw_mkl + fi \ No newline at end of file diff --git a/.github/compat/long_compat.csv b/.github/compat/long_compat.csv index 9311353..b06299d 100644 --- a/.github/compat/long_compat.csv +++ b/.github/compat/long_compat.csv @@ -1,4 +1,5 @@ runner,compiler,version,support +macos-13,intel-classic,2021.5,✓runner,compiler,version,support macos-11,gcc,10,✓ macos-11,gcc,11,✓ macos-11,gcc,12,✓ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24d806a..ba9cef6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,9 +3,9 @@ name: Test # Push and pull request run in assert mode. # Schedule and dispatch run in report mode. on: - push: - paths-ignore: - - '**.md' + # push: + # paths-ignore: + # - '**.md' pull_request: branches: - main @@ -71,6 +71,7 @@ jobs: with: compiler: ${{ matrix.toolchain.compiler }} version: ${{ matrix.toolchain.version }} + install_mkl: true - name: Test Fortran compiler if: steps.setup-fortran.outcome == 'success' @@ -79,6 +80,14 @@ jobs: compiler: ${{ matrix.toolchain.compiler }} version: ${{ matrix.toolchain.version }} + - name: Test MKL libraries + if: steps.setup-fortran.outcome == 'success' && runner.os != 'windows' + uses: ./.github/actions/test-mkl + with: + compiler: ${{ matrix.toolchain.compiler }} + version: ${{ matrix.toolchain.version }} + install_mkl: true + - name: Test C compiler continue-on-error: true if: needs.options.outputs.mode == 'report' && steps.setup-fortran.outcome == 'success' diff --git a/README.md b/README.md index afbb2e6..a6973a3 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ jobs: - {compiler: gcc, version: 13} - {compiler: intel, version: '2023.2'} - {compiler: intel-classic, version: '2021.10'} + - {compiler: intel-classic, version: '2021.10', install_mkl: 'true'} - {compiler: nvidia-hpc, version: '23.11'} include: - os: ubuntu-latest @@ -68,6 +69,7 @@ jobs: - *intel-classic* (for `ifort`) - *nvidia-hpc* (for `nvfortran`) - *version*: Version of the compiler toolchain. See [runner compatibility](#runner-compatibility) charts below. +- *install_mkl*: If MKL libraries should be installed alongsider the intel compiler. Defaults to `false`. ## Outputs @@ -112,6 +114,8 @@ Toolchain support varies across GitHub-hosted runner images. **Note:** Intel's `ifx` compiler is not supported on macOS, so the `intel` option redirects to `intel-classic` (`ifort`). +**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. + ## License Licensed under the Apache License, Version 2.0 (the “License”); diff --git a/action.yml b/action.yml index ab9a212..99bcbaa 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,10 @@ inputs: version: description: "Version of toolchain or compiler" required: false + install_mkl: + description: "If MKL should be installed along with the compiler" + required: false + default: "false" outputs: fc: description: "Path to Fortran compiler" @@ -50,6 +54,7 @@ runs: env: COMPILER: ${{ inputs.compiler }} VERSION: ${{ inputs.version }} + INSTALL_MKL: ${{ inputs.install_mkl }} run: | action_path=$(echo '/${{ github.action_path }}' | sed -e 's/\\/\//g' -e 's/://') source "$action_path/setup-fortran.sh" @@ -64,11 +69,11 @@ runs: ;; intel-classic) version=${VERSION:-2023.2.0} - install_intel $platform true + install_intel $platform true ${{ inputs.install_mkl }} ;; intel) version=${VERSION:-2023.2.0} - install_intel $platform false + install_intel $platform false ${{ inputs.install_mkl }} ;; nvidia-hpc) version=${VERSION:-23.11} @@ -133,6 +138,7 @@ runs: echo fc=$FC>>$GITHUB_OUTPUT echo cc=$CC>>$GITHUB_OUTPUT echo cxx=$CXX>>$GITHUB_OUTPUT + echo MKLLIB=$MKLLIB>>$GITHUB_OUTPUT fi # intel oneapi flag to indicate env has been activated diff --git a/setup-fortran.sh b/setup-fortran.sh index a5b25fc..155e2c9 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -178,6 +178,8 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH LIBRARY_PATH=$LIBRARY_PATH INFOPATH=$INFOPATH MANPATH=$MANPATH +MKLLIB=$MKLLIB +DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH ONEAPI_ROOT=$ONEAPI_ROOT CLASSPATH=$CLASSPATH CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH @@ -247,6 +249,19 @@ intel_version_map_l() fi } +mkl_version_map_l() +{ + local intel_version=$1 + case $intel_version in + 2021.1 | 2021.1.2) + mkl_version=2021.1.1 + ;; + *) + mkl_version=$intel_version + ;; + esac +} + intel_version_map_m() { local actual_version=$1 @@ -281,6 +296,25 @@ intel_version_map_m() esac } +mkl_version_map_m() +{ + local intel_version=$1 + case $intel_version in + 2021.1.0 | 2021.2.0 | 2021.3.0 | 2021.4.0 | 2022.2.0 | 2022.3.0 | 2022.3.1 | 2023.0.0 ) + mkl_version=2022.2.0 + ;; + 2022.1.0) + mkl_version="" + ;; + 2023.1.0) + mkl_version=2023.1.0 + ;; + *) + mkl_version=2023.2.0 + ;; + esac +} + intel_version_map_w() { local actual_version=$1 @@ -328,7 +362,10 @@ install_intel_apt() { local version=$1 local classic=$2 + local mkl_version=$1 + local install_mkl=$3 intel_version_map_l $version $classic + mkl_version_map_l $version require_fetch local _KEY="GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB" @@ -339,11 +376,16 @@ install_intel_apt() | sudo tee /etc/apt/sources.list.d/oneAPI.list sudo apt-get update - sudo apt-get install \ - intel-oneapi-compiler-{fortran,dpcpp-cpp-and-cpp-classic}-$version intel-oneapi-mkl-$version + if $install_mkl; then + sudo apt-get install \ + intel-oneapi-compiler-{fortran,dpcpp-cpp-and-cpp-classic}-$version \ + intel-oneapi-mkl-$mkl_version + else + sudo apt-get install \ + intel-oneapi-compiler-{fortran,dpcpp-cpp-and-cpp-classic}-$version + fi source /opt/intel/oneapi/setvars.sh - export_intel_vars if $classic; then export FC="ifort" @@ -354,56 +396,52 @@ install_intel_apt() export CC="icx" export CXX="icpx" fi + if $install_mkl; then + export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib/intel64" + fi + export_intel_vars } install_intel_dmg() { local version=$1 + local mkl_version=$1 + local install_mkl=$2 intel_version_map_m $version + mkl_version_map_m $version case $version in 2021.1.0) - MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17426/m_BaseKit_p_2021.1.0.2427.dmg MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17398/m_HPCKit_p_2021.1.0.2681.dmg ;; 2021.2.0) - MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17714/m_BaseKit_p_2021.2.0.2855.dmg MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17643/m_HPCKit_p_2021.2.0.2903.dmg ;; 2021.3.0) - MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17969/m_BaseKit_p_2021.3.0.3043.dmg MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17890/m_HPCKit_p_2021.3.0.3226.dmg ;; 2021.4.0) - MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18256/m_BaseKit_p_2021.4.0.3384.dmg MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18242/m_HPCKit_p_2021.4.0.3389.dmg ;; 2022.1.0) - MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18342/m_BaseKit_p_2022.1.0.92.dmg MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18341/m_HPCKit_p_2022.1.0.86.dmg ;; 2022.2.0) - MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18675/m_BaseKit_p_2022.2.0.226_offline.dmg MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18681/m_HPCKit_p_2022.2.0.158_offline.dmg ;; 2022.3.0) - MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18865/m_BaseKit_p_2022.3.0.8743.dmg MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18866/m_HPCKit_p_2022.3.0.8685.dmg ;; 2022.3.1) - MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18971/m_BaseKit_p_2022.3.1.17244.dmg MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18977/m_HPCKit_p_2022.3.1.15344.dmg ;; 2023.0.0) - MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/19080/m_BaseKit_p_2023.0.0.25441.dmg MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/19086/m_HPCKit_p_2023.0.0.25440.dmg ;; 2023.1.0) - MACOS_BASEKIT_URL=https:/registrationcenter-download.intel.com/akdlm/IRC_NAS/2516a0a0-de4d-4f3d-9e83-545b32127dbb/m_BaseKit_p_2023.1.0.45568.dmg MACOS_HPCKIT_URL=https:/registrationcenter-download.intel.com/akdlm/IRC_NAS/a99cb1c5-5af6-4824-9811-ae172d24e594/m_HPCKit_p_2023.1.0.44543.dmg ;; 2023.2.0) - MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/cd013e6c-49c4-488b-8b86-25df6693a9b7/m_BaseKit_p_2023.2.0.49398.dmg MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/edb4dc2f-266f-47f2-8d56-21bc7764e119/m_HPCKit_p_2023.2.0.49443.dmg ;; *) @@ -411,19 +449,46 @@ install_intel_dmg() ;; esac - require_fetch - $fetch $MACOS_BASEKIT_URL > m_BASEKit.dmg - hdiutil attach m_BASEKit.dmg - sudo /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ - --action install \ - --eula=accept \ - --continue-with-optional-error=yes \ - --log-dir=. - hdiutil detach /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)" -quiet - rm m_BASEKit.dmg + case $mkl_version in + 2022.2.0) + MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18675/m_BaseKit_p_2022.2.0.226_offline.dmg + ;; + 2023.1.0) + MACOS_BASEKIT_URL=https:/registrationcenter-download.intel.com/akdlm/IRC_NAS/2516a0a0-de4d-4f3d-9e83-545b32127dbb/m_BaseKit_p_2023.1.0.45568.dmg + ;; + 2023.2.0) + MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/cd013e6c-49c4-488b-8b86-25df6693a9b7/m_BaseKit_p_2023.2.0.49398.dmg + ;; + "") + ;; + *) + exit 1 + ;; + esac + + if $install_mkl; then + if [ "$MACOS_BASEKIT_URL" == "" ]; then + echo "ERROR: MACOS_BASEKIT_URL is empty - please check the version mapping for MKL" + echo "SKIPPING MKL installation..." + else + require_fetch + $fetch $MACOS_BASEKIT_URL > m_BASEKit.dmg + ls -lh + hdiutil verify m_BASEKit.dmg + hdiutil attach m_BASEKit.dmg + sudo /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ + --action install \ + --eula=accept \ + --continue-with-optional-error=yes \ + --log-dir=. + hdiutil detach /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)" -quiet + rm m_BASEKit.dmg + fi + fi require_fetch $fetch $MACOS_HPCKIT_URL > m_HPCKit.dmg + hdiutil verify m_HPCKit.dmg hdiutil attach m_HPCKit.dmg sudo /Volumes/"$(basename "$MACOS_HPCKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ --action install \ @@ -434,11 +499,17 @@ install_intel_dmg() rm m_HPCKit.dmg source /opt/intel/oneapi/setvars.sh - export_intel_vars export FC="ifort" export CC="icc" export CXX="icpc" + + if $install_mkl; then + export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib" + export DYLD_LIBRARY_PATH="$MKLLIB":$DYLD_LIBRARY_PATH + fi + + export_intel_vars } install_intel_win() @@ -501,12 +572,13 @@ install_intel() { local platform=$1 local classic=$2 + local install_mkl=$3 case $platform in linux*) - install_intel_apt $version $classic + install_intel_apt $version $classic $install_mkl ;; darwin*) - install_intel_dmg $version + install_intel_dmg $version $install_mkl ;; mingw*) install_intel_win $version $classic diff --git a/test/hw_mkl.f90 b/test/hw_mkl.f90 new file mode 100644 index 0000000..cc7445c --- /dev/null +++ b/test/hw_mkl.f90 @@ -0,0 +1,13 @@ +program hello + implicit none + double precision, dimension(3):: a, b + double precision:: c + double precision:: DDOT + + a = (/ 3.D0, 3.D0, 3.D0 /) + b = (/ 1.D0, 1.D0, 1.D0 /) + + c = DDOT(3, a, 1, b, 1) + + print *, "hello world", c +end program hello \ No newline at end of file From 3b77edb27f56fb303e6a54e9ca96a0c2ef952681 Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Mon, 11 Mar 2024 15:02:46 +0100 Subject: [PATCH 07/17] Check usage of marketplace action (#7) * correct passsing of include_mkl in example * don't source intel set vars * run setvars, set MKLLIB --- .github/actions/test-mkl/action.yml | 3 +++ .github/workflows/test.yml | 6 +++--- README.md | 6 ++++-- setup-fortran.sh | 5 ++++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/actions/test-mkl/action.yml b/.github/actions/test-mkl/action.yml index 6016979..7b25e50 100644 --- a/.github/actions/test-mkl/action.yml +++ b/.github/actions/test-mkl/action.yml @@ -20,6 +20,9 @@ runs: run: | if [[ "${{ inputs.compiler }}" =~ "intel" ]] && [[ "${{ inputs.install_mkl }}" == "true" ]] && ([[ "${{ inputs.version }}" != "2021.5" ]] && [[ "$runner.os" != "macOS" ]]); then if [ "$RUNNER_OS" == "macOS" ]; then + # required for macOS 11, intel-classic 2021.1-2021.10 + # required for macOS 12, intel-classic 2021.1, 2021.4, 2021.6, 2021.10 + # for all others, setting DYLD path through environment works correctly export DYLD_LIBRARY_PATH="${{ env.MKLLIB }}:$DYLD_LIBRARY_PATH" fi linking="-L${{ env.MKLLIB }} -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 778457f..e7e1e21 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,9 +3,9 @@ name: Test # Push and pull request run in assert mode. # Schedule and dispatch run in report mode. on: - # push: - # paths-ignore: - # - '**.md' + push: + paths-ignore: + - '**.md' pull_request: branches: - main diff --git a/README.md b/README.md index 685a432..6153578 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ jobs: - {compiler: gcc, version: 13} - {compiler: intel, version: '2023.2'} - {compiler: intel-classic, version: '2021.10'} - - {compiler: intel-classic, version: '2021.10', install_mkl: 'true'} + - {compiler: intel-classic, version: '2021.10'} - {compiler: nvidia-hpc, version: '23.11'} include: - os: ubuntu-latest @@ -49,11 +49,13 @@ jobs: toolchain: {compiler: nvidia-hpc, version: '23.11'} steps: - - uses: fortran-lang/setup-fortran@v1 + - uses: ssciwr/setup-fortran@v0.1 id: setup-fortran with: compiler: ${{ matrix.toolchain.compiler }} version: ${{ matrix.toolchain.version }} + install_mkl: "true" + - run: | ${{ env.FC }} ... # environment vars FC, CC, and CXX are set diff --git a/setup-fortran.sh b/setup-fortran.sh index dbf5fc9..4e290c1 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -183,6 +183,7 @@ LIBRARY_PATH=$LIBRARY_PATH INFOPATH=$INFOPATH MANPATH=$MANPATH MKLLIB=$MKLLIB +MKLROOT=$MKLROOT DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH ONEAPI_ROOT=$ONEAPI_ROOT CLASSPATH=$CLASSPATH @@ -402,6 +403,7 @@ install_intel_apt() fi if $install_mkl; then export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib/intel64" + export MKLROOT="$ONEAPI_ROOT/mkl/latest" fi export_intel_vars } @@ -510,6 +512,7 @@ install_intel_dmg() if $install_mkl; then export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib" + export MKLROOT="$ONEAPI_ROOT/mkl/latest" export DYLD_LIBRARY_PATH="$MKLLIB":$DYLD_LIBRARY_PATH fi @@ -684,4 +687,4 @@ install_nvidiahpc() exit 1 ;; esac -} \ No newline at end of file +} From 281d4951e3d850a1eb3b8a7134e8f58e03b99483 Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Thu, 14 Mar 2024 11:55:11 +0100 Subject: [PATCH 08/17] Sync fork (#8) * feat: set FPM environment variables (#63) * set FPM_FC/FPM_CC/FPM_CXX matching FC/CC/CXX * consolidate env var assignment in setup script * feat: support intel 2024.0 on linux and windows (#64) * fix(mac/gcc): always create unversioned gcc/g++/gfortran links (#65) * brew doesn't link gcc/g++ without version number like it does for gfortran * this was causing default mac gcc/g++ to be discovered on PATH * fix readme auto-update PR conditionals in reporting mode * Update compatibility matrix (#66) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * ci: don't trigger when tags are pushed (#67) * correct typo * fix variable name * pass cpp_name * pass cpp_name --------- Co-authored-by: wpbonelli Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/actions/test-cc/action.yml | 4 + .github/actions/test-cxx/action.yml | 4 + .github/actions/test-fc/action.yml | 4 + .github/compat/compat.csv | 21 +++--- .github/compat/long_compat.csv | 4 + .github/compat/matrix.yml | 1 + .github/workflows/test.yml | 8 +- README.md | 25 ++++--- action.yml | 61 +++++++-------- install-intel-windows.bat | 2 +- setup-fortran.sh | 111 +++++++++++++++------------- 11 files changed, 134 insertions(+), 111 deletions(-) diff --git a/.github/actions/test-cc/action.yml b/.github/actions/test-cc/action.yml index bb930ed..b6dceb7 100644 --- a/.github/actions/test-cc/action.yml +++ b/.github/actions/test-cc/action.yml @@ -14,6 +14,10 @@ runs: - name: Check compiler version shell: bash run: | + # check $CC == $FPM_CC + [[ "${{ env.CC }}" == "${{ env.FPM_CC }}" ]] && (echo "CC and FPM_CC match") || (echo "CC and FPM_CC don't match: ${{ env.CC }} != ${{ env.FPM_CC}}"; exit 1) + + # check compiler version if ([ "$RUNNER_OS" == "Windows" ] && [[ "${{ inputs.compiler }}" =~ "intel" ]] && [[ "${{ inputs.compiler }}" != "nvidia-hpc" ]]); then # only last line of output captured by command substitution, write to temp file instead ${{ env.CC }} //QV > "$RUNNER_TEMP/${{ env.CC }}.ver" 2>&1 diff --git a/.github/actions/test-cxx/action.yml b/.github/actions/test-cxx/action.yml index f7b3ae7..7e6c826 100644 --- a/.github/actions/test-cxx/action.yml +++ b/.github/actions/test-cxx/action.yml @@ -14,6 +14,10 @@ runs: - name: Check compiler version shell: bash run: | + # check $CXX == $FPM_CXX + [[ "${{ env.CXX }}" == "${{ env.FPM_CXX }}" ]] && (echo "CXX and FPM_CXX match") || (echo "CXX and FPM_CXX don't match: ${{ env.CXX }} != ${{ env.FPM_CXX}}"; exit 1) + + # check compiler version if ([ "$RUNNER_OS" == "Windows" ] && [[ "${{ matrix.toolchain.compiler }}" =~ "intel" ]] && [[ "${{ matrix.toolchain.compiler }}" != "nvidia-hpc" ]]); then # only last line of output captured by command substitution, write to temp file instead ${{ env.CXX }} //QV > "$RUNNER_TEMP/${{ env.CXX }}.ver" 2>&1 diff --git a/.github/actions/test-fc/action.yml b/.github/actions/test-fc/action.yml index 25e6e12..dac2ee4 100644 --- a/.github/actions/test-fc/action.yml +++ b/.github/actions/test-fc/action.yml @@ -14,6 +14,10 @@ runs: - name: Check compiler version shell: bash run: | + # check $FC == $FPM_FC + [[ "${{ env.FC }}" == "${{ env.FPM_FC }}" ]] && (echo "FC and FPM_FC match") || (echo "FC and FPM_FC don't match: ${{ env.FC }} != ${{ env.FPM_FC}}"; exit 1) + + # check compiler version if ([ "$RUNNER_OS" == "Windows" ] && [[ "${{ inputs.compiler }}" =~ "intel" ]] && [[ "${{ inputs.compiler }}" != "nvidia-hpc" ]]); then # only last line of output captured by command substitution, write to temp file instead ${{ env.FC }} //QV > "$RUNNER_TEMP/${{ env.FC }}.ver" 2>&1 diff --git a/.github/compat/compat.csv b/.github/compat/compat.csv index 62c9e3d..5c8264f 100644 --- a/.github/compat/compat.csv +++ b/.github/compat/compat.csv @@ -1,11 +1,10 @@ -compiler,gcc,gcc,gcc,gcc,gcc,gcc,gcc,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel,intel,intel,intel,intel,intel,intel,intel,intel,intel,intel,nvidia-hpc,nvidia-hpc,nvidia-hpc,nvidia-hpc,nvidia-hpc,nvidia-hpc,nvidia-hpc,nvidia-hpc -version,10,11,12,13,7,8,9,2021.1,2021.10,2021.2,2021.3,2021.4,2021.5,2021.6,2021.7.1,2021.7,2021.8,2021.9,2021.1.2,2021.1.2,2021.1,2021.2,2021.4,2022.0,2022.1,2022.2.1,2022.2,2023.0,2023.1,2023.2,20.11,21.11,22.11,23.11,23.3,23.5,23.7,23.9 -runner,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -macos-11,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,,,,,,,,,,,,,,,,,,,, -macos-12,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,,,,,,,,,,,,,,,,,,,, -macos-13,✓,✓,✓,✓,,,,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,,,,,,,,,,,,,,,,,,,, -macos-14,,✓,✓,✓,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -ubuntu-20.04,✓,✓,,✓,✓,✓,✓,✓,✓,✓,,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓ -ubuntu-22.04,✓,✓,✓,✓,,,✓,✓,✓,✓,,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓ -windows-2019,✓,✓,✓,✓,,✓,✓,,✓,,,,,✓,,✓,✓,✓,,,,,,,✓,,✓,✓,✓,✓,,,,,,,, -windows-2022,✓,✓,✓,✓,,✓,✓,,✓,,,,,✓,,✓,✓,✓,,,,,,,✓,,✓,✓,✓,✓,,,,,,,, +compiler,gcc,gcc,gcc,gcc,gcc,gcc,gcc,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel,intel,intel,intel,intel,intel,intel,intel,intel,intel,intel,intel,nvidia-hpc,nvidia-hpc,nvidia-hpc,nvidia-hpc,nvidia-hpc,nvidia-hpc,nvidia-hpc,nvidia-hpc +version,10,11,12,13,7,8,9,2021.1,2021.10,2021.2,2021.3,2021.4,2021.5,2021.6,2021.7.1,2021.7,2021.8,2021.9,2021.1.2,2021.1.2,2021.1,2021.2,2021.4,2022.0,2022.1,2022.2.1,2022.2,2023.0,2023.1,2023.2,2024.0,20.11,21.11,22.11,23.11,23.3,23.5,23.7,23.9 +runner,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +macos-12,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,,,,,,,,,,,,,,,,,,,,, +macos-13,✓,✓,✓,✓,,,,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,,,,,,,,,,,,,,,,,,,,, +macos-14,,✓,✓,✓,,,,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,,,,,,,,,,,,,,,,,,,,, +ubuntu-20.04,✓,✓,,✓,✓,✓,✓,✓,✓,✓,,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓ +ubuntu-22.04,✓,✓,✓,✓,,,✓,✓,✓,✓,,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓,✓ +windows-2019,✓,✓,✓,✓,,✓,✓,,✓,,,,,✓,,✓,✓,✓,,,,,,,✓,,✓,✓,✓,✓,✓,,,,,,,, +windows-2022,✓,✓,✓,✓,,✓,✓,,✓,,,,,✓,,✓,✓,✓,,,,,,,✓,,✓,✓,✓,✓,✓,,,,,,,, diff --git a/.github/compat/long_compat.csv b/.github/compat/long_compat.csv index 7120963..fc29968 100644 --- a/.github/compat/long_compat.csv +++ b/.github/compat/long_compat.csv @@ -94,6 +94,7 @@ ubuntu-20.04,intel,2022.2,✓ ubuntu-20.04,intel,2023.0,✓ ubuntu-20.04,intel,2023.1,✓ ubuntu-20.04,intel,2023.2,✓ +ubuntu-20.04,intel,2024.0,✓ ubuntu-20.04,nvidia-hpc,20.11,✓ ubuntu-20.04,nvidia-hpc,20.7, ubuntu-20.04,nvidia-hpc,20.9, @@ -137,6 +138,7 @@ ubuntu-22.04,intel,2022.2,✓ ubuntu-22.04,intel,2023.0,✓ ubuntu-22.04,intel,2023.1,✓ ubuntu-22.04,intel,2023.2,✓ +ubuntu-22.04,intel,2024.0,✓ ubuntu-22.04,nvidia-hpc,20.11,✓ ubuntu-22.04,nvidia-hpc,20.7, ubuntu-22.04,nvidia-hpc,20.9, @@ -180,6 +182,7 @@ windows-2019,intel,2022.2,✓ windows-2019,intel,2023.0,✓ windows-2019,intel,2023.1,✓ windows-2019,intel,2023.2,✓ +windows-2019,intel,2024.0,✓ windows-2022,gcc,10,✓ windows-2022,gcc,11,✓ windows-2022,gcc,12,✓ @@ -211,3 +214,4 @@ windows-2022,intel,2022.2,✓ windows-2022,intel,2023.0,✓ windows-2022,intel,2023.1,✓ windows-2022,intel,2023.2,✓ +windows-2022,intel,2024.0,✓ diff --git a/.github/compat/matrix.yml b/.github/compat/matrix.yml index 6c6dcdf..c8a8ea8 100644 --- a/.github/compat/matrix.yml +++ b/.github/compat/matrix.yml @@ -14,6 +14,7 @@ toolchain: - {compiler: gcc, version: 9} - {compiler: gcc, version: 8} - {compiler: gcc, version: 7} + - {compiler: intel, version: '2024.0'} - {compiler: intel, version: '2023.2'} - {compiler: intel, version: '2023.1'} - {compiler: intel, version: '2023.0'} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e7e1e21..2e669aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,8 @@ on: push: paths-ignore: - '**.md' + tags-ignore: + - v** pull_request: branches: - main @@ -195,15 +197,15 @@ jobs: fi - name: Update README - if: ${{ steps.diff.outputs.diff == 'true' && github.event_name == 'push' }} + if: ${{ steps.diff.outputs.diff == 'true' }} run: python .github/compat/update_compat_table.py ".github/compat/compat.md" "README.md" - name: Print README diff - if: ${{ steps.diff.outputs.diff == 'true' && github.event_name == 'push' }} + if: ${{ steps.diff.outputs.diff == 'true' }} run: git diff README.md - name: Create pull request - if: ${{ steps.diff.outputs.diff == 'true' && github.event_name == 'push' }} + if: ${{ steps.diff.outputs.diff == 'true' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/README.md b/README.md index 6153578..9763bff 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,12 @@ The same values are also set as environment variables: - `CC` - `CXX` +Corresponding FPM environment variables are also set: + +- `FPM_FC` +- `FPM_CC` +- `FPM_CXX` + These are made available to subsequent workflow steps via the [`GITHUB_ENV` environment file mechanism](https://docs.github.com/en/actions/learn-github-actions/environment-variables#passing-values-between-steps-and-jobs-in-a-workflow). @@ -101,16 +107,15 @@ These are made available to subsequent workflow steps via the [`GITHUB_ENV` envi Toolchain support varies across GitHub-hosted runner images. -| runner | gcc 10 | gcc 11 | gcc 12 | gcc 13 | gcc 7 | gcc 8 | gcc 9 | intel-classic 2021.1 | intel-classic 2021.10 | intel-classic 2021.2 | intel-classic 2021.3 | intel-classic 2021.4 | intel-classic 2021.5 | intel-classic 2021.6 | intel-classic 2021.7.1 | intel-classic 2021.7 | intel-classic 2021.8 | intel-classic 2021.9 | intel-classic 2021.1.2 | intel 2021.1.2 | intel 2021.1 | intel 2021.2 | intel 2021.4 | intel 2022.0 | intel 2022.1 | intel 2022.2.1 | intel 2022.2 | intel 2023.0 | intel 2023.1 | intel 2023.2 | nvidia-hpc 20.11 | nvidia-hpc 21.11 | nvidia-hpc 22.11 | nvidia-hpc 23.11 | nvidia-hpc 23.3 | nvidia-hpc 23.5 | nvidia-hpc 23.7 | nvidia-hpc 23.9 | -|:-------------|:----------------|:----------------|:----------------|:----------------|:---------------|:---------------|:---------------|:------------------------------|:-------------------------------|:------------------------------|:------------------------------|:------------------------------|:------------------------------|:------------------------------|:--------------------------------|:------------------------------|:------------------------------|:------------------------------|:--------------------------------|:------------------------|:----------------------|:----------------------|:----------------------|:----------------------|:----------------------|:------------------------|:----------------------|:----------------------|:----------------------|:----------------------|:--------------------------|:--------------------------|:--------------------------|:--------------------------|:-------------------------|:-------------------------|:-------------------------|:-------------------------| -| macos-11 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | | | | | | | | | | | | | | -| macos-12 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | | | | | | | | | | | | | | -| macos-13 | ✓ | ✓ | ✓ | ✓ | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | | | | | | | | | | | | | | -| macos-14 | | ✓ | ✓ | ✓ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -| ubuntu-20.04 | ✓ | ✓ | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| ubuntu-22.04 | ✓ | ✓ | ✓ | ✓ | | | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| windows-2019 | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | ✓ | | | | | ✓ | | ✓ | ✓ | ✓ | | | | | | | ✓ | | ✓ | ✓ | ✓ | ✓ | | | | | | | | | -| windows-2022 | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | ✓ | | | | | ✓ | | ✓ | ✓ | ✓ | | | | | | | ✓ | | ✓ | ✓ | ✓ | ✓ | | | | | | | | | +| runner | gcc 10 | gcc 11 | gcc 12 | gcc 13 | gcc 7 | gcc 8 | gcc 9 | intel-classic 2021.1 | intel-classic 2021.10 | intel-classic 2021.2 | intel-classic 2021.3 | intel-classic 2021.4 | intel-classic 2021.5 | intel-classic 2021.6 | intel-classic 2021.7.1 | intel-classic 2021.7 | intel-classic 2021.8 | intel-classic 2021.9 | intel-classic 2021.1.2 | intel 2021.1.2 | intel 2021.1 | intel 2021.2 | intel 2021.4 | intel 2022.0 | intel 2022.1 | intel 2022.2.1 | intel 2022.2 | intel 2023.0 | intel 2023.1 | intel 2023.2 | intel 2024.0 | nvidia-hpc 20.11 | nvidia-hpc 21.11 | nvidia-hpc 22.11 | nvidia-hpc 23.11 | nvidia-hpc 23.3 | nvidia-hpc 23.5 | nvidia-hpc 23.7 | nvidia-hpc 23.9 | +|:-------------|:----------------|:----------------|:----------------|:----------------|:---------------|:---------------|:---------------|:------------------------------|:-------------------------------|:------------------------------|:------------------------------|:------------------------------|:------------------------------|:------------------------------|:--------------------------------|:------------------------------|:------------------------------|:------------------------------|:--------------------------------|:------------------------|:----------------------|:----------------------|:----------------------|:----------------------|:----------------------|:------------------------|:----------------------|:----------------------|:----------------------|:----------------------|:----------------------|:--------------------------|:--------------------------|:--------------------------|:--------------------------|:-------------------------|:-------------------------|:-------------------------|:-------------------------| +| macos-12 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | | | | | | | | | | | | | | | +| macos-13 | ✓ | ✓ | ✓ | ✓ | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | | | | | | | | | | | | | | | +| macos-14 | | ✓ | ✓ | ✓ | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | | | | | | | | | | | | | | | +| ubuntu-20.04 | ✓ | ✓ | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| ubuntu-22.04 | ✓ | ✓ | ✓ | ✓ | | | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| windows-2019 | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | ✓ | | | | | ✓ | | ✓ | ✓ | ✓ | | | | | | | ✓ | | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | | +| windows-2022 | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | ✓ | | | | | ✓ | | ✓ | ✓ | ✓ | | | | | | | ✓ | | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | | **Note:** Intel's `ifx` compiler is not supported on macOS, so the `intel` option redirects to `intel-classic` (`ifort`). diff --git a/action.yml b/action.yml index 99bcbaa..8c4bcc5 100644 --- a/action.yml +++ b/action.yml @@ -84,12 +84,9 @@ runs: ;; esac - if ! ([[ "$RUNNER_OS" == "Windows" ]] && [[ "${{ inputs.compiler }}" =~ "intel" ]]); then - # save environment variables - echo "FC=${FC}" >> $GITHUB_ENV - echo "CC=${CC}" >> $GITHUB_ENV - echo "CXX=${CXX}" >> $GITHUB_ENV - fi + echo "FC=${FC}" >> $GITHUB_ENV + echo "CC=${CC}" >> $GITHUB_ENV + echo "CXX=${CXX}" >> $GITHUB_ENV # save oneAPI cache and activate environment - name: Save cache @@ -108,43 +105,41 @@ runs: :: this script fails when install location is not the default call "%ONEAPI_ROOT%\compiler\%LATEST%\env\vars.bat" set | findstr /c:"oneAPI" >> "%GITHUB_ENV%" - # Intel compilers may have restored from cache so env vars may not be set, - # set them then set outputs for all compilers/toolchains + - name: Set outputs and env vars shell: bash id: outputs run: | + # Intel compilers may have restored from cache so env vars may not be set if [[ "$RUNNER_OS" == "Windows" ]]; then if [[ "${{ inputs.compiler }}" == "intel" ]]; then - echo fc=ifx>>$GITHUB_OUTPUT - echo cc=icx>>$GITHUB_OUTPUT - echo cxx=icx>>$GITHUB_OUTPUT - echo FC=ifx>>$GITHUB_ENV - echo CC=icx>>$GITHUB_ENV - echo CXX=icx>>$GITHUB_ENV + FC=ifx + CC=icx + CXX=icx + echo SETVARS_COMPLETED=1>>$GITHUB_ENV elif [[ "${{ inputs.compiler }}" == "intel-classic" ]]; then - echo fc=ifort>>$GITHUB_OUTPUT - echo cc=icl>>$GITHUB_OUTPUT - echo cxx=icl>>$GITHUB_OUTPUT - echo FC=ifort>>$GITHUB_ENV - echo CC=icl>>$GITHUB_ENV - echo CXX=icl>>$GITHUB_ENV - else - echo fc=$FC>>$GITHUB_OUTPUT - echo cc=$CC>>$GITHUB_OUTPUT - echo cxx=$CXX>>$GITHUB_OUTPUT + FC=ifort + CC=icl + CXX=icl + echo SETVARS_COMPLETED=1>>$GITHUB_ENV fi - else - echo fc=$FC>>$GITHUB_OUTPUT - echo cc=$CC>>$GITHUB_OUTPUT - echo cxx=$CXX>>$GITHUB_OUTPUT - echo MKLLIB=$MKLLIB>>$GITHUB_OUTPUT fi - # intel oneapi flag to indicate env has been activated - if [[ "${{ inputs.compiler }}" =~ "intel" ]]; then - echo SETVARS_COMPLETED=1>>$GITHUB_ENV - fi + # set env vars + echo FC=$FC>>$GITHUB_ENV + echo CC=$CC>>$GITHUB_ENV + echo CXX=$CXX>>$GITHUB_ENV + + # set fpm env vars + echo FPM_FC=$FC>>$GITHUB_ENV + echo FPM_CC=$CC>>$GITHUB_ENV + echo FPM_CXX=$CXX>>$GITHUB_ENV + + # set action outputs + echo fc=$FC>>$GITHUB_OUTPUT + echo cc=$CC>>$GITHUB_OUTPUT + echo cxx=$CXX>>$GITHUB_OUTPUT + # GitHub Actions prepends GNU linker to the PATH before all bash steps, hide it so MSVC linker is found - name: Hide GNU linker (Windows) if: runner.os == 'Windows' && contains(inputs.compiler, 'intel') diff --git a/install-intel-windows.bat b/install-intel-windows.bat index ba62671..8b85ddb 100644 --- a/install-intel-windows.bat +++ b/install-intel-windows.bat @@ -6,4 +6,4 @@ start /b /wait %TEMP%\webimage.exe -s -x -f %TEMP%\webimage_extracted --log %TEM del %TEMP%\webimage.exe :: run installer -%TEMP%\webimage_extracted\bootstrapper.exe -s --action install --components=intel.oneapi.win.cpp-compiler:intel.oneapi.win.ifort-compiler --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=%TEMP% +%TEMP%\webimage_extracted\bootstrapper.exe -s --action install --components=%2 --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=%TEMP% diff --git a/setup-fortran.sh b/setup-fortran.sh index 4e290c1..0564df7 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -46,23 +46,16 @@ install_gcc_brew() brew link gcc@${version} os_ver=$(sw_vers -productVersion | cut -d'.' -f1) - # brew link doesn't create aliases without version numbers before gcc 13 - if (( "$version" < 13 )); then - # default homebrew bin dir changed with macos 14 - if (( "$os_ver" > 13 )); then - ln -fs /opt/homebrew/bin/gfortran-${version} /usr/local/bin/gfortran - ln -fs /opt/homebrew/bin/gcc-${version} /usr/local/bin/gcc - ln -fs /opt/homebrew/bin/g++-${version} /usr/local/bin/g++ - else - ln -fs /usr/local/bin/gfortran-${version} /usr/local/bin/gfortran - ln -fs /usr/local/bin/gcc-${version} /usr/local/bin/gcc - ln -fs /usr/local/bin/g++-${version} /usr/local/bin/g++ - fi + # default homebrew bin dir changed with macos 14 + if (( "$os_ver" > 13 )); then + ln -fs /opt/homebrew/bin/gfortran-${version} /usr/local/bin/gfortran + ln -fs /opt/homebrew/bin/gcc-${version} /usr/local/bin/gcc + ln -fs /opt/homebrew/bin/g++-${version} /usr/local/bin/g++ + else + ln -fs /usr/local/bin/gfortran-${version} /usr/local/bin/gfortran + ln -fs /usr/local/bin/gcc-${version} /usr/local/bin/gcc + ln -fs /usr/local/bin/g++-${version} /usr/local/bin/g++ fi - - export FC="gfortran" - export CC="gcc" - export CXX="g++" } install_gcc_apt() @@ -83,10 +76,6 @@ install_gcc_apt() --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${version} \ --slave /usr/bin/gcov gcov /usr/bin/gcov-${version} \ --slave /usr/bin/g++ g++ /usr/bin/g++-${version} - - export FC="gfortran" - export CC="gcc" - export CXX="g++" } install_gcc_choco() @@ -143,10 +132,6 @@ install_gcc_choco() if [ -d "$FCDIR" ] && [ -f "$LNDIR/libgfortran-5.dll" ] && [ ! -f "$FCDIR/libgfortran-5.dll" ]; then ln -s "$LNDIR/libgfortran-5.dll" "$FCDIR/libgfortran-5.dll" fi - - export FC="gfortran" - export CC="gcc" - export CXX="g++" } install_gcc() @@ -173,6 +158,10 @@ install_gcc() exit 1 ;; esac + + export FC="gfortran" + export CC="gcc" + export CXX="g++" } export_intel_vars() @@ -238,6 +227,10 @@ intel_version_map_l() esac else case $actual_version in + # 2024 versions omit patch version number in pkg name + 2024.0*) + version=2024.0 + ;; 2022.0.0 | 2022.0) version=2022.0.2 ;; @@ -347,6 +340,9 @@ intel_version_map_w() esac else case $actual_version in + 2024 | 2024.0 | 2024.0.1) + version=2024.0.1 + ;; 2023.2 | 2023.1 | 2023.0) version=$actual_version.0 ;; @@ -381,13 +377,23 @@ install_intel_apt() | sudo tee /etc/apt/sources.list.d/oneAPI.list sudo apt-get update + # c/cpp compiler package names changed with 2024+ + case $version in + 2024*) + cpp_name=dpcpp-cpp + ;; + *) + cpp_name=dpcpp-cpp-and-cpp-classic + ;; + esac + if $install_mkl; then sudo apt-get install \ - intel-oneapi-compiler-{fortran,dpcpp-cpp-and-cpp-classic}-$version \ + intel-oneapi-compiler-{fortran,"$cpp_name"}-$version \ intel-oneapi-mkl-$mkl_version else sudo apt-get install \ - intel-oneapi-compiler-{fortran,dpcpp-cpp-and-cpp-classic}-$version + intel-oneapi-compiler-{fortran,"$cpp_name"}-$version fi source /opt/intel/oneapi/setvars.sh @@ -405,6 +411,7 @@ install_intel_apt() export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib/intel64" export MKLROOT="$ONEAPI_ROOT/mkl/latest" fi + export_intel_vars } @@ -526,49 +533,40 @@ install_intel_win() intel_version_map_w $version $classic case $version in + 2024.0.1) + WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7a6db8a1-a8b9-4043-8e8e-ca54b56c34e4/w_HPCKit_p_2024.0.1.35_offline.exe + WINDOWS_HPCKIT_COMPONENTS=intel.oneapi.win.ifort-compiler:intel.oneapi.win.cpp-dpcpp-common + ;; 2023.2.0) WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/438527fc-7140-422c-a851-389f2791816b/w_HPCKit_p_2023.2.0.49441_offline.exe + WINDOWS_HPCKIT_COMPONENTS=intel.oneapi.win.ifort-compiler:intel.oneapi.win.cpp-compiler ;; 2023.1.0) WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/2a13d966-fcc5-4a66-9fcc-50603820e0c9/w_HPCKit_p_2023.1.0.46357_offline.exe + WINDOWS_HPCKIT_COMPONENTS=intel.oneapi.win.ifort-compiler:intel.oneapi.win.cpp-compiler ;; 2023.0.0) WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/19085/w_HPCKit_p_2023.0.0.25931_offline.exe + WINDOWS_HPCKIT_COMPONENTS=intel.oneapi.win.ifort-compiler:intel.oneapi.win.cpp-compiler ;; 2022.3.1) WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18976/w_HPCKit_p_2022.3.1.19755_offline.exe + WINDOWS_HPCKIT_COMPONENTS=intel.oneapi.win.ifort-compiler:intel.oneapi.win.cpp-compiler ;; 2022.3.0) WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18857/w_HPCKit_p_2022.3.0.9564_offline.exe + WINDOWS_HPCKIT_COMPONENTS=intel.oneapi.win.ifort-compiler:intel.oneapi.win.cpp-compiler ;; 2022.2.0) WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18680/w_HPCKit_p_2022.2.0.173_offline.exe + WINDOWS_HPCKIT_COMPONENTS=intel.oneapi.win.ifort-compiler:intel.oneapi.win.cpp-compiler ;; - # the installer versions below fail - # 2022.1.2) - # WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18529/w_HPCKit_p_2022.1.2.116_offline.exe - # ;; - # 2022.1.0) - # WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18417/w_HPCKit_p_2022.1.0.93_offline.exe - # ;; - # 2021.4.0) - # WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/18247/w_HPCKit_p_2021.4.0.3340_offline.exe - # ;; - # 2021.3.0) - # WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17940/w_HPCKit_p_2021.3.0.3227_offline.exe - # ;; - # 2021.2.0) - # WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17762/w_HPCKit_p_2021.2.0.2901_offline.exe - # ;; - # 2021.1.0) - # WINDOWS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17392/w_HPCKit_p_2021.1.0.2682_offline.exe - # ;; *) exit 1 ;; esac - "$GITHUB_ACTION_PATH/install-intel-windows.bat" $WINDOWS_HPCKIT_URL + "$GITHUB_ACTION_PATH/install-intel-windows.bat" $WINDOWS_HPCKIT_URL $WINDOWS_HPCKIT_COMPONENTS # don't call export_intel_vars here because the install may have # been restored from cache. export variables in action.yml after @@ -601,6 +599,16 @@ install_intel() exit 1 ;; esac + + if $classic; then + export FC="ifort" + export CC="icc" + export CXX="icpc" + else + export FC="ifx" + export CC="icx" + export CXX="icpx" + fi } export_nvidiahpc_vars() @@ -649,14 +657,7 @@ install_nvidiahpc_apt() echo "NVIDIA HPC SDK $version module loaded." # set environment variables - echo "Setting environment variables..." export_nvidiahpc_vars $version - - # set environment variables - export FC="nvfortran" - export CC="nvc" - export CXX="nvc++" - echo "Environment variables set." } install_nvidiahpc() @@ -687,4 +688,8 @@ install_nvidiahpc() exit 1 ;; esac + + export FC="nvfortran" + export CC="nvc" + export CXX="nvc++" } From 0e8b6215a8250be09654d5c8b830c89f1b4ee296 Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 20 Mar 2024 08:34:31 +0100 Subject: [PATCH 09/17] removed source setvars and manipulation of DYLD_LIBRARY_PATH move macos mkl install into separate script move variable export to main calling function set lib env export in action source instead of execute set MKLLIB per case, skip 2021.5 macos mkl --- action.yml | 3 +++ install-mkl-macos.sh | 22 ++++++++++++++++++ setup-fortran.sh | 55 ++++++++------------------------------------ 3 files changed, 34 insertions(+), 46 deletions(-) create mode 100644 install-mkl-macos.sh diff --git a/action.yml b/action.yml index 0a0fb76..b6416bc 100644 --- a/action.yml +++ b/action.yml @@ -92,6 +92,7 @@ runs: echo "FC=${FC}" >> $GITHUB_ENV echo "CC=${CC}" >> $GITHUB_ENV echo "CXX=${CXX}" >> $GITHUB_ENV + echo "MKLLIB=${MKLLIB}" >> $GITHUB_ENV # save oneAPI cache and activate environment - name: Save cache @@ -134,6 +135,7 @@ runs: echo FC=$FC>>$GITHUB_ENV echo CC=$CC>>$GITHUB_ENV echo CXX=$CXX>>$GITHUB_ENV + echo "MKLLIB=$MKLLIB" >> $GITHUB_ENV # set fpm env vars echo FPM_FC=$FC>>$GITHUB_ENV @@ -144,6 +146,7 @@ runs: echo fc=$FC>>$GITHUB_OUTPUT echo cc=$CC>>$GITHUB_OUTPUT echo cxx=$CXX>>$GITHUB_OUTPUT + echo MKLLIB=$MKLLIB>>$GITHUB_OUTPUT # GitHub Actions prepends GNU linker to the PATH before all bash steps, hide it so MSVC linker is found - name: Hide GNU linker (Windows) diff --git a/install-mkl-macos.sh b/install-mkl-macos.sh new file mode 100644 index 0000000..e360b18 --- /dev/null +++ b/install-mkl-macos.sh @@ -0,0 +1,22 @@ +MACOS_BASEKIT_URL=$1 + +if [ "$MACOS_BASEKIT_URL" == "" ]; then + echo "ERROR: MACOS_BASEKIT_URL is empty - please check the version mapping for MKL" + echo "SKIPPING MKL installation..." +elif [ "$MACOS_BASEKIT_URL" == "2021.5" ]; then + echo "ERROR: MKL not available for this intel compiler version" + echo "SKIPPING MKL installation..." +else + require_fetch + $fetch $MACOS_BASEKIT_URL > m_BASEKit.dmg + ls -lh + hdiutil verify m_BASEKit.dmg + hdiutil attach m_BASEKit.dmg + sudo /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ + --action install \ + --eula=accept \ + --continue-with-optional-error=yes \ + --log-dir=. + hdiutil detach /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)" -quiet + rm m_BASEKit.dmg +fi \ No newline at end of file diff --git a/setup-fortran.sh b/setup-fortran.sh index bb2f787..c009582 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -171,10 +171,9 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH LIBRARY_PATH=$LIBRARY_PATH INFOPATH=$INFOPATH MANPATH=$MANPATH -MKLLIB=$MKLLIB MKLROOT=$MKLROOT -DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH ONEAPI_ROOT=$ONEAPI_ROOT +MKLLIB=$MKLLIB CLASSPATH=$CLASSPATH CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES @@ -397,21 +396,6 @@ install_intel_apt() fi source /opt/intel/oneapi/setvars.sh - # these exports have been removed in later versions of the action? - if $classic; then - export FC="ifort" - export CC="icc" - export CXX="icpc" - else - export FC="ifx" - export CC="icx" - export CXX="icpx" - fi - if $install_mkl; then - export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib/intel64" - export MKLROOT="$ONEAPI_ROOT/mkl/latest" - fi - export_intel_vars } @@ -480,23 +464,7 @@ install_intel_dmg() esac if $install_mkl; then - if [ "$MACOS_BASEKIT_URL" == "" ]; then - echo "ERROR: MACOS_BASEKIT_URL is empty - please check the version mapping for MKL" - echo "SKIPPING MKL installation..." - else - require_fetch - $fetch $MACOS_BASEKIT_URL > m_BASEKit.dmg - ls -lh - hdiutil verify m_BASEKit.dmg - hdiutil attach m_BASEKit.dmg - sudo /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ - --action install \ - --eula=accept \ - --continue-with-optional-error=yes \ - --log-dir=. - hdiutil detach /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)" -quiet - rm m_BASEKit.dmg - fi + source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" $MACOS_BASEKIT_URL fi require_fetch @@ -512,18 +480,6 @@ install_intel_dmg() rm m_HPCKit.dmg source /opt/intel/oneapi/setvars.sh - - # these exports have been removed in later versions of the action? - export FC="ifort" - export CC="icc" - export CXX="icpc" - - if $install_mkl; then - export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib" - export MKLROOT="$ONEAPI_ROOT/mkl/latest" - export DYLD_LIBRARY_PATH="$MKLLIB":$DYLD_LIBRARY_PATH - fi - export_intel_vars } @@ -579,9 +535,11 @@ install_intel() local platform=$1 local classic=$2 local install_mkl=$3 + mkl_subdir="" case $platform in linux*) install_intel_apt $version $classic $install_mkl + mkl_subdir="intel64" ;; darwin*) install_intel_dmg $version $install_mkl @@ -610,6 +568,11 @@ install_intel() export CC="icx" export CXX="icpx" fi + + if $install_mkl; then + export MKLLIB="$ONEAPI_ROOT/mkl/latest/lib/$mkl_subdir" + export MKLROOT="$ONEAPI_ROOT/mkl/latest" + fi } export_nvidiahpc_vars() From 2e936a9514ba2a2f4700fc86725cb8ddc039e499 Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 27 Mar 2024 08:43:07 +0100 Subject: [PATCH 10/17] use macos install script for both dmgs, answer y in apt install for act compatibility --- install-mkl-macos.sh | 25 ++++++++++++------------- setup-fortran.sh | 20 +++++--------------- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/install-mkl-macos.sh b/install-mkl-macos.sh index e360b18..256a9bd 100644 --- a/install-mkl-macos.sh +++ b/install-mkl-macos.sh @@ -1,22 +1,21 @@ -MACOS_BASEKIT_URL=$1 - -if [ "$MACOS_BASEKIT_URL" == "" ]; then - echo "ERROR: MACOS_BASEKIT_URL is empty - please check the version mapping for MKL" - echo "SKIPPING MKL installation..." -elif [ "$MACOS_BASEKIT_URL" == "2021.5" ]; then +MACOS_URL=$1 +install_mkl=$2 +if [ "$MACOS_URL" == "" ]; then + echo "ERROR: MACOS URL is empty - please check the version mapping for mkl/intel compiler" + echo "SKIPPING MKL/intel installation..." +elif [ "$MACOS_URL" == "2021.5" ] and $install_mkl; then echo "ERROR: MKL not available for this intel compiler version" echo "SKIPPING MKL installation..." else require_fetch - $fetch $MACOS_BASEKIT_URL > m_BASEKit.dmg - ls -lh - hdiutil verify m_BASEKit.dmg - hdiutil attach m_BASEKit.dmg - sudo /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ + $fetch $MACOS_URL > m_BASE_HPC_Kit.dmg + hdiutil verify m_BASE_HPC_Kit.dmg + hdiutil attach m_BASE_HPC_Kit.dmg + sudo /Volumes/"$(basename "$MACOS_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ --action install \ --eula=accept \ --continue-with-optional-error=yes \ --log-dir=. - hdiutil detach /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)" -quiet - rm m_BASEKit.dmg + hdiutil detach /Volumes/"$(basename "$MACOS_URL" .dmg)" -quiet + rm m_BASE_HPC_Kit.dmg fi \ No newline at end of file diff --git a/setup-fortran.sh b/setup-fortran.sh index c009582..ef31b13 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -369,7 +369,7 @@ install_intel_apt() require_fetch local _KEY="GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB" - $fetch https://apt.repos.intel.com/intel-gpg-keys/$_KEY > $_KEY + $fetch https://apt.repos.intsource /opt/intel/oneapi/setvars.shel.com/intel-gpg-keys/$_KEY > $_KEY sudo apt-key add $_KEY rm $_KEY echo "deb https://apt.repos.intel.com/oneapi all main" \ @@ -387,11 +387,11 @@ install_intel_apt() esac if $install_mkl; then - sudo apt-get install \ + sudo apt-get install -y \ intel-oneapi-compiler-{fortran,"$cpp_name"}-$version \ intel-oneapi-mkl-$mkl_version else - sudo apt-get install \ + sudo apt-get install -y \ intel-oneapi-compiler-{fortran,"$cpp_name"}-$version fi @@ -464,20 +464,10 @@ install_intel_dmg() esac if $install_mkl; then - source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" $MACOS_BASEKIT_URL + source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" $MACOS_BASEKIT_URL true fi - require_fetch - $fetch $MACOS_HPCKIT_URL > m_HPCKit.dmg - hdiutil verify m_HPCKit.dmg - hdiutil attach m_HPCKit.dmg - sudo /Volumes/"$(basename "$MACOS_HPCKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \ - --action install \ - --eula=accept \ - --continue-with-optional-error=yes \ - --log-dir=. - hdiutil detach /Volumes/"$(basename "$MACOS_HPCKIT_URL" .dmg)" -quiet - rm m_HPCKit.dmg + source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" $MACOS_HPCKIT_URL false source /opt/intel/oneapi/setvars.sh export_intel_vars From 940e8cb264db095f40a7fec6d8625830a65b2379 Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 27 Mar 2024 08:47:06 +0100 Subject: [PATCH 11/17] remove accidental duplication --- .github/actions/test-fc/action.yml | 16 ---------------- .github/compat/long_compat.csv | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/actions/test-fc/action.yml b/.github/actions/test-fc/action.yml index dac2ee4..bca4e9e 100644 --- a/.github/actions/test-fc/action.yml +++ b/.github/actions/test-fc/action.yml @@ -58,22 +58,6 @@ runs: } rm hw.exe - - name: Test compile Fortran (pwsh) - working-directory: test - if: ${{ (success() || failure()) && runner.os == 'Windows' }} - shell: pwsh - run: | - ${{ env.FC }} -o hw.exe hw.f90 - $output=$(& ".\hw.exe") - if ($output -match "hello world") { - write-output $output - } else { - write-output "unexpected output: $output" - exit 1 - } - rm hw.exe - - - name: Test compile Fortran (powershell) working-directory: test if: ${{ (success() || failure()) && runner.os == 'Windows' }} diff --git a/.github/compat/long_compat.csv b/.github/compat/long_compat.csv index fc29968..453c843 100644 --- a/.github/compat/long_compat.csv +++ b/.github/compat/long_compat.csv @@ -1,5 +1,5 @@ runner,compiler,version,support -macos-13,intel-classic,2021.5,✓runner,compiler,version,support +macos-13,intel-classic,2021.5,✓ macos-11,gcc,10,✓ macos-11,gcc,11,✓ macos-11,gcc,12,✓ From 847d4474f0867cf4735693302f1d0bf278fe1421 Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 27 Mar 2024 08:50:34 +0100 Subject: [PATCH 12/17] reverse order of passed variables in case string is empty --- install-mkl-macos.sh => install-intel-macos.sh | 4 ++-- setup-fortran.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename install-mkl-macos.sh => install-intel-macos.sh (96%) diff --git a/install-mkl-macos.sh b/install-intel-macos.sh similarity index 96% rename from install-mkl-macos.sh rename to install-intel-macos.sh index 256a9bd..4a16bd2 100644 --- a/install-mkl-macos.sh +++ b/install-intel-macos.sh @@ -1,5 +1,5 @@ -MACOS_URL=$1 -install_mkl=$2 +install_mkl=$1 +MACOS_URL=$2 if [ "$MACOS_URL" == "" ]; then echo "ERROR: MACOS URL is empty - please check the version mapping for mkl/intel compiler" echo "SKIPPING MKL/intel installation..." diff --git a/setup-fortran.sh b/setup-fortran.sh index ef31b13..6ac481d 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -464,10 +464,10 @@ install_intel_dmg() esac if $install_mkl; then - source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" $MACOS_BASEKIT_URL true + source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" true $MACOS_BASEKIT_URL fi - source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" $MACOS_HPCKIT_URL false + source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" false $MACOS_HPCKIT_URL source /opt/intel/oneapi/setvars.sh export_intel_vars From c5942663e2c2251c40a374e72da6ad423778c4bc Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 27 Mar 2024 08:55:42 +0100 Subject: [PATCH 13/17] remove pasted garbage in link --- setup-fortran.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-fortran.sh b/setup-fortran.sh index 6ac481d..6cb8b78 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -369,7 +369,7 @@ install_intel_apt() require_fetch local _KEY="GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB" - $fetch https://apt.repos.intsource /opt/intel/oneapi/setvars.shel.com/intel-gpg-keys/$_KEY > $_KEY + $fetch https://apt.repos.intel.com/intel-gpg-keys/$_KEY > $_KEY sudo apt-key add $_KEY rm $_KEY echo "deb https://apt.repos.intel.com/oneapi all main" \ From dc2ccc7131c2d6201b6db4ba63acb98da9595be5 Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 27 Mar 2024 11:55:26 +0100 Subject: [PATCH 14/17] rename macos install script --- setup-fortran.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup-fortran.sh b/setup-fortran.sh index 6cb8b78..11e32bb 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -464,10 +464,10 @@ install_intel_dmg() esac if $install_mkl; then - source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" true $MACOS_BASEKIT_URL + source "$GITHUB_ACTION_PATH/install-intel-macos.sh" true $MACOS_BASEKIT_URL fi - source "$GITHUB_ACTION_PATH/install-mkl-macos.sh" false $MACOS_HPCKIT_URL + source "$GITHUB_ACTION_PATH/install-intel-macos.sh" false $MACOS_HPCKIT_URL source /opt/intel/oneapi/setvars.sh export_intel_vars From 0bcfd2f761cb665d127461ebd0e9ce257b693a9e Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 27 Mar 2024 13:02:57 +0100 Subject: [PATCH 15/17] try wo another export of MKLLIB in the action.yml --- action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/action.yml b/action.yml index b6416bc..af29328 100644 --- a/action.yml +++ b/action.yml @@ -92,7 +92,6 @@ runs: echo "FC=${FC}" >> $GITHUB_ENV echo "CC=${CC}" >> $GITHUB_ENV echo "CXX=${CXX}" >> $GITHUB_ENV - echo "MKLLIB=${MKLLIB}" >> $GITHUB_ENV # save oneAPI cache and activate environment - name: Save cache From 67c914874c1a7816c7dbafda5119d997f5dda7c7 Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 27 Mar 2024 13:15:52 +0100 Subject: [PATCH 16/17] export mkllib in test --- .github/actions/test-mkl/action.yml | 8 ++++++-- setup-fortran.sh | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/test-mkl/action.yml b/.github/actions/test-mkl/action.yml index 7b25e50..45c82b0 100644 --- a/.github/actions/test-mkl/action.yml +++ b/.github/actions/test-mkl/action.yml @@ -23,9 +23,13 @@ runs: # required for macOS 11, intel-classic 2021.1-2021.10 # required for macOS 12, intel-classic 2021.1, 2021.4, 2021.6, 2021.10 # for all others, setting DYLD path through environment works correctly - export DYLD_LIBRARY_PATH="${{ env.MKLLIB }}:$DYLD_LIBRARY_PATH" + MKLLIB="$MKLROOT/latest/lib" + export DYLD_LIBRARY_PATH="$MKLLIB:$DYLD_LIBRARY_PATH" + elif [ "$RUNNER_OS" == "Linux" ]; then + MKLLIB="$MKLROOT/latest/lib/intel64" + export LD_LIBRARY_PATH="$MKLLIB:$LD_LIBRARY_PATH" fi - linking="-L${{ env.MKLLIB }} -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" + linking="-L$MKLLIB -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" # hello world with blas call program ${{ env.FC }} $args $linking -o hw_mkl hw_mkl.f90 output=$(./hw_mkl '2>&1') diff --git a/setup-fortran.sh b/setup-fortran.sh index 50bd8db..38d88ab 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -173,7 +173,6 @@ INFOPATH=$INFOPATH MANPATH=$MANPATH MKLROOT=$MKLROOT ONEAPI_ROOT=$ONEAPI_ROOT -MKLLIB=$MKLLIB CLASSPATH=$CLASSPATH CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES From 9a69df560ec5bc4c596dcc0c356de4389b295b1e Mon Sep 17 00:00:00 2001 From: Inga Ulusoy Date: Wed, 27 Mar 2024 13:25:46 +0100 Subject: [PATCH 17/17] no latest when using MKLROOT for macos --- .github/actions/test-mkl/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-mkl/action.yml b/.github/actions/test-mkl/action.yml index 45c82b0..147d975 100644 --- a/.github/actions/test-mkl/action.yml +++ b/.github/actions/test-mkl/action.yml @@ -23,7 +23,7 @@ runs: # required for macOS 11, intel-classic 2021.1-2021.10 # required for macOS 12, intel-classic 2021.1, 2021.4, 2021.6, 2021.10 # for all others, setting DYLD path through environment works correctly - MKLLIB="$MKLROOT/latest/lib" + MKLLIB="$MKLROOT/lib" export DYLD_LIBRARY_PATH="$MKLLIB:$DYLD_LIBRARY_PATH" elif [ "$RUNNER_OS" == "Linux" ]; then MKLLIB="$MKLROOT/latest/lib/intel64"