Motivated by several recent discussions for installing and building on Windows, I’ve put together a ‘Quickstart Fortran’ Installer for Windows which includes: GCC-Gfortran, fpm, Git and OpenBLAS (BLAS/LAPACK).
The installation also contains a helper script to fetch, build and install the latest version of stdlib.
The installer is aimed at beginners or those not familiar with MSYS2 or WSL.
Please try it out if you are a Windows user and let me know how you find it - feedback is welcome.
Some ideas for the future:
Include LFortran compiler as well
Make it an online installer (currently 244MB download)
Moving it to Fortran-lang is a great idea, or if not, adding more people as maintainers to bring longevity to the project with continuous updates. Otherwise, an automated workflow could be set up to release a new version of installation binary with every new version release of its components (gfortran, fpm, OpenBLAS, …), although I am not sure if that is possible.
I don’t use Powershell, so I didn’t think about this. If you select ‘Add to path’ when installing, then it should work when you start Powershell. Otherwise, you could start Powershell from the Quickstart Fortran command prompt shortcut. Perhaps it should also install a Powershell prompt shortcut as well?
When I’m coding on Windows I use CMD and can run the Windows equivalents (findstr, cd, mkdir, del etc.) of Unix commands, Fortran compilers, Python and R, etc. I know that Powershell is Microsoft’s modern shell, but what does it offer scientific programmers? Please excuse the digression.
I don’t think an additional Powershell shortcut is that helpful. Your suggestion works, after opening the Quickstart-Fortran command prompt, I can run the command powershell to switch the shell.
My suggestion for a future extension of the package is to also include options for MPICH, OpenMPI, and OpenCoarrays (and possibly even Intel Fortran Compilers and MPI library, although I am not sure how the licensing would work, but I think it should be fine since this is just a redistribution convenience without touching the Intel products in any way, perhaps like redistributing their runtime libraries).
Regarding OpenCoarrays, is it still true that this functionality requires WSL, as written in Setting up your OS? The Opencoarrays documentation for Windows provides a link to a script for use in an existing WSL installation (and with a rather old GCC).
If meanwhile it has become possible to set up OpenCoarrays in Windows without depending on WSL, then I think it could be a valuable extension to the installer. In that case, I could help with testing.
Yes, I agree this would be a good addition. Unfortunately as far as I know, and as @S.G.Janssens points out, I think OpenCoarrays still isn’t possible on native Windows because it needs an MPI 3 implementation for which there isn’t one available on Windows.
This installed easily for me (once I reassured both the browser and Windows that it was OK to keep and run). I would ask that the shortcut be modified so that it specifies the path to init.bat in the command to execute and that init.bat itself not rely on the current directory. I like to change shortcuts to specify a “Start in” folder of my work folder. What you have now assumes that the installation folder will be used, and then at the end does a cd to the user’s Documents area. I think you can use %~dp0 to get the path to the folder containing the currently executing .bat file. (See What does %~d0 mean in a Windows batch file? - Stack Overflow)
The WinLibs version of mingw64-gcc that I’ve used actually includes GNU make v4.3 but it’s called mingw32-make:
C:\> mingw32-make --version
GNU Make 4.3
Built for x86_64-w64-mingw32
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
I could perhaps create a helper script to alias it to make. Also worth mentioning in the README.
Looks great! Especially thank you for offline installer as currently mingw64 didn’t update their offline tarballs for a long time. I hope offline installer will be presented further.
I didn’t try it yet, does the “toolchain” contain gcc,g++ and OpenMP as well?