diff --git a/.github/actions/test-cc/action.yml b/.github/actions/test-cc/action.yml index b6dceb7..77920fd 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 7e6c826..5793c6c 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 bca4e9e..2d7212f 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 @@ -60,7 +63,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 @@ -75,7 +78,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 5c8264f..c1702bb 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.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,✓,✓,✓,✓,,✓,✓,,✓,,,,,✓,,✓,✓,✓,,,,,,,✓,,✓,✓,✓,✓,✓,,,,,,,, +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,lfortran,lfortran,lfortran,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,0.31.0,0.32.0,0.33.0,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 652e5b4..a18ecc0 100644 --- a/.github/compat/long_compat.csv +++ b/.github/compat/long_compat.csv @@ -1,24 +1,4 @@ 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,✓ @@ -39,6 +19,9 @@ 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,✓ @@ -59,6 +42,9 @@ 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,✓ ubuntu-20.04,gcc,10,✓ ubuntu-20.04,gcc,11,✓ ubuntu-20.04,gcc,12, @@ -70,6 +56,9 @@ ubuntu-20.04,gcc,9,✓ macos-14,gcc,11,✓ macos-14,gcc,12,✓ macos-14,gcc,13,✓ +macos-14,lfortran,0.31.0,✓ +macos-14,lfortran,0.32.0,✓ +macos-14,lfortran,0.33.0,✓ ubuntu-20.04,intel-classic,2021.1.2,✓ ubuntu-20.04,intel-classic,2021.1,✓ ubuntu-20.04,intel-classic,2021.10,✓ @@ -106,6 +95,9 @@ ubuntu-20.04,nvidia-hpc,23.3,✓ ubuntu-20.04,nvidia-hpc,23.5,✓ ubuntu-20.04,nvidia-hpc,23.7,✓ ubuntu-20.04,nvidia-hpc,23.9,✓ +ubuntu-20.04,lfortran,0.31.0,✓ +ubuntu-20.04,lfortran,0.32.0,✓ +ubuntu-20.04,lfortran,0.33.0,✓ ubuntu-22.04,gcc,10,✓ ubuntu-22.04,gcc,11,✓ ubuntu-22.04,gcc,12,✓ @@ -150,6 +142,9 @@ ubuntu-22.04,nvidia-hpc,23.3,✓ ubuntu-22.04,nvidia-hpc,23.5,✓ ubuntu-22.04,nvidia-hpc,23.7,✓ ubuntu-22.04,nvidia-hpc,23.9,✓ +ubuntu-22.04,lfortran,0.31.0,✓ +ubuntu-22.04,lfortran,0.32.0,✓ +ubuntu-22.04,lfortran,0.33.0,✓ windows-2019,gcc,10,✓ windows-2019,gcc,11,✓ windows-2019,gcc,12,✓ @@ -182,6 +177,9 @@ 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,✓ @@ -214,3 +212,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,✓ \ No newline at end of file diff --git a/.github/compat/matrix.yml b/.github/compat/matrix.yml index c8a8ea8..f81d649 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/README.md b/README.md index 5e96cb0..73b47bb 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,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 @@ -103,15 +103,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 | 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-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 | lfortran 0.31.0 | lfortran 0.32.0 | lfortran 0.33.0 | 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 e34828c..85227f1 100644 --- a/action.yml +++ b/action.yml @@ -42,6 +42,12 @@ runs: path: ${{ env.ONEAPI_ROOT }} key: ${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.version }}-${{ steps.get-date.outputs.date }} + - 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 @@ -79,6 +85,10 @@ runs: version=${VERSION:-23.11} install_nvidiahpc $platform ;; + lfortran) + version=${VERSION:-0.30.0} + install_lfortran $platform + ;; *) exit 1 ;; @@ -139,9 +149,12 @@ 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 fee56a0..14c3307 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -591,3 +591,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" +} \ No newline at end of file