Does OpenMP (iomp5) work for clang-devel?

Shane Ambler FreeBSD at ShaneWare.Biz
Wed Aug 5 12:51:33 UTC 2015

On 21/07/2015 18:06, Shane Ambler wrote:
> On 21/07/2015 10:59, Dennis Glatting wrote:
>> On Tue, 2015-07-21 at 01:07 +0000, Brooks Davis wrote:
>>> On Mon, Jul 20, 2015 at 05:48:58PM -0700, Dennis Glatting wrote:
>>>> I can't seem to get this working and it appears not to emit code. I
>>>> have
>>>> libiomp5 installed and I compile specifying:
>>>>   clang++-devel -fopenmp=libiomp5 ...
>>>> And the compiler says:
>>>>   clang: warning: argument unused during compilation:
>>>> '-fopenmp=libiomp5'
> That should be just -fopenmp
>  From
> To enable OpenMP, just add ‘-fopenmp’ to the command line and provide
> paths to OpenMP headers and library with ‘-I <path to omp.h> -L <LLVM
> OpenMP library path>’.

Having just installed devel/llvm37 and done a few tests, this doesn't
appear to happen, for a single file test I also need to add -lomp

clang37 -fopenmp -I/usr/local/llvm37/include -L/usr/local/llvm37/lib
-lomp omp.c -o omp-test

One issue is that lldb breaks qtcreator. Sounds odd but I get -

[leader:~] shane% qtcreator
QProcess: Destroyed while process ("/usr/local/bin/lldb-mi-devel") is 
still running.
QProcess: Destroyed while process ("/usr/local/bin/lldb-mi37") is still 
Broken pipe
[leader:~] shane%

If I rename the two binaries reported qtcreator runs fine.
qtcreator-3.4.0 - rebuilt while llvm37 was installed without change.

My main interest in openmp is for compiling graphics/blender.
This breaks llvm37 -

I am running 10-stable -
FreeBSD leader.local 10.2-PRERELEASE FreeBSD 10.2-PRERELEASE #16 
r285937: Tue Jul 28 20:58:13 ACST 2015 
root at leader.local:/usr/obj/usr/src/sys/GENERIC  amd64

% pkg info -ox llvm37
llvm37-3.7.0.r1                devel/llvm37

Adding to make.conf -
.if ${.CURDIR:M*/graphics/blender*}

The build ends with -

[ 42%] Building C object 
Assertion failed: (!DMEntry && "Decl already exists in localdeclmap!"), 
function EmitAutoVarAlloca, file 
line 1016.
[ 42%] Building C object 
clang-3.7: error: unable to execute command: Abort trap
clang-3.7: error: clang frontend command failed due to signal (use -v to 
see invocation)
clang version 3.7.0 (tags/RELEASE_370/rc1)
Target: x86_64-unknown-freebsd10.2
Thread model: posix
clang-3.7: note: diagnostic msg: PLEASE submit a bug report to and include the crash backtrace, preprocessed 
source, and associated run script.
clang-3.7: note: diagnostic msg:

Preprocessed source(s) and associated run script(s) are located at:
clang-3.7: note: diagnostic msg: /tmp/BLI_kdopbvh-8090d7.c
clang-3.7: note: diagnostic msg: /tmp/
clang-3.7: note: diagnostic msg:


Full build log and debug files are available at

Brooks, I haven't submitted this upstream but can if you want.

FreeBSD - the place to B...Software Developing

Shane Ambler

More information about the freebsd-ports mailing list