From 901c7d112a6e0ceac97b897c0bb70d0c3470065a Mon Sep 17 00:00:00 2001 From: w-bonelli Date: Tue, 25 Jul 2023 10:59:25 -0400 Subject: [PATCH 1/4] fix: set SETVARS_COMPLETED after installing/activating Intel toolchain, don't unset local variable in install_intel_apt bash function, test intel and intel-classic on ubuntu-20.04 --- .github/workflows/test.yml | 8 ++++++++ README.md | 2 +- action.yml | 5 +++++ setup-fortran.sh | 1 - 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e2ecef8..f1d6f3a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,6 +38,10 @@ jobs: - {compiler: gcc, version: 6} # {compiler: gcc, version: 5} include: + - {os: ubuntu-20.04, toolchain: {compiler: intel, version: '2023.2'}} + - {os: ubuntu-20.04, toolchain: {compiler: intel, version: '2022.2.1'}} + - {os: ubuntu-20.04, toolchain: {compiler: intel, version: '2021.4'}} + - {os: ubuntu-22.04, toolchain: {compiler: intel, version: '2023.2'}} # {os: ubuntu-22.04, toolchain: {compiler: intel, version: '2023.1'}} # {os: ubuntu-22.04, toolchain: {compiler: intel, version: '2023.0'}} @@ -51,6 +55,10 @@ jobs: # {os: ubuntu-22.04, toolchain: {compiler: intel, version: '2021.1.2'}} # {os: ubuntu-22.04, toolchain: {compiler: intel, version: '2021.1'}} + - {os: ubuntu-20.04, toolchain: {compiler: intel-classic, version: '2021.10'}} + - {os: ubuntu-20.04, toolchain: {compiler: intel-classic, version: '2021.7.1'}} + - {os: ubuntu-20.04, toolchain: {compiler: intel-classic, version: '2021.4'}} + - {os: ubuntu-22.04, toolchain: {compiler: intel-classic, version: '2021.10'}} # {os: ubuntu-22.04, toolchain: {compiler: intel-classic, version: '2021.9'}} # {os: ubuntu-22.04, toolchain: {compiler: intel-classic, version: '2021.8'}} diff --git a/README.md b/README.md index 27942b5..1c18c47 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ Supported Intel toolchains: | windows-\* | intel | 2023.2, 2023.1, 2023.0, 2022.2.0, 2022.1.0 | | windows-\* | intel-classic | 2021.10.0, 2021.9.0, 2021.8.0, 2021.7.0, 2021.6.0 | -**Note:** on macOS the `intel`/`ifx` compiler option is not suppoted, only `intel-classic` with the `ifort` compiler. +**Note:** on macOS the `intel`/`ifx` compiler option is not supported, only `intel-classic` with the `ifort` compiler. ## License diff --git a/action.yml b/action.yml index b6fc225..ec29493 100644 --- a/action.yml +++ b/action.yml @@ -135,6 +135,11 @@ runs: echo CC=$CC>>$GITHUB_ENV fi + # set flag to indicate that SETVARS has been run + if [[ "${{ inputs.compiler }}" =~ "intel" ]]; then + echo SETVARS_COMPLETED=1>>$GITHUB_ENV + fi + # 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/setup-fortran.sh b/setup-fortran.sh index 7f9cc15..3ff0248 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -281,7 +281,6 @@ install_intel_apt() $fetch https://apt.repos.intel.com/intel-gpg-keys/$_KEY > $_KEY sudo apt-key add $_KEY rm $_KEY - unset $_KEY echo "deb https://apt.repos.intel.com/oneapi all main" \ | sudo tee /etc/apt/sources.list.d/oneAPI.list sudo apt-get update From 10629dc73f77fc47aad0f57d6e7beb00aeb2b9eb Mon Sep 17 00:00:00 2001 From: w-bonelli Date: Wed, 26 Jul 2023 11:26:29 -0400 Subject: [PATCH 2/4] include SETVARS_COMPLETED in export_intel_vars, add explanatory comment in install_intel_win" --- setup-fortran.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup-fortran.sh b/setup-fortran.sh index 3ff0248..844a262 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -131,6 +131,7 @@ CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES INTEL_PYTHONHOME=$INTEL_PYTHONHOME CPATH=$CPATH +SETVARS_COMPLETED=$SETVARS_COMPLETED EOF for path in ${PATH//:/ }; do echo $path >> $GITHUB_PATH @@ -426,6 +427,10 @@ install_intel_win() esac "$GITHUB_ACTION_PATH/install-intel-windows.bat" $WINDOWS_HPCKIT_URL + + # don't call export_intel_vars here because the install may have + # been restored from cache. export variables in action.yml after + # installation or cache restore. } install_intel() From ed8956c58871a3fede37bb5e8daeec5da3f75bcb Mon Sep 17 00:00:00 2001 From: w-bonelli Date: Thu, 27 Jul 2023 15:30:54 -0400 Subject: [PATCH 3/4] set CXX on intel/windows, cleanup --- action.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index ec29493..d7be569 100644 --- a/action.yml +++ b/action.yml @@ -117,25 +117,23 @@ runs: echo cc=icx>>$GITHUB_OUTPUT echo FC=ifx>>$GITHUB_ENV echo CC=icx>>$GITHUB_ENV + echo CXX=icx>>$GITHUB_ENV elif [[ "${{ inputs.compiler }}" == "intel-classic" ]]; then echo fc=ifort>>$GITHUB_OUTPUT echo cc=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 FC=$FC>>$GITHUB_ENV% - echo CC=$CC>>$GITHUB_ENV% fi else echo fc=$FC>>$GITHUB_OUTPUT echo cc=$CC>>$GITHUB_OUTPUT - echo FC=$FC>>$GITHUB_ENV - echo CC=$CC>>$GITHUB_ENV fi - # set flag to indicate that SETVARS has been run + # intel oneapi flag to indicate env has been activated if [[ "${{ inputs.compiler }}" =~ "intel" ]]; then echo SETVARS_COMPLETED=1>>$GITHUB_ENV fi From 5c5e0b15ca47814da684d92cc67bf6ebe9860c04 Mon Sep 17 00:00:00 2001 From: w-bonelli Date: Fri, 28 Jul 2023 11:52:20 -0400 Subject: [PATCH 4/4] ifx 2021.3 install fails on ubuntu --- README.md | 2 +- setup-fortran.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1c18c47..a332177 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Supported Intel toolchains: | runner | compiler | version | | :-------- | :------------- | :------ | -| ubuntu-\* | intel | 2023.2, 2023.1, 2023.0,
2022.2.1, 2022.2, 2022.1, 2022.0,
2021.4, 2021.3, 2021.2, 2021.1.2, 2021.1 | +| ubuntu-\* | intel | 2023.2, 2023.1, 2023.0,
2022.2.1, 2022.2, 2022.1, 2022.0,
2021.4, 2021.2, 2021.1.2, 2021.1 | | ubuntu-\* | intel-classic | 2021.10, 2021.9, 2021.8,
2021.7.1, 2021.7, 2021.6, 2021.5,
2021.4, 2021.3, 2021.2, 2021.1.2, 2021.1 | | macos-\* | intel-classic | 2021.10, 2021.9, 2021.8,
2021.7.1, 2021.7, 2021.6, 2021.5,
2021.4, 2021.3, 2021.2, 2021.1 | | windows-\* | intel | 2023.2, 2023.1, 2023.0, 2022.2.0, 2022.1.0 | diff --git a/setup-fortran.sh b/setup-fortran.sh index 844a262..67b5976 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -181,7 +181,7 @@ intel_version_map_l() 2022.0.0 | 2022.0) version=2022.0.2 ;; - 2023.2 | 2023.1 | 2023.0 | 2022.2 | 2022.1 | 2021.4 | 2021.3 | 2021.2) + 2023.2 | 2023.1 | 2023.0 | 2022.2 | 2022.1 | 2021.4 | 2021.2) version=$actual_version.0 ;; 2021.1)