# Quickstart Fortran Installer for Windows

**URL:** <https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270>\
**Category:** Announcements\
**Created:** [November 15, 2021, 7:00am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270 "2021-11-15T07:00:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkedward](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/lkedward/32/72_2.png) [@lkedward](https://fortran-lang.discourse.group/u/lkedward)\
**Post date:** [November 15, 2021, 7:00am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/1 "2021-11-15T07:00:43Z")

</div>

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`.

> **[GitHub - LKedward/quickstart-fortran: An easy Windows installer for GFortran...](https://github.com/LKedward/quickstart-fortran)**
>
> An easy Windows installer for GFortran and the Fortran Package Manager - GitHub - LKedward/quickstart-fortran: An easy Windows installer for GFortran and the Fortran Package Manager

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)
- Make a lightweight installer for _fpm_ only  
([Creating Windows installer for fpm · Issue #580 · fortran-lang/fpm · GitHub](https://github.com/fortran-lang/fpm/issues/580))
- Move under Fortran-Lang and promote to new users on [fortran-lang.org](http://fortran-lang.org)?

---

<div class="post-metadata">

**Author:** ![shahmoradi](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/shahmoradi/32/3151_2.png) [@shahmoradi](https://fortran-lang.discourse.group/u/shahmoradi)\
**Post date:** [November 15, 2021, 7:29am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/2 "2021-11-15T07:29:10Z")

</div>

Impressive.

---

<div class="post-metadata">

**Author:** ![shahmoradi](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/shahmoradi/32/3151_2.png) [@shahmoradi](https://fortran-lang.discourse.group/u/shahmoradi)\
**Post date:** [November 15, 2021, 7:34am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/3 "2021-11-15T07:34:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [November 15, 2021, 10:20am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/4 "2021-11-15T10:20:35Z")

</div>

Just tested it and works like a charm. 🚀

Also nice to see the Fortran logo as the desktop shortcut.

Is there a way to load the path variables in a Powershell window?

---

<div class="post-metadata">

**Author:** ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)\
**Post date:** [November 15, 2021, 1:17pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/5 "2021-11-15T13:17:36Z")

</div>

Absolutely brilliant!

---

<div class="post-metadata">

**Author:** ![lkedward](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/lkedward/32/72_2.png) [@lkedward](https://fortran-lang.discourse.group/u/lkedward)\
**Post date:** [November 15, 2021, 2:17pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/6 "2021-11-15T14:17:17Z")

</div>

> [@ivanpribec](#):
>
> Is there a way to load the path variables in a Powershell window?

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?

---

<div class="post-metadata">

**Author:** ![milancurcic](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/milancurcic/32/2_2.png) [@milancurcic](https://fortran-lang.discourse.group/u/milancurcic)\
**Post date:** [November 15, 2021, 3:56pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/7 "2021-11-15T15:56:49Z")

</div>

Thank you, Laurence. This makes me want to get a Windows computer just to try it.

---

<div class="post-metadata">

**Author:** ![nbehrnd](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nbehrnd](https://fortran-lang.discourse.group/u/nbehrnd)\
**Post date:** [November 15, 2021, 4:00pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/8 "2021-11-15T16:00:31Z")

</div>

That’s like TUG’s TeX Collection DVD including [proTeXt](https://www.tug.org/protext/) ready to go. Great!

---

<div class="post-metadata">

**Author:** ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)\
**Post date:** [November 15, 2021, 4:13pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/9 "2021-11-15T16:13:43Z")

</div>

> [@ivanpribec](#):
>
> Is there a way to load the path variables in a Powershell window?

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.

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [November 15, 2021, 5:57pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/10 "2021-11-15T17:57:16Z")

</div>

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.

The commands

```auto
PS C:\Users\ipribec\Documents> Get-Command fpm
PS C:\Users\ipribec\Documents> Get-Command gfortran

```

show the locations of the installed executables (in regular Windows cmd use `where`).

---

<div class="post-metadata">

**Author:** ![shahmoradi](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/shahmoradi/32/3151_2.png) [@shahmoradi](https://fortran-lang.discourse.group/u/shahmoradi)\
**Post date:** [November 15, 2021, 6:58pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/11 "2021-11-15T18:58:53Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![S.G.Janssens](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@S.G.Janssens](https://fortran-lang.discourse.group/u/S.G.Janssens)\
**Post date:** [November 16, 2021, 11:01am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/12 "2021-11-16T11:01:23Z")

</div>

Thank you very much for this initiative.

> [@shahmoradi](#):
>
> My suggestion for a future extension of the package is to also include options for MPICH, OpenMPI, and OpenCoarrays

Regarding OpenCoarrays, is it still true that this functionality requires WSL, as written in [Setting up your OS](https://fortran-lang.org/learn/os_setup/install_gfortran#opencoarrays)? The Opencoarrays [documentation for Windows](https://github.com/sourceryinstitute/OpenCoarrays/blob/master/INSTALL.md#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.

---

<div class="post-metadata">

**Author:** ![lkedward](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/lkedward/32/72_2.png) [@lkedward](https://fortran-lang.discourse.group/u/lkedward)\
**Post date:** [November 16, 2021, 12:07pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/13 "2021-11-16T12:07:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sblionel](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/sblionel/32/853_2.png) [@sblionel](https://fortran-lang.discourse.group/u/sblionel)\
**Post date:** [November 16, 2021, 3:24pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/14 "2021-11-16T15:24:42Z")

</div>

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](https://stackoverflow.com/questions/112055/what-does-d0-mean-in-a-windows-batch-file))

---

<div class="post-metadata">

**Author:** ![lkedward](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/lkedward/32/72_2.png) [@lkedward](https://fortran-lang.discourse.group/u/lkedward)\
**Post date:** [November 16, 2021, 4:36pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/15 "2021-11-16T16:36:47Z")

</div>

Thanks for the feedback @sblionel! It’s useful to know what kind of workflow people use on Windows.  
I’ve updated the bat scripts accordingly, see here for the changes: [Update: to not rely on launch folder. · LKedward/quickstart-fortran@a1358c8 (github.com)](https://github.com/LKedward/quickstart-fortran/commit/a1358c881878fc87bb490d5e347b39fa38b606c9).

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [November 16, 2021, 4:52pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/16 "2021-11-16T16:52:34Z")

</div>

Thanks @sblionel for trying that and for providing feedback!

---

<div class="post-metadata">

**Author:** ![sblionel](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/sblionel/32/853_2.png) [@sblionel](https://fortran-lang.discourse.group/u/sblionel)\
**Post date:** [November 16, 2021, 5:46pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/17 "2021-11-16T17:46:03Z")

</div>

@lkedward , looks good. Thanks!

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [November 18, 2021, 12:55pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/18 "2021-11-18T12:55:52Z")

</div>

I’m wondering if [GNU make for Windows](http://www.equation.com/servlet/equation.cmd?fa=make) would also be of interest?

CMake on the other hand can be downloaded and installed pretty easily from here: [Download | CMake](https://cmake.org/download/)  
In case of CMake on Windows, it might be necessary to download ninja too: [Releases · ninja-build/ninja · GitHub](https://github.com/ninja-build/ninja/releases)

Make could be an optional components for developers. Otherwise fpm is the build system the quickstart installer should aim to promote.

Another point to mention in the FAQs, the link flag for BLAS _and_ LAPACK is `-lopenblas`?

---

<div class="post-metadata">

**Author:** ![lkedward](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/lkedward/32/72_2.png) [@lkedward](https://fortran-lang.discourse.group/u/lkedward)\
**Post date:** [November 18, 2021, 1:23pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/19 "2021-11-18T13:23:55Z")

</div>

> [@ivanpribec](#):
>
> I’m wondering if [GNU make for Windows](http://www.equation.com/servlet/equation.cmd?fa=make) would also be of interest?

The [WinLibs](https://winlibs.com/) version of mingw64-gcc that I’ve used actually includes GNU make v4.3 but it’s called `mingw32-make`:

```batch
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.

* * *

> [@ivanpribec](#):
>
> Another point to mention in the FAQs, the link flag for BLAS _and_ LAPACK is `-lopenblas` ?

Yes, good point! Cheers.

---

<div class="post-metadata">

**Author:** ![band-a-prend](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@band-a-prend](https://fortran-lang.discourse.group/u/band-a-prend)\
**Post date:** [November 19, 2021, 8:53pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/20 "2021-11-19T20:53:06Z")

</div>

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?

[Next page](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270.md?page=2)
