# 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:** 2

<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 20, 2021, 10:49am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/21 "2021-11-20T10:49:06Z")

</div>

> [@band-a-prend](#):
>
> I didn’t try it yet, does the “toolchain” contain gcc,g++ and OpenMP as well?

Yes it does 🙂

---

<div class="post-metadata">

**Author:** ![wyphan](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/wyphan/32/632_2.png) [@wyphan](https://fortran-lang.discourse.group/u/wyphan)\
**Post date:** [November 23, 2021, 3:09am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/22 "2021-11-23T03:09:48Z")

</div>

> [@lkedward](#):
>
> MPI 3 implementation for which there isn’t one available on Windows

Interesting, not even [MS-MPI](https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi)?

---

<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 23, 2021, 6:39am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/23 "2021-11-23T06:39:16Z")

</div>

Unfortunately MS-MPI only supports [a subset of MPI 3 features](https://github.com/Microsoft/Microsoft-MPI#version-of-MPI-standard). I’m not sure which MPI 3 features OpenCoarrays needs, but my attempt to compile it against MS-MPI was failing about 30% of the included testsuite.

---

<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 24, 2021, 1:35am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/24 "2021-11-24T01:35:33Z")

</div>

Intel MPI supports MPI 3.1 on Windows. It is free (part of the Intel oneAPI HPC Toolkit, along with the Intel Fortran compiler.)

---

<div class="post-metadata">

**Author:** ![Ashok](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Ashok](https://fortran-lang.discourse.group/u/Ashok)\
**Post date:** [November 28, 2021, 11:38am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/25 "2021-11-28T11:38:43Z")

</div>

I have installed stdlib using `setup-stdlib` command.  
Now how to use it in my projects with fpm ?  
I have started using fpm using [these](https://awvwgk.github.io/fpm-docs/en/tutorial/hello-fpm.html) steps.  
Now how can I use stdlib modules inside my `first_steps\app\main.f90` file and use `fpm run`?

---

<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 28, 2021, 11:57am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/26 "2021-11-28T11:57:09Z")

</div>

You can use any module from here:

[https://stdlib.fortran-lang.org/](https://stdlib.fortran-lang.org/)

But it would be nice to document exactly how you add it as a dependency into `fpm.toml` and show some examples of usage.

@Ashok after you figure out the details, would you mind submitting a PR against the stdlib documentation to document it please?

---

<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 28, 2021, 12:20pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/27 "2021-11-28T12:20:39Z")

</div>

Hi @Ashok,

You have two choices for using `stdlib` with _fpm_ in the quickstart-fortran environment:

## 1. Use `stdlib` as a fpm dependency (recommended)

Add the following to your `fpm.toml` file:

```toml
[dependencies]
stdlib = { git="https://github.com/fortran-lang/stdlib", branch="stdlib-fpm" }

```

and you can immediately start using any `stdlib` module in your package.

This option will build `stdlib` for each _fpm_ project you start which has a few advantages:

- It allows specifying a particular version of `stdlib`;
- It allows you to use multiple compilers

(Building `stdlib` is a bit slow, but you only have to do it once for each _fpm_ project!)

## 2. Use the globally-installed `stdlib`

The `setup-stdlib` script is provided for those who want a global installation of `stdlib`, such as for use with other build systems. (This also means you only have to build `stdlib` once.)

If you want to use this with _fpm_, add the following to your `fpm.toml` file:

```toml
[build]
link = "stdlib"
external-modules = ["stdlib_sorting", "stdlib_logger"] # Your used modules here

```

where **you need to add any `stdlib` modules that you use to the `external-modules` field**.

If you install `stdlib` globally, it will only work with the `gfortran` installation that comes with quickstart-fortran, and not with any other compiler like Intel OneAPI.

---

<div class="post-metadata">

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

</div>

> [@Ashok](#):
>
> I have started using fpm using [these](https://awvwgk.github.io/fpm-docs/en/tutorial/hello-fpm.html) steps.  
> Now how can I use stdlib modules inside my `first_steps\app\main.f90` file and use `fpm run` ?

Thanks for testing the new docs. I’m currently writing the second tutorial for using dependencies, like stdlib, with fpm. If you have further suggestion, for any tutorials we should write and include in fpm’s documentation, feel free to post them here:

> <https://github.com/awvwgk/fpm-docs/pull/6>
>
> See \[Commits\](/awvwgk/fpm-docs/pull/6/commits) and \[Changes\](/awvwgk/fpm-docs/pu…ll/6/files) for more details.
> 
> \-----
> Created by \[\<img src="https://prod.download/pull-18h-svg" valign="bottom"/\> \*\*pull\[bot\]\*\*\](https://github.com/wei/pull)
> 
> \_Can you help keep this open source service alive? \*\*\[💖 Please sponsor : )\](https://prod.download/pull-pr-sponsor)\*\*\_

---

<div class="post-metadata">

**Author:** ![Ashok](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Ashok](https://fortran-lang.discourse.group/u/Ashok)\
**Post date:** [November 28, 2021, 3:07pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/29 "2021-11-28T15:07:14Z")

</div>

Thanks a lot.  
1 worked. 2 is not working for me.

---

<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 28, 2021, 3:29pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/30 "2021-11-28T15:29:16Z")

</div>

I’ve now updated the Quickstart Fortran installer to install _fpm_ with parallel builds enabled. This will speedup builds on multicore machines when using big dependencies like `stdlib`.

* * *

> [@Ashok](#):
>
> 2 is not working for me.

What was the error when you tried this?

---

<div class="post-metadata">

**Author:** ![Ashok](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Ashok](https://fortran-lang.discourse.group/u/Ashok)\
**Post date:** [November 28, 2021, 3:44pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/31 "2021-11-28T15:44:13Z")

</div>

Thank you so much for writing that documentation.  
The first tutorial is great. It would be nice to demonstrate similarly (short tutorials) how to use custom directories for fpm. Right now there are src, app and build directories. But how we can have our own directory names for - where we want the modules to be, where we want the i/o files to be…  
Right now I think you have already put than in the reference section, some tutorials on that may help. As I use more I will let you know.

---

<div class="post-metadata">

**Author:** ![Ashok](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Ashok](https://fortran-lang.discourse.group/u/Ashok)\
**Post date:** [November 28, 2021, 3:57pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/32 "2021-11-28T15:57:58Z")

</div>

/usr/lib/gcc/x86\_64-pc-cygwin/11/…/…/…/…/x86\_64-pc-cygwin/bin/ld: cannot find -lstdlib  
collect2: error: ld returned 1 exit status  
 Compilation failed for object " first\_steps.exe "  
stopping due to failed compilation  
STOP 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 29, 2021, 9:35am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/33 "2021-11-29T09:35:15Z")

</div>

Ah okay thanks; it looks like that is a different compiler installation (cygwin?) to the one provided with the quickstart installer. (The `setup-stdlib` script only installs `stdlib` for the gcc/gfortran that comes with the quickstart installer).

Glad the first method is working for you — this is the preferred approach since it doesn’t have these limitations.

---

<div class="post-metadata">

**Author:** ![Ashok](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Ashok](https://fortran-lang.discourse.group/u/Ashok)\
**Post date:** [November 29, 2021, 9:44am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/34 "2021-11-29T09:44:30Z")

</div>

Yeah, I have previously installed cygwin.  
Thank you.

---

<div class="post-metadata">

**Author:** ![nshaffer](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/nshaffer/32/161_2.png) [@nshaffer](https://fortran-lang.discourse.group/u/nshaffer)\
**Post date:** [March 23, 2022, 4:40pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/35 "2022-03-23T16:40:19Z")

</div>

This installer is great! However, I am running into a permissions issue. When I try to run executables, I get an error message

```nohighlight
W:\nsha\Documents\milne> fpm run --example ex1
Access is denied.
<ERROR> Execution failed for object " ex1.exe "
<ERROR>*cmd_run*:stopping due to failed executions
STOP 1

```

I am not very Windows-literate, but is there some configuration that I missed? A relevant detail may be that this is a managed machine, not a personal one.

Edit: And now I can run executables, with no apparent intervention on my part. Very odd, Windows…  
Edit2: And now I’m being blocked again. Maybe this is a question for my sysadmin…

---

<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:** [March 24, 2022, 8:43am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/36 "2022-03-24T08:43:36Z")

</div>

Thanks for the feedback @nshaffer - I’ve not come across this issue before.

I’ve been able to reproduce the same error when running fpm on a network drive. I think this may be a Windows permissions problem with executing code off network shares. Have you tried running the executable from Windows explorer? (it should be in `build/gfortran_*/example` or similar ).

---

<div class="post-metadata">

**Author:** ![nshaffer](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/nshaffer/32/161_2.png) [@nshaffer](https://fortran-lang.discourse.group/u/nshaffer)\
**Post date:** [March 24, 2022, 4:14pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/37 "2022-03-24T16:14:06Z")

</div>

Thanks for confirming. I don’t fully understand what’s going on, but it’s definitely related to the network drive (running from File Explorer doesn’t help). If I move the whole project to a local folder on my C: drive, everything “just works”. So maybe that’s the workaround going forward.

---

<div class="post-metadata">

**Author:** ![CRquantum](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/crquantum/32/730_2.png) [@CRquantum](https://fortran-lang.discourse.group/u/CRquantum)\
**Post date:** [March 25, 2022, 3:04am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/38 "2022-03-25T03:04:44Z")

</div>

Cool! @lkedward , is it possible to include mpich or openmpi in this installer too?

I mean, on linux one only need

```auto
sudo apt install gfortran mpich

```

Then gfortran and mpi automatically installed, and mpif90 will immediately work.  
In windows I always wish there is a similar thing. If after installing this on windows, gfortran + mpi can work it will be really nice!

For my personal research it does not matter, I can always install Intel OneAPI or gfortran and mpi. But if I were to use Fortran + MPI to develop a package and let user to use it, then having gfortran + mpi easily already configured on the users’ windows computer would be very nice:)

---

<div class="post-metadata">

**Author:** ![fortran4r](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@fortran4r](https://fortran-lang.discourse.group/u/fortran4r)\
**Post date:** [March 25, 2022, 4:11am UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/39 "2022-03-25T04:11:31Z")

</div>

It would be great if this Quickstart Fortran could be bundled to Code::Blocks for Fortran. That will make it something similar to Matlab, a one-stop software solution.

---

<div class="post-metadata">

**Author:** ![tomohirodegawa](https://avatars.discourse-cdn.com/v4/letter/t/51bf81/32.png) [@tomohirodegawa](https://fortran-lang.discourse.group/u/tomohirodegawa)\
**Post date:** [March 28, 2022, 1:04pm UTC](https://fortran-lang.discourse.group/t/quickstart-fortran-installer-for-windows/2270/40 "2022-03-28T13:04:08Z")

</div>

I’d like to share a pitfall I fell when I switched to Quickstart Fortran from another gfortran environment.

I used to use [TDM-GCC-64](https://jmeubank.github.io/tdm-gcc/) and switched to Quickstart Fortran.  
After switching, when executed binaries built using TDM-GCC-64, an error occurred. The error dialog said libgfortran\_64-5.dll is not found. It exists in TDM-GCC-64, but it does not in MinGW-w64 bundled with Quickstart Fortran.

I had to rebuild binaries and libraries I had built using TDM-GCC-64 to fix this error.

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

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