csdms / bmi-fortran

Basic Model Interface for Fortran
https://bmi.csdms.io
MIT License
6 stars 10 forks source link

Adding support for Fortran Package Manager #45

Closed samharrison7 closed 1 year ago

samharrison7 commented 1 year ago

There's a relatively new package manager on the block for Fortran, aptly called the Fortran Package Manager, or fpm for short. It aims to make building Fortran projects with dependencies easier than the standard methods commonly used (like manually installing or simply copying over source files).

I think it would be very neat if the BMI Fortran module could be installed using fpm. In short, this would mean that a Fortran programmer using fpm to build their code and who wanted to implement the BMI could simply add a one-liner to their fpm.toml file (the fpm config file that controls the build of each package):

[dependencies]
bmi = { git = "https://github.com/csdms/bmi-fortran" }

If you guys are interested in this, I would be more than happy to rustle up a PR to show how it could work in action. In theory it should just be a case of adding an fpm.toml file to the repo with some build instructions.

mdpiper commented 1 year ago

👍 I think this would be super cool.

samharrison7 commented 1 year ago

As promised, here's the PR! #46

I think it would be cool to update bmi-example-fortran to be buildable by fpm too, but this requires a bit more thinking about. Fpm is a little opinionated when it comes to naming conventions (it likes test instead of tests, example instead of examples...) and it's difficult to control where it runs its tests from - I gave it a go and was getting failures because it couldn't find the sample.cfg file. I'll give this another go next week!

mdpiper commented 1 year ago

Resolved with #46.