This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
static linking with openmp (was: gomp - cost of threadprivate data access)
- From: VandeVondele Joost <vondele at pci dot uzh dot ch>
- To: fortran at gcc dot gnu dot org
- Cc: matevz dot tadel at cern dot ch, jakub at gcc dot gnu dot org
- Date: Tue, 17 Mar 2009 09:37:00 +0100 (MET)
- Subject: 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