Fpm (Fortran Package Manager) guinea pig

I decided to try fpm(1) on all the modules that the FUNIX repository needs as an experiment. I started with a single-file single-module repository M_msg(3f). FUNIX was designed as a test-bed for a few simple modules so I am hoping this will be simple. There were links to a video about fpm that seem to have expired and I cannot find a list of other github repositories that are set up with fpm. I was looking for a few working examples before I go to far down the rabbit hole. Any advice or is it even too early to try this? I wanted to set up my own testbed; as I have a lot of questions about how hard it would be to take a complex project with a lot of dependencies off-line as source onto a machine that fpm is not available for, how hard it is to set up a repository to be useable by other methods like make(1)/cmake(1) but also work with fpm(1), etc, etc, etc…

1 Like

I’ve converted all of my open source Fortran libraries to using fpm. You can find the list of them here. I would start by reading through the Packaging Guide and then just try stuff out. Feel free to come back and ask more specific questions as they come up.


Let’s start a list of packages in the fpm or related repo (fpm registry).


Agreed. Now is probably a good time. Where should we keep the list? In the fpm repo is probably fine for now, but I’m guessing it won’t be too long before we want to move it somewhere else.

I’ve tried also fpm (It’s a great idea) on test codes. However, when you want to convert a large code without the correct structure (several mains, old f77 files not in modules …), it is a rather difficult task!
Anyway, I’ll try to move some of my smaller and more recent codes with fpm.

1 Like

We should not put it in the fpm repository itself. See the related discussion at:

1 Like

Yes, you’re right, but I want to add a follow up to urbanjost post. However, some of fpm discussions are too technicals for me (the two mentioned) and I don’t really see how they are related to my comment!

I think @certik was more replying about where our list (registry) of fpm packages would go, not to your comment about trying out fpm on smaller codes.

On a side note, migrating any large package to a new build system will always be a chore. Our goal is just to try our best to make it as easy as it can be.

1 Like


July 12, 2020

Like others, I am trying out early releases of fpm (Fortran Package Manager). For the purpose of testing dependencies, and since there is not yet a central registry at https://fortran-lang.org here is a list of my public repositories that are fpm-enabled:

 M_cli         = { git = "https://github.com/urbanjost/M_cli.git"  }
 M_calculator  = { git = "https://github.com/urbanjost/M_calculator.git" }
 M_change      = { git = "https://github.com/urbanjost/M_change.git" }
 M_color       = { git = "https://github.com/urbanjost/M_color.git" }
 M_history     = { git = "https://github.com/urbanjost/M_history.git" }
 M_io          = { git = "https://github.com/urbanjost/M_io.git" }
 M_msg         = { git = "https://github.com/urbanjost/M_msg.git" }
 M_time        = { git = "https://github.com/urbanjost/M_time.git" }
 M_process     = { git = "https://github.com/urbanjost/M_process.git" }
 M_strings     = { git = "https://github.com/urbanjost/M_strings.git" }

Which are also all available as github repositories with a Makefile build as

 git clone https://github.com/urbanjost/$NAME.git

It makes it a lot easier to test a package manager if you know where a few packages are!


  • M_time(1) - Fortran module for manipulating and presenting time and date values

  • M_strings(1) - Fortran string module

  • M_process(1) - Fortran Module for calling process-related C functions from Fortran

  • M_CLI(1) - command line argument parsing using a prototype command

  • M_color - a Fortran module that lets you convert between common color models

  • M_history(1) - Fortran-based Input History Editor

  • M_calculator - module of routines for parsing expressions and returning values

  • M_msg - converts any standard scalar type to a string

  • M_io(1) - basic file operations

(1) - A fortran-lang.org package


Please provide feedback here or on the github sites in the wiki or issues sections
( ie. M_CLI wiki for example) or


I wanted to start to use fpm from the beginning of a project. I have moved some source files over to the src directory that was created for me and pushed them to my remote repository. I assume the idea here is for each user to use there own Makefile to build things and to set up the .gitignore to ignore the build directory. This .gitignore is not set up by fpm at the moment. (maybe it should)

Am I too early in fpm lifecycle to try to use it? Also, does fpm set up a default directory for .mod and .smod files or do people let them coexist in the build directory with the .o files.

1 Like

Hi @JerryD,

Thanks for trying it out. The idea is that you don’t need a Makefile (or any other build system) if you stick to Fortran and fpm’s basic structure. fpm takes care of figuring out where to put build files (.o, .mod and .a files) and how to link things together.

Let us know if you run into any issues.

I need to embed the following into the gfortran compile command:

(pkgconf --cflags --libs gtk-3-fortran)

I tried setting the FFLAGS bash variable, that did not work. Does this
go into the toml file?


We haven’t implemented any way to pass custom flags to the compiler yet. Sorry.

Hi @JerryD! This is absolutely important and fpm will allow this. See the open issue here. Do you mind also posting in that thread, it will help us keep the priority high on this specific item as we implement the Fortran fpm. Also, let us know your ideas how this could be best designed from the UI perspective.