Steps to create a OpenMP enabled compiler?

<>

My aim is to use OpenMP compiler to compile some libraries to make them run multi-threaded. I am on Mac OSX - Mavericks. (The command I need to run is g++ -fopenmp mylib.cpp)

Following instructions from http://openmp.llvm.org/, I did the following

svn co http://llvm.org/svn/llvm-project/openmp/trunk openmp
cd openmp/runtime
make compiler=gcc

The make was successful. What should I do next?

Can someone please provide guidance?

Thanks,
Bargava

I’m sorry to say that I think you’re confused and have just wasted your time.

What you’ve done is to download and build the OpenMP runtime that is needed to work with the experimental OpenMP enabled clang front end.

But, what you seem to want to do is simply to have a compiler that can compile OpenMP codes.

Since you clearly already have gcc installed (otherwise you wouldn’t have been able to build the runtime by compiling it with gcc), I think you already have everything you need without building any compilers or compiler components.

AFAICT since you can run gcc, you should also be able to run g++, which has OpenMP support, and you aren’t interested in (and don’t need) the experimental clang, or the runtime to support it.

If you can’t just run g++, then check your PATHs and so on. (But none of that is relevant for debate here, since it’s all simply about installing GCC on your machine and making it work).

– Jim

James Cownie james.h.cownie@intel.com
SSG/DPD/TCAR (Technical Computing, Analyzers and Runtimes)

Tel: +44 117 9071438

Are the 3.5 clang binaries going to include any OpenMP support? If they are available for OSX - while it may not be ready for production use - maybe we should encourage people to at least test it or be aware it's maturing.

Hi Jim,

If I am not wrong, XCode 5 symlinks gcc to clang. (XCode 5 for Mavericks doesnt seem to support the GNU gcc). And so, it has no OpenMP support.

Also, on installing gcc, I was told that gcc will not be binary compatible with Apple’s LLVM-gcc and so, updating some of the existing libraries down the road may have issues (I may be wrong here though).

To be on the safe side, I’ve been trying to install a LLVM compatible OpenMP compiler.

Thanks,
Bargava

To be on the safe side, I’ve been trying to install a LLVM compatible OpenMP compiler.

In which case you need to download the compiler sources from http://clang-omp.github.io/ and build that too. :slight_smile:

– Jim

James Cownie james.h.cownie@intel.com
SSG/DPD/TCAR (Technical Computing, Analyzers and Runtimes)

Tel: +44 117 9071438

Bargava,

The llvm34 packaging in the fink packaging project (http://www.finkproject.org) is based on the llvm.org 3.4.2 release with the changes from the clang-omp git applied. If you have fink installed on your Mavericks machine, you can install these with…

fink install clang34

which will give you a set of clang-3.4/clang+±3.4 compilers that default to linking libiomp5 from /sw/opt/llvm-3.4/lib for -fopenmp.
Note that the clang-omp git is still based on clang 3.4 and it will be impossible to cleanly merge those changes into either the upcoming clang 3.5 or 3.6 releases from llvm.org. Currently, the llvm.org clang 3.5/3.6svn compilers only contain the parsing/sema changes for the openmp support but not yet the changes to implement the openmp code generation. Thus, they perform very poorly in the OpenMP3.1_Validation test suite compared to clang-omp based compilers in the llvm34-3.4.2-1 package from…

http://fink.cvs.sourceforge.net/fink/dists/10.7/stable/main/finkinfo/languages/llvm34.info?view=markup

Jack