This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

static linking with openmp (was: gomp - cost of threadprivate data access)




If you want to statically link with gcc and openmp (i.e. combine -fopenmp -static), you should have a look at:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39176#c7

basically you have to link pthreads yourself as

-Wl,--whole-archive -lpthread -Wl,--no-whole-archive

as the default way of linking things causes segfaults. My feeling was that gcc should take care of this automagically, but this doesn't seem to be the consensus.

As a side note, let me mention that in HPC static linking is the rule rather than the exception...

Cheers,

Joost VandeVondele


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]