OpenMP (Using the GNU Compiler Collection (GCC))

### 6.7 OpenMP ¶

OpenMP (Open Multi-Processing) is an application programming interface (API) that supports multi-platform shared memory multiprocessing programming in C/C++ and Fortran on many 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.

GCC implements most of the OpenMP Application Program Interface v5.2, with some omissions and additional features from later versions. See OpenMP Implementation Status in GNU Offloading and Multi Processing Runtime Library, for more details about currently supported OpenMP features.

To enable the processing of OpenMP directives ‘`#pragma omp`’, ‘`[[omp::decl(...)]]`’, ‘`[[omp::directive(...)]]`’, and ‘`[[omp::sequence(...)]]`’ in C and C++, GCC needs to be invoked with the `-fopenmp` option. This option also arranges for automatic linking of the OpenMP runtime library. See GNU Offloading and Multi Processing Runtime Library.

See Options Controlling OpenMP and OpenACC, for additional options useful with `-fopenmp`.