# Fortranpack: A Modern Fortran Numerical & Scientific Programming Package

**URL:** <https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633>\
**Category:** Announcements\
**Created:** [April 26, 2025, 9:58pm UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633 "2025-04-26T21:58:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacobwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jacobwilliams/32/10_2.png) [@jacobwilliams](https://fortran-lang.discourse.group/u/jacobwilliams)\
**Post date:** [April 26, 2025, 9:58pm UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/1 "2025-04-26T21:58:32Z")

</div>

Behold Fortranpack: A Modern Fortran Numerical & Scientific Programming Package

> **[GitHub - jacobwilliams/fortranpack: A Modern Fortran Numerical & Scientific...](https://github.com/jacobwilliams/fortranpack)**
>
> A Modern Fortran Numerical & Scientific Programming Package

What is this you ask? It’s just an FPM manifest that imports all my other libraries! So, add it as a dependency and you get everything.

Genius or cursed?

It’s just an experiment really. I was wondering if there would be some utility in a meta-library like this. Rather than having everything in a single repository (like `stdlib`), things are split up and development separately. Something to think about. There are pros and cons to both approaches.

---

<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:** [April 26, 2025, 10:18pm UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/2 "2025-04-26T22:18:39Z")

</div>

Super-packages are interesting and educational as github, fpm, and compilers all get exercised differently than when working piecemeal with smaller projects.

I have been using a slightly different approach, partly for testing fpm, since the inception of the Fortran branch of fpm.

[GitHub - urbanjost/general-purpose-fortran: General Purpose Fortran Cooperative](https://github.com/urbanjost/general-purpose-fortran) is a single library that was split into many subprojects specifically to be used more selectively, particularly via fpm.

As you mentioned, there are pros and cons to each approach, but I was expecting an fpm repository to have developed more than has occurred, which tends to favor smaller packages. Theoretically the repository seemed like it would be a natural hotbed for developing stdlib modules as well.

Combining many modules gives fpm a good workout as well. Do you see any unexpected recompilations when you change a program in app/ or test/ or example/ ?

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [April 27, 2025, 7:39pm UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/3 "2025-04-27T19:39:16Z")

</div>

Here is the dependency graph as a [SVG](https://mermaid.ink/svg/pako:eNqVWNuS0zgQ_RWVX_ZlMsRy7g9bFSYDDMwlJDvL1potSrGVRGBbRpIHAsW_b0uyEzkTGPEUXdp9Wuru0618DxKe0mASrDP-JdkSodD14n2B0G0Yr7lQghQlST79Z5ZwTMTmoVOv27UoXskyYwVtL_fihIhM8qJDs4yViiUdVii6ESSTVqIfJ7zIyVc7G5gZq78exok8whnFKdlkbGVn4zhNKVnldhZ245SXo35UT8F0DSbKeo6bo3RykmzrxWi_KCkRybZDirQjYane78UftfktI8J-nK3WG1lbEQ7inApJCzi9-sIkQB7JD-Mio5JnD492RvFtlc_Yel3PxzEvFVxPfdPduEy2rD4ADuOSfSKs2cRxybOd4FzJtlYcwU5Jj6zGvbiUnxtd_bjclRlXRzKD-HNFUsfXQ7MgiKrEkW_xKBbgSeZKj2Pxae-dqBufMC4KY8nyKiOKpnDZBSUQNpt6D8cy29sYRTHEVElq5VEvlkqA7ME7UT-uKpYeAQzi9T6EomF8vXy7qCejOKvADfVsDFs3divJWPIJ7EdbQdfofbBVqpSTZ882TG2r1XnC82cfScJXXxiEMcnlMzcD3gfwxRStqALPow1VH0A-hzj6AFJVTguFQBK9aKQdwMgb8Ci9DOZNlSmWMkCQjBckQ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poDYVx44TylzXa5N_ux2eCcbu15XUkEA5nTfhwlewS-gasNq6TaYP9e5L3CbDo-52iG6-_ur2RGWP3Otm5fZDFqEB2IYZS0oReFsH8kIZKxLdbL9otmM_FlN_4dwKqRkSaBRQ3W_JHeQ9vDQlY9fD5E_hZm_KAzY9f3y7tqquQ07nT9v8WEYHYa9w7B_GA4Ow-FhODoMx4dh2HXGoTN2AEMHMXQgQwczdEBDBzV0YEMHFzu42MHFDi52cLGDix1c7OBiBxc7uNjBjRzcyMGN3At2cCMHN7K4Y1fP0EwG7mToTkbuZFz_medcGN5rC84C6H5zwtJgEnzXm-8DIKscSHgCw5SuCdCIjokfIFqVKfCo5jUugokSFT0LSKX4clckwWRNMkkboRkj0PHmjVRJin85d6fB5HvwNZh08PkQjzAOB_0Id4e9_hifBbtg0ut2zwdhvz8eDXuDAcbRj7Pgm9EQnnfDcW84GofDEIej0RA-oMakG_ufsvlr-SwAztls91bpMt2gQ4sPWXXBq0IFk0E0-PE__-q0Tw) file. Generated using [fpm-deps.](https://github.com/ivan-pi/fpm-deps)

---

<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:** [April 28, 2025, 1:04am UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/4 "2025-04-28T01:04:31Z")

</div>

Fortranpack already has an index to all the dependencies but I did not realize till now that the output from the `"--mermaid md"` option can be used as-is in github markdown. I think I will spend a bit of time adding the dependency graphs to my README.md files.

Fortranpack is not only a good way to exercise `fpm` but a decent test of a Fortran compiler as well 🫠

---

<div class="post-metadata">

**Author:** ![jacobwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jacobwilliams/32/10_2.png) [@jacobwilliams](https://fortran-lang.discourse.group/u/jacobwilliams)\
**Post date:** [April 28, 2025, 1:05am UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/5 "2025-04-28T01:05:55Z")

</div>

Yes! @certik if you can get LFortran to compile this you are close to done! 😀

---

<div class="post-metadata">

**Author:** ![rwmsu](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@rwmsu](https://fortran-lang.discourse.group/u/rwmsu)\
**Post date:** [April 28, 2025, 1:09am UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/6 "2025-04-28T01:09:09Z")

</div>

I would like to nominate Jacob to be Fortran’s official “Leader of the Packs”. Do I hear a second 😄

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [April 28, 2025, 2:11am UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/7 "2025-04-28T02:11:26Z")

</div>

> [@urbanjost](#):
>
> Fortranpack already has an index to all the dependencies but I did not realize till now that the output from the `"--mermaid md"` option can be used as-is in github markdown.

Yes, it is part of both Github- and Gitlab-flavored markdown. I’m assuming the boxes are only clickable when included in the HTML, but I may be wrong. There is also a hover effect which displays the name. In principle one can also edit line styles, shapes, or add icons and images ([Flowcharts Syntax | Mermaid](https://mermaid.js.org/syntax/flowchart.html)).

> [@urbanjost](#):
>
> I think I will spend a bit of time adding the dependency graphs to my README.md files.

Do let me know if you encounter any problems.

---

<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:** [April 28, 2025, 4:30am UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/8 "2025-04-28T04:30:42Z")

</div>

> [@jacobwilliams](#):
>
> if you can get LFortran to compile this you are close to done! 😀

Thanks, we’ll get there!

---

<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:** [April 28, 2025, 7:06am UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/9 "2025-04-28T07:06:15Z")

</div>

It is clickable, the hover works, and a navigator allows zooming and panning. At the bottom of the README.md  
I corrected it but the original output using

```bash
fpm deps --mermaid md --output deps.md

```

[deps.md](https://github.com/urbanjost/prep/blob/main/deps.md)  
the top link goes to the top of repositories instead of to the prep project, although it works as expected on other projects.

It might be nice if fpm-devs wrote other github markdown formats as well, like the index in Fortranpack. The graphs are great, but the table like Fortranpack has and a simple text listing for terminal output when using fpm as well would be useful. @jacobwilliams – is your index manually generated or automated?

---

<div class="post-metadata">

**Author:** ![jacobwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jacobwilliams/32/10_2.png) [@jacobwilliams](https://fortran-lang.discourse.group/u/jacobwilliams)\
**Post date:** [April 28, 2025, 2:53pm UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/10 "2025-04-28T14:53:03Z")

</div>

I just manually made it. Wouldn’t be hard to automate it.

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [April 28, 2025, 3:08pm UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/11 "2025-04-28T15:08:53Z")

</div>

> [@urbanjost](#):
>
> the top link goes to the top of repositories instead of to the prep project, although it works as expected on other projects.

That is because of the `homepage` field in the prep `fpm.toml`: [prep/fpm.toml at c0120b14d23097c704a0ecf1db6c87e08388ea18 · urbanjost/prep · GitHub](https://github.com/urbanjost/prep/blob/c0120b14d23097c704a0ecf1db6c87e08388ea18/fpm.toml#L11)

> [@urbanjost](#):
>
> but the table like Fortranpack has and a simple text listing for terminal output when using fpm as well would be useful.

I haven’t really advertised it yet, but I also made text command `fpm-tree` (it is part of fpm-deps). For instance for fortranpack, it currently display the following:

```txt
~/fortran/fpm_packages/fortranpack$ fpm-tree
fortranpack
├── argv-fortran
├── bspline-fortran
├── carlson-elliptic-integrals
├── conmax
├── conmin
├── csv-fortran
├── daglib
├── ddeabm
│ └── roots-fortran
├── dop853
├── finterp
├── fortran-mach
├── fortran-search-and-sort
├── json-fortran
├── lbfgsb
├── mersenne-twister-fortran
├── nlesolver-fortran
│ ├── fmin
│ ├── LSQR
│ ├── lusol
│ └── LSMR
├── NumDiff
├── optgra
├── pchip
├── pikaia
│ └── mersenne-twister-fortran (*)
├── polyroots-fortran
├── popen-fortran
├── psqp
├── pyplot-fortran
├── quadpack
├── quadrature-fortran
├── regridpack
├── rklib
│ └── roots-fortran (*)
├── roots-fortran (*)
├── simulated-annealing
├── slsqp
├── splpak
├── stringsort
└── uuid-fortran

```

It has a nice clean tree structure with few package inter-dependencies.

---

<div class="post-metadata">

**Author:** ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)\
**Post date:** [April 28, 2025, 5:52pm UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/12 "2025-04-28T17:52:42Z")

</div>

Nice, thanks. Apart from FPM and fpm-tree, is there a tool that creates such a diagram for a program, showing the modules USEd by the main program and by each module?

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [April 28, 2025, 6:19pm UTC](https://fortran-lang.discourse.group/t/fortranpack-a-modern-fortran-numerical-scientific-programming-package/9633/13 "2025-04-28T18:19:39Z")

</div>

I’ve done that too in a private fork of fpm. The information (with some caveats) is available from the fpm build model: [Option to output dependency tree · Issue #687 · fortran-lang/fpm · GitHub](https://github.com/fortran-lang/fpm/issues/687#issuecomment-2727698387)
