Description of problem:
Currently OpenMP is not enabled in fedora clang
Version-Release number of selected component (if applicable):
[currently using F25 - but filed it against rawhide - as this is a RFE]
Steps to Reproduce:
1. wget https://computing.llnl.gov/tutorials/openMP/samples/C/omp_hello.c
2. /usr/bin/clang -fopenmp omp_hello.c
omp_hello.c:13:10: fatal error: 'omp.h' file not found
1 error generated.
"With the release of Clang 3.8.0, OpenMP 3.1 support is enabled in Clang by default, and the OpenMP runtime is therefore built as a normal part of the Clang build, and distributed with the binary distributions.You do not, therefore, need explicitly to check out this code, or build it out of tree; a normal Clang check out and build will automatically include building these runtime libraries."
But somehow its not enabled in fedora clang build?
A prebuilt binary from http://releases.llvm.org/download.html#3.9.0 does work.
$ /home/balay/soft/clang+llvm-3.9.0-x86_64-fedora23/bin/clang --version
clang version 3.9.0 (tags/RELEASE_390/final)
Thread model: posix
clang defaults to using the libomp runtime which is not currently packaged with fedora. You can use the libgomp runtime instead, but you need to manually specify the include path, because clang does not auto-detect the headers installed with libgomp (The include path on your system might look slightly different)
./bin/clang -fopenmp=libgomp -I /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include/ omp_hello.c
Sure there are workarounds. This is an RFE for enabling clang native support for OpenMP
If you want to rephrase it as "RFE for packaging llvm libomp" - thats fine
On my Rawhide system, I can link a Clang-compiled executable to libgomp using the workaround given above, but it runs single-threaded, even if I call omp_set_num_threads() explicitly. Packaging LLVM OpenMP for Fedora would be a help to us math & science types. BTW, building the LLVM 4.0.1 OpenMP library from source works fine under Rawhide. It's quite stand-alone, not requiring an LLVM build.
libomp package is now in Rawhide and Fedora 27.
libomp and libomp-devel 5.0.1 are working fine with Clang 5.0.1 on my Rawhide system. Good work, guys.