# Fpm (Fortran Package Manager) guinea pig

**URL:** <https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189>\
**Category:** Uncategorized\
**Created:** [July 6, 2020, 4:52am UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189 "2020-07-06T04:52:57Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![urbanjost](https://avatars.discourse-cdn.com/v4/letter/u/0ea827/32.png) [@urbanjost](https://fortran-lang.discourse.group/u/urbanjost)\
**Post date:** [July 6, 2020, 4:52am UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/1 "2020-07-06T04:52:57Z")

</div>

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)](https://github.com/urbanjost/M_msg). 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…

---

<div class="post-metadata">

**Author:** ![everythingfunctional](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/everythingfunctional/32/176_2.png) [@everythingfunctional](https://fortran-lang.discourse.group/u/everythingfunctional)\
**Post date:** [July 7, 2020, 3:42pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/2 "2020-07-07T15:42:54Z")

</div>

I’ve converted all of my open source Fortran libraries to using fpm. You can find the list of them [here](https://www.everythingfunctional.com/services.html). I would start by reading through the [Packaging Guide](https://github.com/fortran-lang/fpm/blob/master/PACKAGING.md) and then just try stuff out. Feel free to come back and ask more specific questions as they come up.

---

<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:** [July 7, 2020, 4:00pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/3 "2020-07-07T16:00:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![everythingfunctional](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/everythingfunctional/32/176_2.png) [@everythingfunctional](https://fortran-lang.discourse.group/u/everythingfunctional)\
**Post date:** [July 7, 2020, 4:29pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/4 "2020-07-07T16:29:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gardhor](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gardhor/32/88_2.png) [@gardhor](https://fortran-lang.discourse.group/u/gardhor)\
**Post date:** [July 7, 2020, 4:54pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/5 "2020-07-07T16:54:20Z")

</div>

> [@everythingfunctional](#):
>
> I’ve converted all of my open source Fortran libraries to using fpm. You can find the list of them [here](https://www.everythingfunctional.com/services.html). I would start by reading through the [Packaging Guide](https://github.com/fortran-lang/fpm/blob/master/PACKAGING.md) and then just try stuff out.

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.

---

<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:** [July 7, 2020, 5:15pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/6 "2020-07-07T17:15:21Z")

</div>

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

> <https://github.com/fortran-lang/fpm/issues/33#issuecomment-580882006>
>
> Rust allows the packages to be decentralized, they do not have to be listed at https://crates.io/.
> The Go language does not even...

> <https://github.com/fortran-lang/fpm/issues/34#issuecomment-626375020>
>
> After #33 is implemented, the next step is to implement a minimal metadata registry. Here is one way to do that:
> Have...

---

<div class="post-metadata">

**Author:** ![gardhor](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gardhor/32/88_2.png) [@gardhor](https://fortran-lang.discourse.group/u/gardhor)\
**Post date:** [July 7, 2020, 5:40pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/7 "2020-07-07T17:40:48Z")

</div>

> [@certik](#):
>
> We should not put it in the fpm repository itself. See the related discussion at:

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!

---

<div class="post-metadata">

**Author:** ![everythingfunctional](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/everythingfunctional/32/176_2.png) [@everythingfunctional](https://fortran-lang.discourse.group/u/everythingfunctional)\
**Post date:** [July 7, 2020, 6:25pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/8 "2020-07-07T18:25:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![urbanjost](https://avatars.discourse-cdn.com/v4/letter/u/0ea827/32.png) [@urbanjost](https://fortran-lang.discourse.group/u/urbanjost)\
**Post date:** [July 12, 2020, 4:19pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/9 "2020-07-12T16:19:19Z")

</div>

# FPM ENABLED GITHUB REPOSITORIES

### July 12, 2020

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

```
[dependencies]
 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  
well:

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

## DESCRIPTIONS

- [_M\_time(1)_](https://github.com/urbanjost/M_time) - Fortran module for manipulating and presenting time and date values

- [_M\_strings(1)_](https://github.com/urbanjost/M_strings) - Fortran string module

- [_M\_process(1)_](https://github.com/urbanjost/M_process) - Fortran Module for calling process-related C functions from Fortran

- [_M\_CLI(1)_](https://github.com/urbanjost/M_CLI) - command line argument parsing using a prototype command

- [_M\_color_](https://github.com/urbanjost/M_color) - a Fortran module that lets you convert between common color models

- [_M\_history(1)_](https://github.com/urbanjost/M_history) - Fortran-based Input History Editor

- [_M\_calculator_](https://github.com/urbanjost/M_calculator) - module of routines for parsing expressions and returning values

- [_M\_msg_](https://github.com/urbanjost/M_msg) - converts any standard scalar type to a string

- [_M\_io(1)_](https://github.com/urbanjost/M_io) - basic file operations

(1) - A [fortran-lang.org](http://fortran-lang.org) [package](https://fortran-lang.org/packages/)

## FEEDBACK WELCOME

Please provide feedback here or on the github sites in the wiki or issues sections  
( ie. [M\_CLI wiki](https://github.com/urbanjost/M_CLI/wiki) for example) or

- [Google Fortran newsgroup](https://groups.google.com/forum/#!forum/comp.lang.fortran)
- [Fortran Discourse](https://fortran-lang.discourse.group)
- [Fortran Wiki](http://fortranwiki.org)

---

<div class="post-metadata">

**Author:** ![JerryD](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jerryd/32/393_2.png) [@JerryD](https://fortran-lang.discourse.group/u/JerryD)\
**Post date:** [July 29, 2020, 2:57am UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/10 "2020-07-29T02:57:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![everythingfunctional](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/everythingfunctional/32/176_2.png) [@everythingfunctional](https://fortran-lang.discourse.group/u/everythingfunctional)\
**Post date:** [August 9, 2020, 5:08pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/11 "2020-08-09T17:08:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JerryD](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jerryd/32/393_2.png) [@JerryD](https://fortran-lang.discourse.group/u/JerryD)\
**Post date:** [August 11, 2020, 1:59am UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/12 "2020-08-11T01:59:26Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![everythingfunctional](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/everythingfunctional/32/176_2.png) [@everythingfunctional](https://fortran-lang.discourse.group/u/everythingfunctional)\
**Post date:** [August 11, 2020, 6:41pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/13 "2020-08-11T18:41:23Z")

</div>

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

---

<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 11, 2020, 8:36pm UTC](https://fortran-lang.discourse.group/t/fpm-fortran-package-manager-guinea-pig/189/14 "2020-08-11T20:36:57Z")

</div>

Hi @JerryD! This is absolutely important and fpm will allow this. See the open issue [here](https://github.com/fortran-lang/fpm/issues/112). 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.
