When I try to compile on Mac OS using the SimFactory optionlist macos-fink-gcc.cfg (https://svn.cct.lsu.edu/repos/numrel/simfactory2/trunk/mdb/optionlists/macos-fink-gcc.cfg), I get the following error at link time:
ld: warning: alignment lost in merging tentative definition _tmunubaserest_ ld: warning: alignment lost in merging tentative definition _admmacrosrest_ ld: warning: alignment lost in merging tentative definition _staticconformalrest_ Undefined symbols: "___emutls_get_address", referenced from: __ZN4dist25collect_total_num_threadsEv.omp_fn.0 in libthorn_CarpetLib.a(dist.cc.o) dist::collect_total_num_threads() in libthorn_CarpetLib.a(dist.cc.o) Carpet::SetupGH(tFleshConfig*, int, _cGH*) in libthorn_Carpet.a(SetupGH.cc.o) ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [/Users/ian/Cactus/Kerrness/exe/cactus_sim] Error 1 make: *** [sim] Error 2
I don't know if the "alignment lost" warnings are related to the fatal error. This seems to be some issue related to OpenMP. The problem appeared fairly recently, as I have been able to compile older versions of the ET with no problem, and this option list has not been changed.
I am reporting this against SimFactory because the problem does not happen with other option lists in the machine database, but I suspect that the issue arose due to a change in Carpet (maybe related to affinity?).
From some Google searching, this symbol is part of GCC's thread-local storage emulation for Mac OS. Some people have had this problem when mixing object files compiled by different versions of GCC. I am using GCC 4.4.4 from Fink:
> g++-4 --version g++-4 (GCC) 4.4.4
Using thread local storage (e.g. OpenMP ThreadPrivate variables) on Darwin requires manually linking to TLS emutls, via either -lgcc_s.so.1 or -lgcc_eh
There is also a suggestion to upgrade the version of GCC, which I am trying now.