------- Comment #1 from dfranke at gcc dot gnu dot org  2008-04-05 23:50 -------
> #include "omp_lib.h"

Question is, whether this should be supported or not.

OMP specs 2.5, section 3.1 "Runtime Library Definitions" state:
"Interface declarations for the OpenMP Fortran runtime library routines
described in this chapter shall be provided in the form of a Fortran include
file named omp_lib.h or a Fortran 90 module named omp_lib. It is implementation
defined whether the include file or the module file (or both) is provided."

Example A.2.1f then shows:
  INCLUDE "omp_lib.h" ! or USE OMP_LIB

gfortran provides both versions. Further, it is possible to define additional
include paths at the command-line via -I<path>, these are also passed to the
preprocessor. 

IMO, either use the INCLUDE-statement, USE the module, or pass the path
manually. If one insists on adding this path to the default search path, one
could do it like this:

Index: gcc/fortran/lang-specs.h
===================================================================
--- gcc/fortran/lang-specs.h    (revision 133799)
+++ gcc/fortran/lang-specs.h    (working copy)
@@ -27,7 +27,7 @@
 {".FPP", "@f77-cpp-input", 0, 0, 0},
 {"@f77-cpp-input",
   "cc1 -E -lang-fortran -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
-      %{E|M|MM:%(cpp_debug_options)}\
+      %{E|M|MM:%(cpp_debug_options)} -I finclude%s\
       %{!M:%{!MM:%{!E: -o %|.f |\n\
     f951 %|.f %{!ffree-form:-ffixed-form} %(cc1_options) %{J*} %{I*}\
       -fpreprocessed %{!nostdinc:-fintrinsic-modules-path finclude%s}
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
@@ -37,7 +37,7 @@
 {".F08", "@f95-cpp-input", 0, 0, 0},
 {"@f95-cpp-input",
   "cc1 -E -lang-fortran -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
-      %{E|M|MM:%(cpp_debug_options)}\
+      %{E|M|MM:%(cpp_debug_options)} -I finclude%s\
       %{!M:%{!MM:%{!E: -o %|.f95 |\n\
     f951 %|.f95 %{!ffixed-form:-ffree-form} %(cc1_options) %{J*} %{I*}\
       -fpreprocessed %{!nostdinc:-fintrinsic-modules-path finclude%s}
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},


Take your pick :)


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35055

Reply via email to