Information or Links Regarding Fortran Packages that use Preprocessors

Hi Community,

I am Arteev Raina. I working as a Student Contributor in GSoC 22 at Fortran Lang.

I am currently exploring the limitations we have currently on the preprocessors front in Fortran Package Manager. Can you comment down the link of those Fortran Packages that use preprocessors to build? So that I can analyze those and come up with a plan for support for a preprocessor for fpm.

Thanks & Regards
Arteev Raina

1 Like

The Fortran template library (ftl) uses preprocessor extensively, also for generating module names. Repository at GitHub - SCM-NV/ftl: The Fortran Template Library. Currently fpm would be unable to detect any module dependency on the ftl produced modules.

1 Like

Almost all the repositories at


are maintained via the
preprocessor, as well as cpp(1) for some C code, and a default Fortran preprocessor (whatever is triggered by the “.F90” suffix, which is essentially a variant of fpp(1) or cpp(1)) in just one or two places.
Because of a lack of preprocessing support in fpm(1) this is done in a separate process with scripts or make(1), and only the .f90 or .F90 files are presented as the user package (that is, essentially prep(1) is not needed by user to use the packages). This is used primarily to allow the documentation to be included with the code, and then automatically using other utilities such as txt2man(1) and groff(1) to convert the documentation to HTML and man-pages and for templating; not so much for traditional conditional code selection.

If I could specify a make-like rule for a suffix and a rule for converting to a .f90 file with just fpm(1) that would be great. If all of the output files could be placed in the build directory so multiple builds would not collide that would be even better in my case; but for many cases that would require supporting a search path for files similar to what the -I option generally supplies. There have been several on-line discussions about preprocessing which I hope have been pointed out. There are several on the fpm site; others are scattered about. For me, supporting any preprocessor would be an improvement but I would continue primarily using prep(1), so for fpm(1) usage to improve for me general support of any pre-processor would be required.

1 Like