DH_FORTRAN_LIB(1)
π DH_FORTRAN_LIB π
okay bestie, sit down, hydrate, because we're talking about dh_fortran_lib β that's the Fortran library installation support era of the dh-fortran-lib manual, and honestly? iconic. π§β¨
πΈ NAME πΈ
dh_fortran_lib β Fortran library installation support. that's it, that's the whole name section, we love a concise queen π
β¨ SYNOPSIS β¨
dh_fortran_lib [debhelper options] --flavor=flavor [--sourcedir=dir]
[--no-orig-library] [--no-create-in-sourcedir] [libname destination ...]
look at her. debhelper options, a mandatory flavor, a sourcedir, two "no" flags and then as many libname destination pairs as your little heart desires π«Ά
π DESCRIPTION π
dh_fortran_lib is a debhelper program that lets multiple compiler flavous of a Fortran library get installed in parallel by mangling the library filename and the SONAME. (yes, "flavous". it's in the source. we're keeping it. it's canon now π)
here's the tea: Fortran libraries compiled by different compilers are not expected to be ABI-compatible, so if you want multiple compilers supported at the same time, the libraries literally have to be named differently, and shared libraries need to have the compiler flavor baked into the SONAME. no cap.
and dh_fortran_lib makes all of that possible without changes being necessary to the upstream library code. she does the work so upstream doesn't have to. main character energy fr fr π
how? by renaming a library, like:
$(LIBDIR)/libfiat.so.1.2 => $(LIBDIR)/libfiat-gfortran.so.1.2
=back
and yes, that stray =back is sitting right there in the original manual page. pod artifact. we don't ask questions, we just preserve the lore π
symlinks also get renamed:
$(LIBDIR)/libfiat.so.1 => $(LIBDIR)/libfiat-gfortran.so.1
a per-flavor compilation link is added:
$(LIBDIR)/fortran/gfortran/libfiat.so -> $(LIBDIR)/libfiat-gfortran.so.1.2
and the SONAME inside the ELF file gets changed:
$ readelf -a $(LIBDIR)/libfiat.so.1.2 | grep SONAME
0x000000000000000e (SONAME) Library soname: [libfiat.so.1]
$ readelf -a $(LIBDIR)/libfiat-gfortran.so.1.2 | grep SONAME
0x000000000000000e (SONAME) Library soname: [libfiat-gfortran.so.1]
for static files, we just rename and add symlinks. simple. clean. no notes:
$(LIBDIR)/libfiat.a => $(LIBDIR)/libfiat-gfortran.a
$(LIBDIR)/fortran/gfortran/libfiat.a => $(LIBDIR)/libfiat-gfortran.a
the consequence of all this β and this is the part that actually slays β is that any library that builds against libfiat with the appropriate search paths set will use libfiat-gfortran instead. which means parallel builds with multiple compiler flavors can be installed simultaneously. periodt. π
π¦ USAGE π¦
the expected usage is that you call this in debian/rules like:
dh_fortran_lib --flavor=$(FLAVOR) $(BUILDDIR)/XXX/libfiat-gfortran.so.1
the files are installed in the sourcedir (usually debian/tmp) by default. cute, convenient, no extra config πΈ
π OPTIONS π
okay so real talk β the original page mashes this whole options blob into one lumpy paragraph, so here's the raw thing, verbatim, no edits, because we do not lose details in this house:
--flavor=dir =item --sourcedir=dir =item -n, --no-orig-library
Look in the specified directory for files to be installed.
--no-orig-library adds the library name (with default path) to the
list of files not to be installed by debhelper.
now let's break that down for the besties who like structure:
--flavor=dirβ names your flavor. (the synopsis calls it--flavor=flavor, the options blob calls it--flavor=dir; both are sitting in the original, we're keeping both, no editing the source β¨)--sourcedir=dirβ look in the specified directory for files to be installed.-n,--no-orig-libraryβ adds the library name (with default path) to the list of files not to be installed by debhelper. it's the "don't install the unmangled one" button π
also --no-create-in-sourcedir shows up in the synopsis up top. it's there. we see it. we respect it.
π TODO π
the author left us a little notes-app screenshot of the soul, and we are reproducing it in full because every detail stays:
- Do we really want to support
--no-orig-library, blocking install of unmangled library ? - 2 install variants;
dh_fortran_lib --flavor=F LIBBDIR/libfiat.so.4.1
# installs in debian/tmp ; simplest
dh_fortran_lib -p libfiat-dev LIBBDIR/libfiat.so.4.1
- what about reading
.fortran-libfiles? ugly build-paths messy to include in these
not me reading a TODO list in a manpage and feeling seen π unfinished business is a whole aesthetic
π₯ SEE ALSO π₯
go read it, it's the parent energy this whole page runs on π
π AUTHORS π
- Alastair McKinstry
<mckinstry@debian.org> - Lots of code stolen shamelessly from
dh_install(Joey Hess<joeyh@debian.org>and SΓ©bastien Villemot<sebastien@debian.org>).
"stolen shamelessly" is honestly the most honest sentence in any manpage ever and I'm obsessed π«Ά
and that's the whole page bestie!! this was dh_fortran_lib v0.43, dated 2025-02-24 β so go mangle some SONAMEs, install your flavors in parallel, and remember: different compilers, different names, no ABI drama. slay π β¨πΈ
π¦ where this page comes from
- debian trixie: dh-fortran-mod 0.43 Β· GPL-3.0-or-later
- ubuntu questing: dh-fortran-mod 0.43
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms