Quickstart Fortran Installer for Windows

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:

[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:

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

3 Likes