Linear algebra support in stdlib

That’s an interesting remark. Could you elaborate on this ? (Maybe in another thread ?) By “Visualisation Framework”, you mean a plotting library ? This being a no-joke task doesn’t prevent talking about it :slight_smile:

First of all: I appreciate the idea behind stdlib quite a bit. For relatively simple tasks, I’m usually including LAPACK and snippets of code here and there that, by the sounds of it, would be covered all in stdlib (eventually).

That’s a tricky one.

  1. What exactly would the modernisation of BLAS/LAPACK look like?
  2. The former sounds like a daunting task. While there are clear advantages, I’d fear that without sufficient time/resources/contributors, it may take quite a while to achieve. In that case, these advantages have to be weighed against the advantages (for Fortran as a language and community) of having a mature stdlib soon-ish.
2 Likes

@fxm this thread is outdated with respect to this endeavor. You might want to look at linalg – Fortran-lang/stdlib

@FedericoPerini has done a brilliant work leading this effort by integrating a modernized version of BLAS/LAPACK and also developing high-level interfaces. The information is indeed a bit spread across several threads in the forum. For instance:

v0.7.0 includes more features and the latest main branch even more.

3 Likes

Hi @fxm, I hope it’s going come as a positive surprise to you that both those tasks have been successfully completed :slight_smile: As @hkvzjal pointed out, please check out the linear algebra capability at fortran-lang stdlib: it already has most high-level linear algebra functions that you typically find in LA packages.

We also build our modernized LAPACK version internally and expose a kind-agnostic (32- to 128-bit) interface in stdlib_linalg_lapack (we don’t build FORD documentation anymore because it’s too large for FORD to handle). The interface has two aims:

  • Make all calls kind-agnostic, but keep the same LAPACK API. E.g., call gesv instead of call sgesv, call dgesv, etc.

  • You can choose to build stdlib with the internal Fortran implementation or an external optimized blas. In which case, you don’t need to change anything in the code, as the generalized interface already takes care of that. Just ensure that macros STDLIB_EXTERNAL_BLAS and STDLIB_EXTERNAL_LAPACK are defined when building with an external library.

  • Last but not least, thanks to @hkvzjal and others, stdlib is now a default package on the Compiler Explorer: so you can play with the examples there

7 Likes

Hi @FedericoPerini and @hkvzjal,

Thanks for that update. Wow. This is great news and, frankly, quite impressive! Thanks for that immense contribution!

5 Likes