[Bug fortran/94931] request: print include path

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun May 3 15:54:51 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94931

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
(In reply to Ryo Furue from comment #0)
> I'm not familiar with this bug tracker. I mean to submit a request, not a
> bug report.
> ----
> Sorry if I missed anything, but it seems to me that there is no (official)
> way to print the list of paths which gfortran searches for include files. If
> that is correct, my request would be to provide a means to print the paths.
> 
> The `--print-search-dirs` option indicates paths only for the installation,
> executables, and libraries (It seems to me).
> 
> This discussion applies to the INCLUDE statement of the Fortran language,
> not the `#include` directive of the preprocessor.
> 
> Off-topic: I wonder if there is a discussion available online about why
> /usr/include or something like that is not searched by default? Is there a
> common (more or less standard) place for gfortran to search?

There isn't a list of paths.  With the Fortran INCLUDE statement,
by default gfortran looks in the current working directory.  That
is it.  If you have files, which are INCLUDEd, into your program 
is different directories, you can create a list of paths with the
-I option.

gfortran also searches for its own INCLUDE files and intrinsic
modules in a directory created during installation of the compiler.
You can find the name of that directory by using the -v option
during compilation.  For example, on my OS, this command

% gfcx -v -o z a.f90 | & grep -- -fin

yields

-fintrinsic-modules-path
/usr/home/kargl/work/lib/gcc/i586-unknown-freebsd13.0/10.0.0/finclude

It seems to me that an option to print the INCLUDE search
path is not needed. The PR can probably be closed as
RESOLVED WONTFIX, but I'll someone else make that decision.


More information about the Gcc-bugs mailing list