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-01.ibm.com/software/awdtools/fortran/ for XL Fortran

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

»More information

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

Compile with -xopenmp

»More information

»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 FortranMP Fortran
»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

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.

Get It

»OpenMP specs


Use It

»OpenMP Compilers


Learn It

»Using OpenMP -- the book
»Wikipedia
»OpenMP Tutorial
»More Resources


Discuss It

»User Forum
Ask the experts and get answers to questions about OpenMP