Gfortran on Windows for classroom setting

Now opencoarray also supports Windows-gfortran. With the support of Intel oneAPI mpi^3.0, this is a new feature that was implemented in the first half of this year. I have successfully tested it before, but I have no need to actually use mpi/coarray.

1 Like

We just finished a MOM6 workshop and many Windows users successfully used Ubuntu WSL, which did not require Conda.

It was the Macs which gave us the most trouble, especially from undesired Conda-Homebrew interaction. Windows and Linux were mostly pain free.

1 Like

I use a macOS and I do not use Homebrew, as it sets up all kinds of stuff systemwide. The GFortran in conda-forge segfaults sometimes. I install GFortran using Spack, and that seems to work pretty well.

I just started using Homebrew a few months ago on Macs. Before that, for the past 20 years, I have been using the fink package manager. Homebrew on Apple arm64 hardware installs in its own place within /opt. Homebrew on intel hardware installs in /usr. I much prefer the former, even though you need to change PATH.

2 Likes

FYI: It turns out, the Fortran Playground was perfect for this. Obviously, not ideal for anything complicated, but for showing beginners basic stuff, it was great!

3 Likes

Note for future readers of this thread: I just discovered that this channel:

https://anaconda.org/conda-forge/gfortran

now has up to date windows binaries for Gfortran! Thanks to whoever did this!

3 Likes

I have been using the gfortran binaries from equation.com for years. Besides version 12 there is currently a snapshot of version 15.

I have used it for many years too. It is easy to use. Don’t need to learn new things like mysys2.

The issue with that is who is maintaining that site? In 2024, it seems a little sketchy to be downloading compilers from some random website. :slight_smile: Having the native binaries in conda-forge for all the important platforms now means I don’t need any special environment or install procedure just for Windows, since i’m using conda anyway.

Some people don’t like Equation due to that concern. But the solution is good from an early time.

lkedward’s Quickstart Fortran is also simple to use.

Rtools from the R team “consists of Msys2 build tools, GCC 13/MinGW-w64 compiler toolchain”. It currently include gfortran 13.2.0, works fine on my Windows PC, and did not require administrator privileges to install.

Also note that GFortran in Fortran Wiki recommands Quickstart Fortran (as mentionned above), and GitHub - skeeto/w64devkit: Portable C and C++ Development Kit for x64 (and x86) Windows, which I personally use with great satisfaction. Just unzip and you’re good to go.

(Off-topic: I recently discovered this very nice tool to simplify switching between different versions of compiler or toolchain: Environment Modules — Modules documentation)

1 Like