OpenMP Compilers

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

Vendor/Source
Compiler
Information
»GNU
gcc  
Free and open source - Linux, Solaris, AIX, MacOSX, Windows
OpenMP 3.1 is supported since GCC 4.7
» GCC OpenMP Wiki

Compile with -fopenmp

» GCC’s OpenMP Manual

»More information

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

http://www.ibm.com/developerworks/
rational/community/cafe/ccpp.html  -  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 Oracle Solaris Studio compilers and tools - free download for Solaris and Linux.Oracle Solaris Studio 12.3 compilers support OpenMP 3.1

Compile with -xopenmp

»More information

»OpenMP User’s Guide

»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.1 of the Fortran 95 compiler for Linux, Windows and Mac OS X includes integrated  OpenMP 3.0 support.  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-2010 C++ Implements OpenMP 2.0  Not all versions support OpenMP. Visual Studio 2008 supports OpenMP in the Standard, Professional and Team System Editions. Visual Studio 2010 supports OpenMP in the Professional, Premium and Ultimate Editions. »More Information
»Cray Cray C/C++ and Fortran Supports OpenMP 3.1. OpenMP is on by default.  »More Information
»NAG nagfor NAG Fortran Complier 5.3 supports the most common features of OpenMP 3.0 on x86.
For x64 Linux, x64 Mac and Windows.Compile with -openmp

»More Information

OpenUH Research Compiler C/C++/Fortran Supports OpenMP 3.0. »More Information
»LLVM clang Free and open source (BSD-style license) -
Linux, MacOS X OpenMP 3.1

»OpenMP-enabled clang compiler

Instructions on how to build an OpenMP-enabled version of the clang Compiler are at »http://clang-omp.github.com

Compile with -fopenmp

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.