Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

setup-fortran-conda

GitHub Marketplace CI Distribution Documentation Release License

Configure supported Fortran toolchains with matching C and C++ compilers on Ubuntu, macOS and Windows. The action also installs build tools and supports optional MPI toolchains, additional Conda packages, documentation generation, linting and repository status automation. Inspired by Conda + Fortran.

Quick start

The action checks out the repository and installs fpm, CMake, Ninja, Meson and pkg-config by default.

name: test

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: gha3mi/setup-fortran-conda@latest
        with:
          compiler: gfortran

      - run: fpm test --compiler "${{ env.FPM_FC }}"

Compiler environment

The action configures the following matching Fortran, C and C++ compilers.

Runner Fortran C C++
Ubuntu GNU Fortran GNU C GNU C++
Ubuntu Intel Fortran Intel oneAPI DPC++/C++ Intel oneAPI DPC++/C++
Ubuntu LFortran Clang Clang
Ubuntu LLVM Flang Clang Clang
Ubuntu NVIDIA HPC SDK Fortran NVIDIA HPC SDK C NVIDIA HPC SDK C++
Ubuntu AOCC (Flang) AOCC (Clang) AOCC (Clang)
Ubuntu AOMP (Flang) AOMP (Clang) AOMP (Clang)
macOS GNU Fortran GNU C GNU C++
macOS LFortran Clang Clang
Windows GNU Fortran GNU C GNU C++
Windows Intel Fortran Intel oneAPI DPC++/C++ Intel oneAPI DPC++/C++
Windows LFortran Clang Clang
Windows LLVM Flang Clang Clang

The selected compiler commands are exported as environment variables for subsequent workflow steps.

Language General fpm CMake
Fortran FC FPM_FC CMAKE_Fortran_COMPILER
C CC FPM_CC CMAKE_C_COMPILER
C++ CXX FPM_CXX CMAKE_CXX_COMPILER

Documentation

CI status

OS Compiler Version MPI MPI Version fpm cmake meson
ubuntu 24.04 aocc 5.2.0 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
ubuntu 24.04 aomp 23.0-0 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
ubuntu 24.04 flang-new 22.1.8 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
ubuntu 24.04 gfortran 16.1.0 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
ubuntu 24.04 gfortran 16.1.0 mpich 5.0.1 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
ubuntu 24.04 gfortran 16.1.0 openmpi 5.0.10 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
ubuntu 24.04 ifx 2026.1.1 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
ubuntu 24.04 ifx 2026.1.1 intelmpi 2021.18.1 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
ubuntu 24.04 lfortran 0.64.0 0.12.0 ✅ 4.4.2 ✅
ubuntu 24.04 nvfortran 26.5 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
ubuntu 24.04 nvfortran 26.5 hpcx 2.50 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
macos 26 gfortran 16.1.0 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
macos 26 gfortran 16.1.0 mpich 5.0.1 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
macos 26 gfortran 16.1.0 openmpi 5.0.10 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
macos 26 lfortran 0.64.0 0.12.0 ✅ 4.4.2 ✅
windows 2025 flang-new 22.1.8 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
windows 2025 gfortran 16.1.0 0.13.0 ✅ 4.4.2 ✅ 1.12.0 ✅
windows 2025 ifx 2026.1.1 0.12.0 ✅ 4.4.2 ✅ 1.12.0 ✅
windows 2025 ifx 2026.1.1 intelmpi 2021.18.1 0.12.0 ✅ 4.4.2 ✅ 1.12.0 ✅
windows 2025 lfortran 0.64.0 0.12.0 ✅ 4.4.2 ✅

Project

Related