CLOMP: OpenMP frontend for Clang (and much more)

Dear all,
I worked for some time on an OpenMP frontend based on Clang. This is not just an OpenMP frontend but a more comprehensive framework to handle user defined pragmas. OpenMP is implemented just to test its functionalities. This was implemented as part of a bigger project called insieme which is developed at the university of Innsbruck ( http://insieme-compiler.org/). Several people asked me to release this code since long time and I finally took some time to isolate the pragma handling mechanism from the rest of the project and open source it. This is only the frontend part, there is no backend. Therefore, if you happen to have an OpenMP backend for LLVM and you need a frontend then you just found your soul mate :slight_smile:

I host this code in the following repository: https://github.com/motonacciu/clomp

This project contains the infrastructure for pragma handling and the OpenMP frontend. It doesn’t work on the current SVN release on clang. It requires LLVM/Clang 3.0 and additionally a small patch has to be applied to Clang in order for the all thing to work. However the patch can be easily updated to work with the latest clang. The project contains a couple of examples that show how it is meant to be used.

In order to compile the project you need to do 2 things. First of all install the patched version of LLVM/Clang. This can be done by running the llvm-3.0-installer.sh script stored in the script folder. Clomp is built with cmake. Specify the LLVM_HOME=/path/to/patched-llvm env variable when you run CMAKE. It is required to set up some internal paths. (I will add installation instruction in the project web page soon)

It would be nice to have the code in Clang (so that I don’t have to update the patch every time a new release of clang comes along) but I really have no time to rewrite everything to conform with the coding style of LLVM. I use C++11 a lot and templates as well and I know LLVM how people here feel about those things. :slight_smile: Also the code was first written more than 1 year ago and I suppose in the meantime several things have changed in Clang and probably there is an easier way to do some of the things. If someone is interested in taking over the effort of going through a code review and port it into clang I can help, just contact me. The code is well tested and functional. It can handle several OpenMP benchmark codes like the NAS Parallel Benchmarks and Rodinia benchmarks.

Everyone can use it. If you do so, please cite. I am open to research collaborations.

cheers, Simone

Simone,

Thank you for taking the time to extract this from your codebase. For
any of this code to be directly usable in clang, it will need to be
relicensed (most of the files seem to be under the GPL currently). Once
that is done, I will certainly help with the rebasing, coding-standards
changes, etc.

Sincerely,
Hal

Simone,

Thank you for taking the time to extract this from your codebase. For
any of this code to be directly usable in clang, it will need to be
relicensed (most of the files seem to be under the GPL currently). Once
that is done, I will certainly help with the rebasing, coding-standards
changes, etc.

The GPL is not an issue, I can relax it. However I need to know what kind of license you need, I am not allowed to release the code without any license.

cheers, Simone

> Simone,
>
> Thank you for taking the time to extract this from your codebase.
> For any of this code to be directly usable in clang, it will need
> to be relicensed (most of the files seem to be under the GPL
> currently). Once that is done, I will certainly help with the
> rebasing, coding-standards changes, etc.

The GPL is not an issue, I can relax it. However I need to know what
kind of license you need, I am not allowed to release the code
without any license.

Fair enough. Can you release it under LLVM's license? That is certainly
the easiest from an integration perspective.

Thanks again,
Hal

We would need for the code to be released under the UIUC license used by the rest of LLVM. FYI, the project's policies are laid out here:
http://llvm.org/docs/DeveloperPolicy.html

-Chris

Clomp is now under the University of Illinois/NCSA Open Source License.

cheers, Simone

Simone,

Great! I think that the best way to proceed is to also create a
separate github repo which mirrors clang trunk where we can work on
merging in the OpenMP parsing and semantic-analysis code (and adding
the necessary driver changes and regression tests).

-Hal