I'm trying to compile code I have written, using both ifort and gfortran. The problem I am having is relating to my use of the preprocessor and directory structure.
In my fortran source I have something like:
#include "includes/myinclude1.inc"
In "includes/myinclude1.inc" I want to include another file, say "includes/sub/myinclude2.inc".
In ifort the preprocessor uses the directory relative to the source directory, so in "includes/myinclude1.inc" I may just do:
#include "includes/sub/myinclude2.inc"
However, in gfortran it is relative to the location of the current include file, so I instead must do:
#include "sub/myinclude2.inc"
Is there a compiler option (either in ifort or gfortran) that will allow me to get the same behavior across compilers?
Thanks.