diff --git a/.github/actions/test-cc/action.yml b/.github/actions/test-cc/action.yml index b6dceb77..77920fde 100644 --- a/.github/actions/test-cc/action.yml +++ b/.github/actions/test-cc/action.yml @@ -18,7 +18,7 @@ runs: [[ "${{ 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 + if ([ "$RUNNER_OS" == "Windows" ] && [[ "${{ inputs.compiler }}" =~ "intel" ]]); 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 ccv=$(cat "$RUNNER_TEMP/${{ env.CC }}.ver" | head -n 1) @@ -27,6 +27,8 @@ runs: elif ([ "$RUNNER_OS" == "Linux" ] && [[ "${{ inputs.compiler }}" == "nvidia-hpc" ]]); then # Get the compiler version and extract the version number ccv=$(${{ env.CC }} --version 2>&1 | awk '/nvc/ {print $2}' | cut -d'-' -f1) + elif ([[ "${{ inputs.compiler }}" == "lfortran" ]]); then + exit 0 # uses preinstalled gcc, skip version check elif ([[ "${{ inputs.compiler }}" != "nvidia-hpc" ]]); then ccv=$(${{ env.CC }} --version | head -n 1) ccv=$(echo "$ccv" | grep -woE '[0123456789.]+' | head -n 1) diff --git a/.github/actions/test-cxx/action.yml b/.github/actions/test-cxx/action.yml index 7e6c8262..5793c6c2 100644 --- a/.github/actions/test-cxx/action.yml +++ b/.github/actions/test-cxx/action.yml @@ -18,7 +18,7 @@ runs: [[ "${{ 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 + if ([ "$RUNNER_OS" == "Windows" ] && [[ "${{ matrix.toolchain.compiler }}" =~ "intel" ]]); 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 cxxv=$(cat "$RUNNER_TEMP/${{ env.CXX }}.ver" | head -n 1) @@ -27,6 +27,8 @@ runs: elif ([ "$RUNNER_OS" == "Linux" ] && [[ "${{ matrix.toolchain.compiler}}" == "nvidia-hpc" ]]); then # Get the compiler version and extract the version number cxxv=$(${{ env.CXX }} --version 2>&1 | awk '/nvc++/ {print $2}' | cut -d'-' -f1) + elif ([[ "${{ inputs.compiler }}" == "lfortran" ]]); then + exit 0 # uses preinstalled gcc, skip version check elif ([[ "${{ matrix.toolchain.compiler}}" != "nvidia-hpc" ]]); then cxxv=$(${{ env.CXX }} --version | head -n 1) cxxv=$(echo "$cxxv" | grep -woE '[0123456789.]+' | head -n 1) diff --git a/.github/actions/test-fc/action.yml b/.github/actions/test-fc/action.yml index dac2ee44..2f1cd4c0 100644 --- a/.github/actions/test-fc/action.yml +++ b/.github/actions/test-fc/action.yml @@ -18,7 +18,7 @@ runs: [[ "${{ 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 + if ([ "$RUNNER_OS" == "Windows" ] && [[ "${{ inputs.compiler }}" =~ "intel" ]]); 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 fcv=$(cat "$RUNNER_TEMP/${{ env.FC }}.ver" | head -n 1) @@ -27,6 +27,8 @@ runs: elif ([ "$RUNNER_OS" == "Linux" ] && [[ "${{ inputs.compiler }}" == "nvidia-hpc" ]]); then # Get the compiler version and extract the version number fcv=$(${{ env.FC }} --version 2>&1 | awk '/nvfortran/ {print $2}' | cut -d'-' -f1) + elif ([[ "${{ inputs.compiler }}" == "lfortran" ]]); then + fcv=$(${{ env.FC }} --version | head -n 1 | grep -woE '[0123456789.]+') elif ([[ "${{ inputs.compiler }}" != "nvidia-hpc" ]]); then fcv=$(${{ env.FC }} --version | head -n 1) fcv=$(echo "$fcv" | grep -woE '[0123456789.]+' | head -n 1) @@ -38,14 +40,15 @@ runs: shell: bash run: | # hello world program - ${{ env.FC }} $args -o hw hw.f90 + ${{ env.FC }} -o hw hw.f90 output=$(./hw '2>&1') [[ "$output" == *"hello world"* ]] && echo "$output" || (echo "Unexpected Fortran program 'hw' output: $output"; exit 1) rm hw - name: Test compile Fortran (pwsh) working-directory: test - if: ${{ (success() || failure()) && runner.os == 'Windows' }} + # todo: debug lfortran discovery issues (same for powershell and cmd below) + if: ${{ (success() || failure()) && runner.os == 'Windows' && inputs.compiler != 'lfortran' }} shell: pwsh run: | ${{ env.FC }} -o hw.exe hw.f90 @@ -76,7 +79,7 @@ runs: - name: Test compile Fortran (powershell) working-directory: test - if: ${{ (success() || failure()) && runner.os == 'Windows' }} + if: ${{ (success() || failure()) && runner.os == 'Windows' && inputs.compiler != 'lfortran' }} shell: powershell run: | ${{ env.FC }} -o hw.exe hw.f90 @@ -91,7 +94,7 @@ runs: - name: Test compile Fortran (cmd) working-directory: test - if: ${{ (success() || failure()) && runner.os == 'Windows' }} + if: ${{ (success() || failure()) && runner.os == 'Windows' && inputs.compiler != 'lfortran' }} shell: cmd run: | ${{ env.FC }} -o hw.exe hw.f90 diff --git a/.github/compat/compat.csv b/.github/compat/compat.csv index 6cca27de..1c1f18ee 100644 --- a/.github/compat/compat.csv +++ b/.github/compat/compat.csv @@ -1,10 +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,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.10,2021.2,2021.3,2021.4,2021.5,2021.6,2021.7.1,2021.7,2021.8,2021.9,2021.1,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,✓,✓,✓,✓,,✓,✓,✓,,,,,✓,,✓,✓,✓,,,,,,,,✓,,✓,✓,✓,✓,✓,,,,,,,, +compiler,gcc,gcc,gcc,gcc,gcc,gcc,gcc,intel,intel,intel,intel,intel,intel,intel,intel,intel,intel,intel,intel,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,intel-classic,lfortran,lfortran,lfortran,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.1.2,2021.2,2021.4,2022.0,2022.1,2022.2,2022.2.1,2023.0,2023.1,2023.2,2024.0,2021.1,2021.1.2,2021.10,2021.2,2021.3,2021.4,2021.5,2021.6,2021.7,2021.7.1,2021.8,2021.9,0.31.0,0.32.0,0.33.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 fc299683..c58a5411 100644 --- a/.github/compat/long_compat.csv +++ b/.github/compat/long_compat.csv @@ -1,30 +1,8 @@ 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,✓ -macos-11,gcc,13,✓ -macos-11,gcc,6, -macos-11,gcc,7,✓ -macos-11,gcc,8,✓ -macos-11,gcc,9,✓ -macos-11,intel-classic,2021.1.2, -macos-11,intel-classic,2021.1,✓ -macos-11,intel-classic,2021.10,✓ -macos-11,intel-classic,2021.2,✓ -macos-11,intel-classic,2021.3,✓ -macos-11,intel-classic,2021.4,✓ -macos-11,intel-classic,2021.5,✓ -macos-11,intel-classic,2021.6,✓ -macos-11,intel-classic,2021.7.1,✓ -macos-11,intel-classic,2021.7,✓ -macos-11,intel-classic,2021.8,✓ -macos-11,intel-classic,2021.9,✓ macos-12,gcc,10,✓ macos-12,gcc,11,✓ macos-12,gcc,12,✓ macos-12,gcc,13,✓ -macos-12,gcc,6, macos-12,gcc,7,✓ macos-12,gcc,8,✓ macos-12,gcc,9,✓ @@ -40,14 +18,15 @@ macos-12,intel-classic,2021.7.1,✓ macos-12,intel-classic,2021.7,✓ macos-12,intel-classic,2021.8,✓ macos-12,intel-classic,2021.9,✓ +macos-12,lfortran,0.31.0,✓ +macos-12,lfortran,0.32.0,✓ +macos-12,lfortran,0.33.0,✓ macos-13,gcc,10,✓ macos-13,gcc,11,✓ macos-13,gcc,12,✓ macos-13,gcc,13,✓ -macos-13,gcc,6, macos-13,gcc,7, macos-13,gcc,8, -macos-13,gcc,9, macos-13,intel-classic,2021.1.2, macos-13,intel-classic,2021.1,✓ macos-13,intel-classic,2021.10,✓ @@ -60,17 +39,35 @@ macos-13,intel-classic,2021.7.1,✓ macos-13,intel-classic,2021.7,✓ macos-13,intel-classic,2021.8,✓ macos-13,intel-classic,2021.9,✓ +macos-13,lfortran,0.31.0,✓ +macos-13,lfortran,0.32.0,✓ +macos-13,lfortran,0.33.0,✓ +macos-14,gcc,11,✓ +macos-14,gcc,12,✓ +macos-14,gcc,13,✓ +macos-14,gcc,7, +macos-14,intel-classic,2021.1.2, +macos-14,intel-classic,2021.1,✓ +macos-14,intel-classic,2021.10,✓ +macos-14,intel-classic,2021.2,✓ +macos-14,intel-classic,2021.3,✓ +macos-14,intel-classic,2021.4,✓ +macos-14,intel-classic,2021.5,✓ +macos-14,intel-classic,2021.6,✓ +macos-14,intel-classic,2021.7.1,✓ +macos-14,intel-classic,2021.7,✓ +macos-14,intel-classic,2021.8,✓ +macos-14,intel-classic,2021.9,✓ +macos-14,lfortran,0.31.0,✓ +macos-14,lfortran,0.32.0,✓ +macos-14,lfortran,0.33.0,✓ ubuntu-20.04,gcc,10,✓ ubuntu-20.04,gcc,11,✓ ubuntu-20.04,gcc,12, ubuntu-20.04,gcc,13,✓ -ubuntu-20.04,gcc,6, ubuntu-20.04,gcc,7,✓ ubuntu-20.04,gcc,8,✓ ubuntu-20.04,gcc,9,✓ -macos-14,gcc,11,✓ -macos-14,gcc,12,✓ -macos-14,gcc,13,✓ ubuntu-20.04,intel-classic,2021.1.2,✓ ubuntu-20.04,intel-classic,2021.1,✓ ubuntu-20.04,intel-classic,2021.10,✓ @@ -95,13 +92,26 @@ 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,lfortran,0.31.0,✓ +ubuntu-20.04,lfortran,0.32.0,✓ +ubuntu-20.04,lfortran,0.33.0,✓ ubuntu-20.04,nvidia-hpc,20.11,✓ ubuntu-20.04,nvidia-hpc,20.7, ubuntu-20.04,nvidia-hpc,20.9, ubuntu-20.04,nvidia-hpc,21.1, ubuntu-20.04,nvidia-hpc,21.11,✓ +ubuntu-20.04,nvidia-hpc,21.3, +ubuntu-20.04,nvidia-hpc,21.5, +ubuntu-20.04,nvidia-hpc,21.7, +ubuntu-20.04,nvidia-hpc,21.9, ubuntu-20.04,nvidia-hpc,22.1, ubuntu-20.04,nvidia-hpc,22.11,✓ +ubuntu-20.04,nvidia-hpc,22.2, +ubuntu-20.04,nvidia-hpc,22.3, +ubuntu-20.04,nvidia-hpc,22.5, +ubuntu-20.04,nvidia-hpc,22.7, +ubuntu-20.04,nvidia-hpc,22.9, +ubuntu-20.04,nvidia-hpc,23.1, ubuntu-20.04,nvidia-hpc,23.11,✓ ubuntu-20.04,nvidia-hpc,23.3,✓ ubuntu-20.04,nvidia-hpc,23.5,✓ @@ -111,7 +121,6 @@ ubuntu-22.04,gcc,10,✓ ubuntu-22.04,gcc,11,✓ ubuntu-22.04,gcc,12,✓ ubuntu-22.04,gcc,13,✓ -ubuntu-22.04,gcc,6, ubuntu-22.04,gcc,7, ubuntu-22.04,gcc,8, ubuntu-22.04,gcc,9,✓ @@ -139,13 +148,23 @@ 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,lfortran,0.31.0,✓ +ubuntu-22.04,lfortran,0.32.0,✓ +ubuntu-22.04,lfortran,0.33.0,✓ ubuntu-22.04,nvidia-hpc,20.11,✓ ubuntu-22.04,nvidia-hpc,20.7, ubuntu-22.04,nvidia-hpc,20.9, ubuntu-22.04,nvidia-hpc,21.1, ubuntu-22.04,nvidia-hpc,21.11,✓ +ubuntu-22.04,nvidia-hpc,21.7, ubuntu-22.04,nvidia-hpc,22.1, ubuntu-22.04,nvidia-hpc,22.11,✓ +ubuntu-22.04,nvidia-hpc,22.2, +ubuntu-22.04,nvidia-hpc,22.3, +ubuntu-22.04,nvidia-hpc,22.5, +ubuntu-22.04,nvidia-hpc,22.7, +ubuntu-22.04,nvidia-hpc,22.9, +ubuntu-22.04,nvidia-hpc,23.1, ubuntu-22.04,nvidia-hpc,23.11,✓ ubuntu-22.04,nvidia-hpc,23.3,✓ ubuntu-22.04,nvidia-hpc,23.5,✓ @@ -155,7 +174,6 @@ windows-2019,gcc,10,✓ windows-2019,gcc,11,✓ windows-2019,gcc,12,✓ windows-2019,gcc,13,✓ -windows-2019,gcc,6, windows-2019,gcc,7, windows-2019,gcc,8,✓ windows-2019,gcc,9,✓ @@ -183,11 +201,13 @@ windows-2019,intel,2023.0,✓ windows-2019,intel,2023.1,✓ windows-2019,intel,2023.2,✓ windows-2019,intel,2024.0,✓ +windows-2019,lfortran,0.31.0,✓ +windows-2019,lfortran,0.32.0,✓ +windows-2019,lfortran,0.33.0,✓ windows-2022,gcc,10,✓ windows-2022,gcc,11,✓ windows-2022,gcc,12,✓ windows-2022,gcc,13,✓ -windows-2022,gcc,6, windows-2022,gcc,7, windows-2022,gcc,8,✓ windows-2022,gcc,9,✓ @@ -215,3 +235,6 @@ windows-2022,intel,2023.0,✓ windows-2022,intel,2023.1,✓ windows-2022,intel,2023.2,✓ windows-2022,intel,2024.0,✓ +windows-2022,lfortran,0.31.0,✓ +windows-2022,lfortran,0.32.0,✓ +windows-2022,lfortran,0.33.0,✓ diff --git a/.github/compat/matrix.yml b/.github/compat/matrix.yml index c8a8ea89..f81d6490 100644 --- a/.github/compat/matrix.yml +++ b/.github/compat/matrix.yml @@ -38,6 +38,9 @@ toolchain: - {compiler: intel-classic, version: '2021.2'} - {compiler: intel-classic, version: '2021.1.2'} - {compiler: intel-classic, version: '2021.1'} + - {compiler: lfortran, version: '0.31.0'} + - {compiler: lfortran, version: '0.32.0'} + - {compiler: lfortran, version: '0.33.0'} - {compiler: nvidia-hpc, version: '23.11'} - {compiler: nvidia-hpc, version: '23.9'} - {compiler: nvidia-hpc, version: '23.7'} @@ -69,8 +72,6 @@ exclude: toolchain: {compiler: intel} - os: macos-12 toolchain: {compiler: intel} - - os: macos-11 - toolchain: {compiler: intel} # nvidia-hpc not available for mac - os: macos-14 toolchain: {compiler: nvidia-hpc} @@ -78,8 +79,6 @@ exclude: toolchain: {compiler: nvidia-hpc} - os: macos-12 toolchain: {compiler: nvidia-hpc} - - os: macos-11 - toolchain: {compiler: nvidia-hpc} # nvidia-hpc not available for windows - os: windows-2022 toolchain: {compiler: nvidia-hpc} diff --git a/.github/compat/wide_compat_reports.py b/.github/compat/wide_compat_reports.py index 97b495f0..6b67479b 100644 --- a/.github/compat/wide_compat_reports.py +++ b/.github/compat/wide_compat_reports.py @@ -22,7 +22,7 @@ index="runner", columns=["compiler", "version"], values="support", - sort=False, + sort=True, aggfunc="first", ).sort_values(by=["runner"]) diff --git a/README.md b/README.md index f651b29b..3806d8d1 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ The action sets the following outputs: - `cc`: C compiler executable, e.g. `gcc` - `cxx`: C++ compiler executable, e.g. `g++` -C/C++ compilers of the same toolchain/version are provided where possible, otherwise (if a standalone Fortran compiler is selected) defaulting to the preinstalled GCC. While this action attempts to guarantee Fortran compiler compatibility with all supported platform/toolchain/version combinations, no corresponding guarantee is made with regard to C/C++ compilers — use at your own risk. +C/C++ compilers of the same toolchain/version are provided where available. If a standalone Fortran compiler is selected, the action will attempt to configure compatible C/C++ compilers (typically GCC, or MSVC on Windows), but this is not guaranteed — use at your own risk. ## Environment variables @@ -107,19 +107,21 @@ 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.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 | 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 | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | ✓ | | | | | ✓ | | ✓ | ✓ | ✓ | | | | | | | | ✓ | | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | | +| runner | gcc 10 | gcc 11 | gcc 12 | gcc 13 | gcc 7 | gcc 8 | gcc 9 | intel 2021.1 | intel 2021.1.2 | intel 2021.2 | intel 2021.4 | intel 2022.0 | intel 2022.1 | intel 2022.2 | intel 2022.2.1 | intel 2023.0 | intel 2023.1 | intel 2023.2 | intel 2024.0 | intel-classic 2021.1 | intel-classic 2021.1.2 | 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 | intel-classic 2021.7.1 | intel-classic 2021.8 | intel-classic 2021.9 | lfortran 0.31.0 | lfortran 0.32.0 | lfortran 0.33.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`). +**Note:** LFortran is currently only discoverable by name with `bash` on Windows, see [here for context](https://github.com/fortran-lang/setup-fortran/pull/57#issuecomment-2021605094). + **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 diff --git a/action.yml b/action.yml index 8c4bcc57..c668daea 100644 --- a/action.yml +++ b/action.yml @@ -46,6 +46,13 @@ runs: path: ${{ env.ONEAPI_ROOT }} key: ${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.version }}-${{ steps.get-date.outputs.date }} + # used to install lfortran on mac + - uses: mamba-org/setup-micromamba@v1 + if: runner.os == 'macOS' && contains(inputs.compiler, 'lfortran') + with: + init-shell: bash + post-cleanup: 'all' + # Set up the selected toolchain or compiler - name: Setup toolchain id: setup @@ -62,6 +69,11 @@ runs: compiler=${COMPILER:-gcc} platform=$(uname -s | tr '[:upper:]' '[:lower:]') + if [[ "$RUNNER_OS" == "macOS" ]] && [[ "$compiler" == "intel" ]]; then + echo "Compiler 'intel' not supported on macOS, falling back to 'intel-classic'" + compiler="intel-classic" + fi + case $compiler in gcc) version=${VERSION:-13} @@ -72,13 +84,17 @@ runs: install_intel $platform true ${{ inputs.install_mkl }} ;; intel) - version=${VERSION:-2023.2.0} + version=${VERSION:-2024.0} install_intel $platform false ${{ inputs.install_mkl }} ;; nvidia-hpc) version=${VERSION:-23.11} install_nvidiahpc $platform ;; + lfortran) + version=${VERSION:-0.30.0} + install_lfortran $platform + ;; *) exit 1 ;; @@ -139,9 +155,11 @@ runs: 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') + if: runner.os == 'Windows' && !contains(inputs.compiler, 'gcc') shell: bash - run: mv "/usr/bin/link" "$RUNNER_TEMP/link" + run: mv /usr/bin/link $RUNNER_TEMP/link + + - name: Setup MSVC toolchain (Windows) + if: runner.os == 'Windows' && contains(inputs.compiler, 'lfortran') + uses: ilammy/msvc-dev-cmd@v1 diff --git a/setup-fortran.sh b/setup-fortran.sh index 0564df71..03f6c860 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -397,21 +397,6 @@ install_intel_apt() fi source /opt/intel/oneapi/setvars.sh - - 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 } @@ -452,7 +437,7 @@ install_intel_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_HPCKIT_URL=https:/registrationcenter-download.intel.com/akdlm/IRC_NAS/a99cb1c5-5af6-4824-9811-ae172d24e594/m_HPCKit_p_2023.1.0.44543.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_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/edb4dc2f-266f-47f2-8d56-21bc7764e119/m_HPCKit_p_2023.2.0.49443.dmg @@ -467,7 +452,7 @@ install_intel_dmg() 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 + 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 @@ -512,17 +497,6 @@ install_intel_dmg() rm m_HPCKit.dmg source /opt/intel/oneapi/setvars.sh - - 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 } @@ -693,3 +667,60 @@ install_nvidiahpc() export CC="nvc" export CXX="nvc++" } + +install_lfortran_l() +{ + local version=$1 + export CC="gcc" + export CXX="g++" + export CONDA=conda + $CONDA install -c conda-forge -n base -y lfortran=$version +} + +install_lfortran_w() +{ + local version=$1 + export CC="cl" + export CXX="cl" + export CONDA=$CONDA\\Scripts\\conda # https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#environment-variables + $CONDA install -c conda-forge -n base -y lfortran=$version +} + +install_lfortran_m() +{ + local version=$1 + export CC="gcc" + export CXX="g++" + export CONDA_ROOT_PREFIX=$MAMBA_ROOT_PREFIX + export CONDA=micromamba + $CONDA install -c conda-forge -n base -y lfortran=$version +} + +install_lfortran() +{ + local platform=$1 + case $platform in + linux*) + install_lfortran_l $version + ;; + darwin*) + install_lfortran_m $version + ;; + mingw*) + install_lfortran_w $version + ;; + msys*) + install_lfortran_w $version + ;; + cygwin*) + install_lfortran_w $version + ;; + *) + echo "Unsupported platform: $platform" + exit 1 + ;; + esac + + echo $($CONDA run -n base which lfortran | sed 's/lfortran//') >> $GITHUB_PATH + export FC="lfortran" +}