OpenMP Compilers

A number of compilers from various vendors or open source communities implement the OpenMP API:

Vendor/Source
Compiler
Information
»GNU
gcc (4.3.2)
Free and open source - Linux, Solaris, AIX, MacOSX, Windows

Compile with -fopenmp

»More information

»IBM
XL C/C++ / Fortran
Windows, AIX and Linux.

http://www.ibm.com/software/rational/cafe/community/ccpp  -  the IBM C/C++ Community

http://www-01.ibm.com/software/awdtools/fortran/ for XL Fortran

http://www-01.ibm.com/software/awdtools/xlcpp/ for XL C/C++.

»More information

»Oracle
C/C++ / Fortran Sun Studio compilers and tools - free download for Solaris and Linux.

Compile with -xopenmp

»More information

»Documentation

»Tools: Thread Analyzer/Performance Analyzer

»Intel
C/C++ / Fortran

(10.1)

Windows, Linux, and MacOSX.

Compile with -Qopenmp on Windows, or just -openmp on Linux or Mac OSX

»More information

»Portland Group Compilers and Tools C/C++ / Fortran »More Information on PGI Compilers

Compile with -mp

»More Information on PGI OpenMP

»Absoft Pro Fortran Fortran Version 11.0 of the Fortran 95 compiler for Linux, Windows and Mac OS X  includes integrated support OpenMP 2.5.   Compile with -openmp.  »More Information
»Lahey/Fujitsu Fortran 95 C/C++ / Fortran »More Information
»PathScale C/C++ / Fortran Linux 32/64 bit. »PathScale Compiler Suite User Guide
»HP C/C++ / Fortran »More Information
»MS Visual Studio 2008 C++ Implements OpenMP 2.0 »More Information
»Cray Cray C/C++ and Fortran Supports OpenMP 3.0 on the Cray XT series Linux environment. OpenMP is on by default.  »More Information

Test Your Compiler and Environment

Here is a trivial test program that you can use to test your compiler and environment (file hello.c):

#include <omp.h>
#include <stdio.h>
int main() {
#pragma omp parallel
printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads());
}

Compilation should proceed with no errors or warnings.

Execute the output, called variously a.out, a.exe, hello.exe . You should see more than one “Hello” line
with different thread numbers. Note that the lines may be mixed together. If you see only one, try setting the environment variable OMP_NUM_THREADS to some number (say 4) and try again.