DH_FORTRAN_MOD(1)

πŸ“¦
version 0.43 Β· 4 versions
, in debian trixie, ubuntu questing

πŸ’… DH_FORTRAN_MOD πŸ’…

okay bestie, sit down, hydrate, because we're talking about dh_fortran_mod β€” straight out of the dh-fortran-mod manual. she installs Fortran 90 .mod files and handles all the dependency paperwork so you don't have to. iconic behavior honestly πŸŽ€


✨ NAME ✨

dh_fortran_mod β€” installs Fortran 90 .mod files and adds the dependency info. that's the whole job. no cap. πŸ¦‹


🌸 SYNOPSIS 🌸

dh_fortran_mod [--sourcedir=dir] [$<debhelper options>]

like, that's it. she's lowkey simple on the outside. πŸ’–


🫢 DESCRIPTION 🫢

so dh_fortran_mod is a debhelper program, and what she does is go find your Fortran module files and submodule files and then add the right dependencies on gfortran-$version β€” as required β€” to the package, using the variable ${fortran:Depends}. she's doing the dependency math for you. main character energy fr fr. ✨

and the way you're supposed to get her running is automatically, through the debhelper "addon" called fortran_mod. two ways to do that:

  • automatically, by build-depending on 'dh-sequence-fortran-mod' πŸ‘‘
  • or explicitly, like this:
dh $@ --with fortran_mod

then β€” and this is the part people miss β€” dh_fortran_mod searches the debian/ directory for files named debian/pkg.fortran-mod$, and those files list the module files to include. the syntax? same as debhelper install files. iykyk. πŸ’…


πŸ”₯ OPTIONS πŸ”₯

  • --sourcedir=dir β€” go look in the directory you name for the files that need installing. πŸ‘€ typically the Fortran module files are hanging out in library development packages, so that's usually where you're pointing her. πŸ“

πŸ’€ TODO πŸ’€

okay so this is the "coming soon" section and it's giving vision board. here's what's on the list:

  • Add dh-fortran-mod support for generic fortran compilers (ifx, etc). πŸ™ˆ

and then, the big glow-up plans:

  • dh_fortran_mod will be expanded to find mod files automatically from the debian/tmp directory. ✨
  • It will enable the installation of mod files in parallel for multiple compilers. πŸ”₯
  • It will install .smod files for Fortran 2018. πŸ’–

now the file syntax tea:

  • The fortran-mod file syntax follows dh_install: pairs of sources and optional target directories. 🌸
  • The default directory will be $fmoddir ( /usr/lib/$multiarch/fortran/$compiler_mod_directory/ ). πŸŽ€
  • If the target directory is absolute (starts with a '/'), this directory is used in the target package. 🫢
  • If the target does not absolute, it will be treated as a subdirectory of $fmoddir. 🌈
ngl that last one is worded a little cursed in the source, but the meaning is the vibe: absolute path = used as-is, not-absolute = treated as a subdir of $fmoddir. πŸ’…

compiler flavours, bestie, there are four right now:

  • gfortran-* ('gfortran')
  • flang-new-* ('flang')
  • flang-to-external-fc-* ('flangext')
  • lfortran ('lfortran')

$compiler_mod_directory is based on the compiler module version. currently:

  • gfortran-mod-15 for gfortran-14 (and older) πŸ‘‘
  • flang-mod-15 for flang-new-15+ ⭐
  • lfortran-mod-0 for lfortran πŸ¦‹

For flang-to-external-fc-* the version is flangext-mod-15 (assuming gfortran-14 as the external compiler); in principle flang-to-external-fc ('flangext' flavour) and gfortran are intercompatible but intermixing is avoided. 🚫 literally no mixing, we don't do that here.

These will be updated for incompatible compiler versions. πŸ“

Support for Makefiles and debian/rules is given in /usr/share/debhelper/dh-fortran/fortran-support.mk πŸ’š

This enables, for example:

/usr/share/debhelper/dh-fortran/fortran-support.mk
FMODDIR:= $(call get_fmoddir, gfortran)
FC_EXE:= $(call get_fc_exe, $(FC_DEFAULT))

ate. πŸ’…


🌈 SEE ALSO 🌈

  • debhelper(7) β€” go read her too, she's the blueprint. 🫢

πŸ‘‘ AUTHORS πŸ‘‘

  • SΓ©bastien Villemot <sebastien@debian.org> πŸ’œ
  • Alastair McKinstry <mckinstry@debian.org> πŸ’œ

Lots of code stolen shamelessly from dh_install (Joey Hess <joeyh@debian.org>). and we respect the heist. πŸ˜­πŸ‘‘


and that's the whole page, bestie!! πŸŽ€ this was dh_fortran_mod v0.43, dated 2025-02-24, living her best life in the dh-fortran-mod manual section 1. go install some mod files. slay. βœ¨πŸ’–πŸ¦‹

πŸ“¦ where this page comes from