aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/gfortran.texi
diff options
context:
space:
mode:
authorSandra Loosemore <sloosemore@baylibre.com>2024-12-17 15:19:36 +0000
committerSandra Loosemore <sloosemore@baylibre.com>2024-12-17 18:13:13 +0000
commitef458b3fa75537cb2d16f4ce61bc52642ddefd8a (patch)
treef20cc6eb3249ec70c71a8867d99331625ab5e88e /gcc/fortran/gfortran.texi
parentcfe1ad3c488693a10fafb39d68c8cabc6e48daa7 (diff)
downloadgcc-ef458b3fa75537cb2d16f4ce61bc52642ddefd8a.zip
gcc-ef458b3fa75537cb2d16f4ce61bc52642ddefd8a.tar.gz
gcc-ef458b3fa75537cb2d16f4ce61bc52642ddefd8a.tar.bz2
Documentation: Make OpenMP/OpenACC docs easier to find [PR26154]
PR c/26154 is one of our oldest documentation issues. The only discussion of OpenMP support in the GCC manual is buried in the "C Dialect Options" section, with nothing at all under "Extensions". The Fortran manual does have separate sections for OpenMP and OpenACC extensions so I have copy-edited/adapted that text for similar sections in the GCC manual, as well as breaking out the OpenMP and OpenACC options into their own section (they apply to all of C, C++, and Fortran). I also updated the information about what versions of OpenMP and OpenACC are supported and removed some redundant text from the Fortran manual to prevent it from getting out of sync on future updates, and inserted some cross-references to the new sections elsewhere. gcc/c-family/ChangeLog PR c/26154 * c.opt.urls: Regenerated. gcc/ChangeLog PR c/26154 * common.opt.urls: Regenerated. * doc/extend.texi (C Extensions): Adjust menu for new sections. (Attribute Syntax): Mention OpenMP directives. (Pragmas): Mention OpenMP and OpenACC directives. (OpenMP): New section. (OpenACC): New section. * doc/invoke.texi (Invoking GCC): Adjust menu for new section. (Option Summary): Move OpenMP and OpenACC options to their own category. (C Dialect Options): Move documentation for -foffload, -fopenacc, -fopenacc-dim, -fopenmp, -fopenmd-simd, and -fopenmp-target-simd-clone to... (OpenMP and OpenACC Options): ...this new section. Light copy-editing of the option descriptions. gcc/fortran/ChangeLog: PR c/26154 * gfortran.texi (Standards): Remove redundant info about OpenMP/OpenACC standard support. (OpenMP): Copy-editing and update version info. (OpenACC): Likewise. * lang.opt.urls: Regenerated.
Diffstat (limited to 'gcc/fortran/gfortran.texi')
-rw-r--r--gcc/fortran/gfortran.texi52
1 files changed, 27 insertions, 25 deletions
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index c91d548..8aedf46 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -439,13 +439,6 @@ language standard, including full support for the Technical Specification
More details on support for these standards can be
found in the following sections of the documentation.
-Additionally, the GNU Fortran compilers supports the OpenMP specification
-(version 4.5 and partial support of the features of the 5.0 version,
-@url{https://openmp.org/@/specifications/}).
-There also is support for the OpenACC specification (targeting
-version 2.6, @uref{https://www.openacc.org/}). See
-@uref{https://gcc.gnu.org/wiki/OpenACC} for more information.
-
@node Fortran 95 status
@subsection Fortran 95 status
@cindex Varying length strings
@@ -1823,19 +1816,21 @@ architectures, including Unix and Microsoft Windows platforms.
It consists of a set of compiler directives, library routines,
and environment variables that influence run-time behavior.
-GNU Fortran strives to be compatible to the
-@uref{https://openmp.org/specifications/,
-OpenMP Application Program Interface v4.5}.
+GNU Fortran implements all of the @uref{https://openmp.org/specifications/,
+OpenMP Application Program Interface v4.5}, and many features from later
+versions of the OpenMP specification.
+@xref{OpenMP Implementation Status,,,libgomp,
+GNU Offloading and Multi Processing Runtime Library},
+for more details about currently supported OpenMP features.
To enable the processing of the OpenMP directive @code{!$omp} in
free-form source code; the @code{c$omp}, @code{*$omp} and @code{!$omp}
directives in fixed form; the @code{!$} conditional compilation sentinels
in free form; and the @code{c$}, @code{*$} and @code{!$} sentinels
in fixed form, @command{gfortran} needs to be invoked with the
-@option{-fopenmp}. This also arranges for automatic linking of the
-GNU Offloading and Multi Processing Runtime Library
-@ref{Top,,libgomp,libgomp,GNU Offloading and Multi Processing Runtime
-Library}.
+@option{-fopenmp} option. This option also arranges for automatic linking
+of the OpenMP runtime library.
+@xref{,,,libgomp,GNU Offloading and Multi Processing Runtime Library}.
The OpenMP Fortran runtime library routines are provided both in a
form of a Fortran 90 module named @code{omp_lib} and in a form of
@@ -1855,20 +1850,24 @@ SUBROUTINE A1(N, A, B)
END SUBROUTINE A1
@end smallexample
+@xref{OpenMP and OpenACC Options,,,gcc,
+Using the GNU Compiler Collection (GCC)}, for additional options useful with
+@option{-fopenmp}.
+
Please note:
@itemize
@item
@option{-fopenmp} implies @option{-frecursive}, i.e., all local arrays
-will be allocated on the stack. When porting existing code to OpenMP,
-this may lead to surprising results, especially to segmentation faults
-if the stacksize is limited.
+are allocated on the stack. When porting existing code to OpenMP,
+this may lead to surprising results, especially segmentation faults
+if the stack size is limited.
@item
-On glibc-based systems, OpenMP enabled applications cannot be statically
-linked due to limitations of the underlying pthreads-implementation. It
+On glibc-based systems, OpenMP-enabled applications cannot be statically
+linked due to limitations of the underlying pthreads implementation. It
might be possible to get a working solution if
@command{-Wl,--whole-archive -lpthread -Wl,--no-whole-archive} is added
-to the command line. However, this is not supported by @command{gcc} and
+to the command line. However, this is not supported by GCC and
thus not recommended.
@end itemize
@@ -1881,7 +1880,7 @@ offloading of code to accelerator devices. It consists of a set of
compiler directives, library routines, and environment variables that
influence run-time behavior.
-GNU Fortran strives to be compatible to the
+GNU Fortran strives to be compatible with the
@uref{https://www.openacc.org/, OpenACC Application Programming
Interface v2.6}.
@@ -1890,15 +1889,18 @@ free-form source code; the @code{c$acc}, @code{*$acc} and @code{!$acc}
directives in fixed form; the @code{!$} conditional compilation
sentinels in free form; and the @code{c$}, @code{*$} and @code{!$}
sentinels in fixed form, @command{gfortran} needs to be invoked with
-the @option{-fopenacc}. This also arranges for automatic linking of
-the GNU Offloading and Multi Processing Runtime Library
-@ref{Top,,libgomp,libgomp,GNU Offloading and Multi Processing Runtime
-Library}.
+the @option{-fopenacc} option. This option also arranges for automatic
+linking of the OpenACC runtime library.
+@xref{,,,libgomp,GNU Offloading and Multi Processing Runtime Library}.
The OpenACC Fortran runtime library routines are provided both in a
form of a Fortran 90 module named @code{openacc} and in a form of a
Fortran @code{include} file named @file{openacc_lib.h}.
+@xref{OpenMP and OpenACC Options,,,gcc,
+Using the GNU Compiler Collection (GCC)}, for additional options useful with
+@option{-fopenacc}.
+
@node Argument list functions
@subsection Argument list functions @code{%VAL}, @code{%REF} and @code{%LOC}
@cindex argument list functions