Re: Linking OpenMP Statically on Mac

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sending answer to the list for the benefit of future searchers.

On Fri, May 8, 2015 at 3:11 PM, Ángel González wrote:
 On 01/05/15 05:50, Rob McDonald wrote:

 When I specify -fopenmp, the program is dynamically linked to
 libgomp.1.dylib.  I read that -static is not supported on OSX, as the
 Apple system libraries are not provided with static variants.

 So, is there a way to statically link libgomp in this situation?

 If you have/build libgomp as a static library, it should be possible to only
 link libcomp statically. If -fopenmp flag insists on linking dynamically,
 you may need to call the linker manually. But I think it could be done.

As it turns out, there was a simple solution....

-static-libgcc -static-libstdc++

also forces static linking of libgomp for OpenMP.  I couldn't find
this documented anywhere, but it is good enough for me.

Thanks for the reply,

Rob






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux