FPM and Modern Fortran Linter

Hey,

I just want to share my experience using those tools together. They are awesome, but I noticed one major issue.
You need to change the directory for the *.mod files generated by the Modern Fortran Linter in VsCode.
In VsCode Settings search for “Fortran › Linter: Mod Output” and change it to somewhere outside your project directory.

Else if you save an example.f90 file containing a module this will be compiled in the background by the linter and stored next to the f90 file as example.mod.
In case of using FPM directory layout it is stored in /src/example.mod which will mess up the build process, since during the build process FPM will generate its own mod file in build/gfortan/example.mod.
Which leads to undefined behavior or crashes during build process.

Thanks to both teams, I really like your products!

2 Likes