-
Notifications
You must be signed in to change notification settings - Fork 115
Description
Just found this Q&A here: https://stackoverflow.com/questions/23991664/gfortran-include-path-is-there-an-alternative-to-passing-multiple-i-options
In summary, GFortran will not use the CPATH environment variable to resolve Fortran include or use directives, the -I flag has to be manually added with -I to the command line. In contrast, #include via the C preprocessor will use the include directories from CPATH.
With Intel Fortran the situation is different, include, use and #include will use the directories specified in CPATH to find include files and module files.
For consistency (and convenience), I would suggest we “fix” the GFortran behaviour by automatically adding the entries in CPATH as include directories to the compile arguments to allow the user to rely on the environment variables rather than having to use --flag.