fpm is great for including external fortran projects as dependencies (typically downloaded at github).
However, it often arises that a fortran project needs to link to an already compiled system-wide archive, such as lapack or fftw. At present, to the best of my knowledge, there is no simple way to link to such files in fpm. It is possible that this might be possible using a Makefile, but that would be non-optimal.
Ideally, the libraries to link to would be placed in the fpm.toml file, something like this:
link = 'fftw, lapack'
This is certainly on our radar. We just haven't gotten to it yet.
Since we flagged this for our first beta release, we should agree on a syntax for it.
I would suggest to include the external libraries in the build section:
[build]
link = ["fftw", "lapack"]
Which would translate to
gfortran ... -lfftw -llapack
in the link line.
To group libraries in the link line nested arrays could be used.
Most helpful comment
Since we flagged this for our first beta release, we should agree on a syntax for it.
I would suggest to include the external libraries in the build section:
Which would translate to
in the link line.
To group libraries in the link line nested arrays could be used.