Installing Fortran compilers and related tools on Linux and macOS

The Fortran-lang site discusses how to install gfortran on Linux. A user may want additional tools. Below is a list of projects, from my Fortran tools list, that provide a development environment for Fortran programmers for Linux and in some cases macOS and Windows also. I mostly use Windows and have not tried them. If there is a consensus that one or more of these projects is a good way to set up a development environment, they could be mentioned on Fortran-lang.

allgebra: docker images for developing C++ and Fortran HPC programs, by termoshtt and t-hishinuma

fortran-dev-image: image contains recent versions of compilers, MPI and HDF5 libraries along with basic build tools (CMake, Ninja), by HĂĄkon Strandenes. These images can then be used to compile Fortran applications that depend on MPI and HDF5.

fortran-setup: script to set up a system to use Fortran on an Ubuntu-based system, by Federico E. Benelli. It installs a Python package manager for some Python-based tools, gfortran, optionally Intel oneAPI HPC, BLAS and LAPACK, gdb, fuzzy-finder (fzf), Fortran Package Manager (fpm), findent, flinter, FORD, fortls, and fortran_project, a script to generate and open projects.

modern-fortran-docker: Dockerfile to build a modern-fortran Docker image. It is based on Ubuntu 23.10, which has several enhancements to the Linux kernel and supports GCC GFortran v13.2.0. This Dockerfile installs gfortran, OpenMPI, and OpenCoarrays and also git clones the modern-fortran projects.

setup-fortran: GitHub action to set up Fortran compiler and toolchain on Ubuntu, macOS and Windows, from fortran-lang. Available compilers are gfortran, ifx, ifort, lfortran, and nvfortran.

3 Likes

It would be so nice if fortran playground was functional and provided an fpm environment set up with BLAS, LAPACK, HDF5 …

In lieue of that support of a CD/CI script for github, gitlab, … that you could just use that would automatically build an fpm project and run “fpm test” would be useful, I think. Sounds like that might just be a tweek of modern-fortran-docker(?). Or is that included in “modern-fortran projects”?

For interactive CLI usage i hope the M_intrinsics command fpm-man might be useful; and for the ULS (Unix-like Systems) hopefully the command man-pages would be even better, with descriptions of the Fortran intrinsics; albeit I admit to a bias on that one.

A nice list worth investigating further. Thanks!