OpenMP®: Support for the OpenMP language
The OpenMP subproject of LLVM is intended to contain all of the components required to build an executing OpenMP program that are outside the compiler itself.
Here you can find :-
- the code for the runtime library against which code compiled by the OpenMP/Clang compiler must be linked before it can run. This code is also available at openmprtl.org; we intend to keep the different sites in sync.
- the library that supports offload to target devices (in "offload")
- the OpenUH test-suite which is being integrated.
Support for the parts of the OpenMP 4.0 language that are not associated with the "target" constructs are contained in the "runtime" directory. Support for offloading computation via the "target" directive is in the separate "offload" directory. That builds a library that provides the interfaces for transferring code and data to an attached computational device. Initial support here is for the Intel® Xeon Phi coprocessor, but work is beginning to support other attached computing devices, and the design is intended to be general. The README.txt in the "offload" directory describes how to build the offload library.
All of the code here is dual licensed under the MIT license and the UIUC License (a BSD-like license). The LICENSE.txt file at the top of the OpenMP project contains the license text and associated patent grants.
Features and Goals
- Correctness as defined by the OpenMP 3.1 standard (PDF) now, and OpenMP 4.0 standard (PDF) in the future.
- High performance.
- ABI compatibility with Gcc and Intel's existing OpenMP compilers. With this release we have restored compatibility with OpenMP 3.1 code compiled by gcc 4.9, however we do not have support for OpenMP 4.0 code that uses task cancellation when compiled by gcc 4.9. How we will support such code remains a research issue.
Why have the runtime code here?
It makes sense to have the runtime sources in the same place (and with the same license) as the compiler.
The OpenMP runtime is known to work on
- ARM® architecture processors
- PowerPC™ processors
- 32 and 64 bit X86 processors when compiled with clang, with the Intel compiler or with gcc, and also the Intel® Xeon Phi™ product family, when compiled with the Intel compiler.
A full OS and archiecture compatibility matrix is in README.txt
The runtime can be built with gcc, icc or clang. However, note that a runtime built with clang cannot be guaranteed to work with OpenMP code compiled by the other compilers, since clang does not support a 128-bit float type, and cannot therefore generate the code used for reductions of that type (which may occur in user code compiled by the other compilers).
The University of Houston has kindly contributed their test suite (in the "testsuite" directory). Integration and use of this for automatic testing is in progress.
Get it and get involved!
First please review our Developer's Policy.
To check out the code, use:
svn co http://llvm.org/svn/llvm-project/openmp/trunk openmp
Note that for an in-tree build, you should check out openmp to llvm/projects.
- Check out openmp into llvm/projects
mkdir build && cd build
cmake path/to/llvm -DCMAKE_C_COMPILER=<C compiler> -DCMAKE_CXX_COMPILER=<C++ compiler>
- Check out openmp
mkdir build && cd build
cmake path/to/openmp -DCMAKE_C_COMPILER=<C compiler> -DCMAKE_CXX_COMPILER=<C++ compiler>
Full details of how to build are in the README.txt and Build_With_CMake.txt (inside the runtime/ subdirectory)
Send discussions to the (OpenMP mailing list).
- The OpenMP name and the OpenMP logo are registered trademarks of the OpenMP Architecture Review Board.
- Intel is a trademark of Intel Corporation in the U.S. and/or other countries.
- PowerPC is a trademark of IBM Corporation in the U.S. and/or other countries.
- ARM is a trademark of ARM Corporation in the U.S. and/or other countries.