[cfe-dev] [Openmp-dev] [LLVMdev] libiomp, not libgomp as default library linked with -fopenmp
Cownie, James H
james.h.cownie at intel.com
Fri May 1 03:08:02 PDT 2015
> It looks like openmp/runtime/README.txt could use an update to clarify
> this status. The title is "README for the Intel(R) OpenMP* Runtime
> Library" and there's a of supported Intel architectures -- this gives
> a somewhat different impression than what's described in this thread.
Of course we'd be very happy to accept patches that update the document to include the relevant support matrices for non-Intel processors (and to change the misleading documentation titles).
Since this *is* a collaborative development, I'd hope that IBM can contribute information
for their machines, since they did the port, and any input from the folks who worked on the ARM code would also be great.
In the more general discussion, I think one critical point was made less forcefully than it merits, which is that the LLVN OpenMP runtime (libiomp5) *is binary compatible* with the GCC one (libgomp); libiomp5 includes the entrypoints used by GCC. Therefore replacing libgomp in the distribution with libiomp5 should not cause problems for people who are using the libgomp interfaces. Their code should continue to link and run without a problem.
This compatibility means that you can link code compiled with gcc -fopenmp against the LLVM runtime (and mix it with code compiled by clang's OpenMP support). What you *cannot* do is compile code with clang/Openmp and link it against the GCC OpenMP runtime.
So, replacing the GCC OpenMP runtime as the default runtime for the clang distribution should not cause any compatibility issues for anyone who was using the libgomp that was previously distributed, but does ensure that the runtime is compatible with LLVM. (Which is the whole point, surely!)
(Full disclosure: There is one incompatibility between the libraries because the LLVM runtime does not support one interface that gcc -openmp uses for a tasking feature that is not in OpenMP 3.1. The interface gcc uses has significant performance implications for code that never uses tasking, and that seemed unreasonable. The same limitation applies to the Intel OpenMP runtime, and we have had no complaints about it yet :-). This incompatibility only arose with gcc 4.8 (IIRC); code compiled by earlier gcc's cannot hit the problem [because they don't support the language feature in question!].
James Cownie <james.h.cownie at intel.com>
SSG/DPD/TCAR (Technical Computing, Analyzers and Runtimes)
Tel: +44 117 9071438
From: openmp-dev-bounces at cs.uiuc.edu [mailto:openmp-dev-bounces at cs.uiuc.edu] On Behalf Of Andrey Bokhanko
Sent: Friday, May 1, 2015 9:16 AM
To: Ed Maste; openmp-dev at dcs-maillist2.engr.illinois.edu
Cc: cfe-dev; LLVM Developers Mailing List
Subject: Re: [Openmp-dev] [LLVMdev] libiomp, not libgomp as default library linked with -fopenmp
Adding openmp-dev list and Andrey [Churbanov].
Andrey, please see Ed's message below.
On Thu, Apr 30, 2015 at 6:59 PM, Ed Maste <emaste at freebsd.org> wrote:
On 30 April 2015 at 10:06, Hal Finkel <hfinkel at anl.gov> wrote:
>> I'd like to resurrect the discussion on replacing libgomp with
>> libiomp as the default OpenMP runtime library linked with -fopenmp.
>> For reference, the previous discussion is accessible there:
>> We are very close to getting *full* OpenMP 3.1 specification
>> supported in clang (only one (!) clause is not implemented yet, and
>> the patch is already sent for review today:
>> http://reviews.llvm.org/D9370 ). This implementation generates Intel
>> API library calls; thus, it can't be used with libgomp and it is
>> simply logical to link a compatible runtime (libiomp) instead.
> To be clear, this is now LLVM's OpenMP runtime (not just Intel's), and has been ported to several platforms in addition to x86 (PowerPC, ARM).
It looks like openmp/runtime/README.txt could use an update to clarify
this status. The title is "README for the Intel(R) OpenMP* Runtime
Library" and there's a of supported Intel architectures -- this gives
a somewhat different impression than what's described in this thread.
That said, I would also be happy to see the default switched to libiomp.
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
More information about the cfe-dev