Fortran-FOSS-Programmers / Fortran-FOSS-Programmers/ford
Including...and excluding certain files?
- Dominant language
- Python
- Stars
- 458
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Description
So this is a question for the FORD Gurus. Once @ZedThree helped me get my test runs of FORD on MAPL (my library), I noticed something. As I was trying to remove all the warnings from my runs of FORD, I saw these:
```
Reading file ../Tests/ExtDataDriverGridComp.F90
Preprocessing /Users/mathomp4/Ford-Doxygen-Protex/MAPL/Ford/../Tests/ExtDataDriverGridComp.F90
WARNING: Can not find include file "mpif.h".
...
Reading file ../MAPL_cfio/ESMF_CFIOBaseMod.f
Warning: Error parsing ../MAPL_cfio/ESMF_CFIOBaseMod.f.
Can not find include file "netcdf.inc".
Reading file ../MAPL_cfio/ESMF_CFIOUtilMod.F90
```
say, or even this:
```
Reading file ../gridcomps/Cap/MAPL_NUOPCWrapperMod.F90
Preprocessing /Users/mathomp4/Ford-Doxygen-Protex/MAPL/Ford/../gridcomps/Cap/MAPL_NUOPCWrapperMod.F90
Warning: error when preprocessing /Users/mathomp4/Ford-Doxygen-Protex/MAPL/Ford/../gridcomps/Cap/MAPL_NUOPCWrapperMod.F90:
/Users/mathomp4/installed/Core/gcc-gfortran/11.3.0/bin/cpp -traditional-cpp -E -DUSE_MPI=1 -DBUILD_WITH_PFLOGGER=1 -DBUILD_WITH_EXTDATA2G=1 -DUSE_FLAP=1 -I/Users/mathomp4/Ford-Doxygen-Protex/MAPL/Ford/../include -I/Users/mathomp4/Ford-Doxygen-Protex/gFTL/install-gcc-gfortran-11.3.0/GFTL-1.8/include/v1 -I/Users/mathomp4/Ford-Doxygen-Protex/gFTL/install-gcc-gfortran-11.3.0/GFTL-1.8/include/v2 /Users/mathomp4/Ford-Doxygen-Protex/MAPL/Ford/../gridcomps/Cap/MAPL_NUOPCWrapperMod.F90
/Users/mathomp4/Ford-Doxygen-Protex/MAPL/Ford/../gridcomps/Cap/MAPL_NUOPCWrapperMod.F90:62:2: fatal error: mpif.h: No such file or directory
62 |
| ^
compilation terminated.
Reverting to unpreprocessed file
```
So, I decided, okay, let's go add them to my include:
```
include: ../include/
/Users/mathomp4/Ford-Doxygen-Protex/gFTL/install-gcc-gfortran-11.3.0/GFTL-1.8/include/v1
/Users/mathomp4/Ford-Doxygen-Protex/gFTL/install-gcc-gfortran-11.3.0/GFTL-1.8/include/v2
/Users/mathomp4/installed/Compiler/gcc-gfortran-11.3.0/openmpi/4.1.3/include
/Users/mathomp4/installed/MPI/gcc-gfortran-11.3.0/openmpi-4.1.3/Baselibs/7.0.0/Darwin/include/netcdf
```
And this worked. All the warnings went away. 🎉
But there was a side-effect. On some of the documentation pages, say those files that use `#include mpif.h`, I now get a page that is probably 95% MPI documentation (common blocks, variables, and interfaces) and waaaaaay down at the bottom was the stuff I cared about. (Though I guess I've learned that `MPI_BOTTOM` is in a `COMMON` block.
So I wondered, is there a way to tell FORD to include these files when it comes to preprocessing, but also _exclude_ them from the resulting documentation?
(Note: I know the correct answer is probably "Convert to `use mpi`" and that's probably what I want to do long-term, but for now...)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.