compiler directive


Also found in: Dictionary, Legal.

compiler directive

A statement written in the source code of a program that does not become a command in the running of the program for the user. The compiler directive lets the programmer instruct the compiler to perform a specific operation within the compilation phase such as using alternate syntax for a source code statement.

A compiler directive is often required when the same source code is compiled on two different hardware platforms such as Windows and Linux. For example, the code might be compiled and tested on Windows but compiled and run on Linux. A few statements in the code may require different syntax, and the compiler directive accomplishes this, essentially stating "use this line of code rather than that one." See pragma and compiler.
Mentioned in ?
References in periodicals archive ?
Fuhrer, 2014: Using compiler directives to port large scientific applications to GPUs: An example from atmospheric science.
Originally formed as an application programming interface (API) in 1997, OpenMP is a platform-independent set of compiler directives that supports Fortran, C, and C++.
Now, its support of OpenMP will also allow code developers to use a standard set of compiler directives providing easy portability to other vendor systems.
Compiler directives are provided for specifying register alignment state, structure base address alignment, and likely flow paths at branch points.