# Fpm-0.4.0 released

**URL:** <https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752>\
**Category:** Announcements\
**Created:** [August 27, 2021, 2:52pm UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752 "2021-08-27T14:52:51Z")\
**Posts on this page:** 13\
**Page:** 1

<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:** [August 27, 2021, 2:52pm UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/1 "2021-08-27T14:52:51Z")

</div>

> **[Release Fpm alpha release 0.4.0 · fortran-lang/fpm](https://github.com/fortran-lang/fpm/releases/tag/v0.4.0)**
>
> Alpha release update for the Fortran package manager (fpm).
> Changes
> 
> 
> bootstrap script is now based on 0.3.0 (#504)
> 
> 
> executable, example and test names are checked to contain only alphanumeric cha...

Congratulations and thanks to the maintainers and contributors for another great release!

---

<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:** [August 28, 2021, 12:41pm UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/2 "2021-08-28T12:41:35Z")

</div>

New version is already up on conda-forge for Linux (x86\_64, ppc64le and aarch64) and MacOS (x86\_64 and aarch64):

```nohighlight
conda create -n fpm-0.4.0 fpm
conda activate fpm-0.4.0

```

I also updated my homebrew tap for fpm:

```nohighlight
brew tap awvwgk/fpm
brew install fpm

```

Still have to update my fpm `PKGBUILD` for MSYS2.

---

<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:** [August 28, 2021, 2:27pm UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/3 "2021-08-28T14:27:02Z")

</div>

Just a note that the macOS / ARM version does not work: [Fails to run on macOS / ARM · Issue #7 · conda-forge/fpm-feedstock · GitHub](https://github.com/conda-forge/fpm-feedstock/issues/7).

If anybody has time to investigate, that would be awesome.

---

<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:** [August 28, 2021, 2:54pm UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/4 "2021-08-28T14:54:47Z")

</div>

I think this is a good time to get fpm into a package manager for Windows, conda-forge is currently lacking a bit on this side, therefore I submitted my [MinGW PKGBUILD](https://github.com/awvwgk/mingw-w64-fpm-pkgbuild) to the MSYS2 repository:

> <https://github.com/msys2/MINGW-packages/pull/9481>
>
> This PR adds a PKGBUILD for the Fortran package manager (\[fpm\](https://github.co…m/fortran-lang/fpm)) a build system for Fortran projects.
> 
> Works with mingw32, mingw64 and ucrt64, but can't build with clang64 or clang32 due to missing \`mingw-w64-\*-gcc-fortran\` make dependency.

* * *

Similarly, we could think about contributing a formula for fpm to [homebrew-core](https://github.com/homebrew/homebrew-core), this would provide a natively built MacOS/ARM binary as well. While I’m maintaining a tap for fpm, I’m not really interested in contributing to [homebrew-core](https://github.com/homebrew/homebrew-core), since I’m not actually a user of brew. Do we have Mac users here, which are using brew and are interested in contributing there?

---

<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:** [August 28, 2021, 4:55pm UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/5 "2021-08-28T16:55:10Z")

</div>

Perfect! I was investigating how to install fpm on Windows, for now I’ll try the binary from here: [Release Fpm alpha version 0.4.0 · fortran-lang/fpm · GitHub](https://github.com/fortran-lang/fpm/releases/tag/v0.4.0) and see if everything work at the CI.

---

<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:** [September 3, 2021, 6:11am UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/6 "2021-09-03T06:11:50Z")

</div>

Fpm is now available in MSYS2 for Windows: [Base Package: mingw-w64-fpm - MSYS2 Packages](https://packages.msys2.org/base/mingw-w64-fpm). On Windows you should now be able to install fpm with pacman using:

```nohighlight
pacman -S mingw-w64-x86_64-fpm

```

For anyone interested, I described the process of packaging (with) fpm in

> **[Packaging Fpm · fortran-lang/fpm Wiki](https://github.com/fortran-lang/fpm/wiki/Packaging-Fpm#msys2-windows)**
>
> Fortran Package Manager (fpm). Contribute to fortran-lang/fpm development by creating an account on GitHub.

---

<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:** [September 6, 2021, 11:20am UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/7 "2021-09-06T11:20:01Z")

</div>

Fpm is now available in spack: [Package List — Spack 0.16.2 documentation](https://spack.readthedocs.io/en/latest/package_list.html#fpm)

From the latest spack develop version you can now

```nohighlight
spack install fpm +openmp
spack load fpm +openmp

```

---

<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:** [September 6, 2021, 2:18pm UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/8 "2021-09-06T14:18:11Z")

</div>

Thanks @awvwgk for creating the spack package! Unfortunately I can’t test it right now, as Spack does not work on my macOS ☹ ([Installation issue: gcc · Issue #25598 · spack/spack · GitHub](https://github.com/spack/spack/issues/25598)), but at least I looked how it is done. Here is the spack source code:

- [spack/package.py at ca50c9146959809b52fa4da4a833db0bb5ee4b0a · spack/spack · GitHub](https://github.com/spack/spack/blob/ca50c9146959809b52fa4da4a833db0bb5ee4b0a/var/spack/repos/builtin/packages/fpm/package.py)

It seems the main code is in `fpm` in `install.sh`:

- [fpm/install.sh at 5c908fc0157b9e3637a83dc532ab1bea4fd8b184 · fortran-lang/fpm · GitHub](https://github.com/fortran-lang/fpm/blob/5c908fc0157b9e3637a83dc532ab1bea4fd8b184/install.sh)

which uses fpm 0.3.0 that was distributed as a single file, to bootstrap the most rerent version.

I think this works for now, but I think this will eventually break once `fpm` (as a package) uses some feature not supported by the 0.3.0 version. I guess we could then do a two step bootstrap, to first bootstrap a version of `fpm` that still builds with 0.3.0, and then use that to bootstrap the latest version (or even do multiple steps).

However, I think I want to finish [Allow to generate a standalone tarball with all dependencies · Issue #123 · fortran-lang/fpm · GitHub](https://github.com/fortran-lang/fpm/issues/123), which should allow a super simple and robust bootstrap. Just a simple tarball with a cmake build system.

Alternatively, as a separate capability, being able to generate a single file (with all the dependencies correctly ordered) would also be very helpful, I think it can be done automatically. One issue is that we also require some C files to compile I believe.

But until then I think the above approach works.

---

<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:** [September 6, 2021, 2:41pm UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/9 "2021-09-06T14:41:34Z")

</div>

Bootstrapping with the single source file version seems quite robust so far and the idea is simply genius (thanks to John @urbanjost) because it reduces our dependency footprint to only a Fortran compiler (no C compiler at this stage).

Regarding the install script, we usually update the install script after the release, to use a newer single source version. Therefore, the install script will always have a “matching pair” of fpm versions that can compile each other available.

Unfortunately, we can’t yet use the same version as the release for bootstrapping, because the single source version is still created manually after the release. This should be automated, but since I have to modify the package manifest to remove all test targets before running the script this is currently not possible in an automated way. We need [Behavior of `fpm build` and `fpm test` · Issue #92 · fortran-lang/fpm · GitHub](https://github.com/fortran-lang/fpm/issues/92) resolved first.

Also, the CI testing fpm itself is still using fpm 0.2.0 for bootstrapping the latest commit, which helps to retain some backwards compatibility between the versions. Once we break this in our CI, we will notice it immediately.

In summary, I don’t see this as an issue at the moment. In the future we might adjust the install script to use another bootstrap mechanism, but as long as the script knows how to bootstrap and install fpm, we should be fine.

---

<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:** [September 7, 2021, 9:52pm UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/10 "2021-09-07T21:52:24Z")

</div>

@awvwgk we should test the single file bootstrap at our CI, using the master version of `fpm` only (use the master version to create a single file, compile, and use it to build `fpm`). As long as that works, then I think there is no problem.

---

<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:** [September 8, 2021, 7:01am UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/11 "2021-09-08T07:01:50Z")

</div>

Just setup a workflow for this at fpm:

> <https://github.com/fortran-lang/fpm/pull/563>
>
> This adds the script to generate the single source file version of fpm for boots…trapping. The following steps are used to generate the bootstrap version:
> 
> 1. remove test targets from package manifest by patch (remove after #92 is resolved)
> 2. install an existing binary of fpm
> 3. call fpm with compiler wrapper script to collect single source version
> 4. build bootstrap version from single source version
> 5. reverse patch the package manifest (remove after #92 is resolved)
> 6. build fpm using the bootstrap version
> 7. upload single source file version
> 
> Finally, the single source file version is uploaded on releases.
> 
> This patch also changes the release workflow to run on every commit, but only upload on releases. This allows to use the created artifacts from PRs to quickly bootstrap a new fpm version with some new features implemented.
> 
> Requires #560
> Closes #391

---

<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:** [September 8, 2021, 2:54pm UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/12 "2021-09-08T14:54:16Z")

</div>

@awvwgk good stuff, I already approved the PR. I think with the PR in, this bootstrap problem is completely fixed. Really well done. Thank you.

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [September 15, 2021, 9:59am UTC](https://fortran-lang.discourse.group/t/fpm-0-4-0-released/1752/13 "2021-09-15T09:59:51Z")

</div>

A great thing about fpm is that it installs in `~/.local/bin/`  
Yesterday, I tried to install it on a distant machine where I have no admin rights and it worked immediately! Although it may seem obvious for you, I was personally delighted! 🤩 That’s an important feature I was not fully aware of.
