Does OpenMP (iomp5) work for clang-devel?

Brooks Davis brooks at freebsd.org
Wed Aug 5 16:14:59 UTC 2015


On Wed, Aug 05, 2015 at 10:21:26PM +0930, Shane Ambler wrote:
> 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 http://blog.llvm.org/2015/05/openmp-support_22.html
> >
> > 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

Hmm, I hadn't tested openmp yet.  I had hoped that setting the cmake variable
to default to libomp has sufficient but apparently it isn't.  I'd like to get
-fopenmp working on it's own, but probably won't have a whole lot of time to
push this forward.

> 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 
> running.
> 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.

This looks like qtcreator is being too smart for it's own good and is using
two versions of lldb at the same time.  That seems likely to not work.

> 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*}
> CC=clang37
> CXX=clang++37
> CPP=clang-cpp37
> .endif
> 
> The build ends with -
> 
> [ 42%] Building C object 
> source/blender/editors/datafiles/CMakeFiles/bf_editor_datafiles.dir/__/__/__/__/release/datafiles/matcaps/mc04.jpg.c.o
> Assertion failed: (!DMEntry && "Decl already exists in localdeclmap!"), 
> function EmitAutoVarAlloca, file 
> /wrkdirs/usr/ports/devel/llvm37/work/llvm-3.7.0rc1.src/tools/clang/lib/CodeGen/CGDecl.cpp, 
> line 1016.
> [ 42%] Building C object 
> source/blender/bmesh/CMakeFiles/bf_bmesh.dir/operators/bmo_create.c.o
> 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 
> http://llvm.org/bugs/ and include the crash backtrace, preprocessed 
> source, and associated run script.
> clang-3.7: note: diagnostic msg:
> ********************
> 
> PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
> 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/BLI_kdopbvh-8090d7.sh
> clang-3.7: note: diagnostic msg:
> 
> ********************
> 
> Full build log and debug files are available at
> http://shaneware.biz/freebsddebugdata/clang37/
> 
> Brooks, I haven't submitted this upstream but can if you want.

You might test with clang-devel first, but submitting this upstream
is a good idea.  I don't develop llvm myself so can't do anything
particularly useful with crash reports.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20150805/b89dc07a/attachment.bin>


More information about the freebsd-ports mailing list