I’ve been messing around a bit with Pixi and rattler-build* recently and thought it would be useful to write a blog post on how to use rattler-build to build a Conda package from Fortran code, using fpm as the build script.
Here is said blog post: Creating a Conda package from Fortran using fpm and rattler-build · Sam Harrison
To me, using fpm to manage the Fortran project and rattler-build to build into a Conda package is a nicely streamlined way of managing Fortran Conda packages.
I discovered a couple of other exciting things along the way:
- The conda-forge GFortran package is now available for Windows! This is pretty huge and removes a big stumbling block in building Fortran packages on Windows. See here for a bit of context: Conda toolchain for Fortran on Windows - Fortran Discourse.
- It seems that rattler-build uses the latest version of GFortran (14.2) when specifying
${{ compiler('fortran') }}
in the build requirements (at least on Linux). This is different to conda-build (unless it’s changed recently), which uses some ancient version of GFortran on Linux and FLang on Windows.
Thoughts welcome!
*New tools to manage Conda packages, that are generally better than Conda’s own tools.