Opened 7 years ago

Last modified 6 years ago

#946 new defect

Undefined symbol ___emutls_get_address

Reported by: Ian Hinder Owned by: Erik Schnetter
Priority: major Milestone:
Component: SimFactory Version:
Keywords: Cc:


When I try to compile on Mac OS using the SimFactory optionlist 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::collect_total_num_threads()      in libthorn_CarpetLib.a(
      Carpet::SetupGH(tFleshConfig*, int, _cGH*) in libthorn_Carpet.a(
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [/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

This page,, says

Using thread local storage (e.g. OpenMP ThreadPrivate variables) on Darwin requires manually linking to TLS emutls, via either or -lgcc_eh

There is also a suggestion to upgrade the version of GCC, which I am trying now.

Attachments (0)

Change History (5)

comment:1 Changed 7 years ago by Ian Hinder

This happens also with a fully up-to-date version of the packages from Fink (GCC 4.4.6). It does not happen if I instead use MacPorts and Since MacPorts now actively supports binary packages and Fink does not have any for the last two Mac OS versions, I will switch to MacPorts and have little interest in debugging the Fink problem discussed in this ticket. This leaves no one maintaining the Fink option list, so I propose that it be deprecated. MacPorts seems much more popular anyway.

comment:2 Changed 7 years ago by Erik Schnetter

For the record: the warning about "lost alignment" and the error about "tls" are unrelated. The former is about the memory layout of global variables in C and Fortran, and is harmless. The second (tls) is about multi-threading.

comment:3 Changed 7 years ago by Erik Schnetter

Should we remove the macos-fink option list from Simfactory (i.e. move it into the OUTDATED subdirectory)?

comment:4 Changed 7 years ago by Ian Hinder

Maybe ask on the list if anyone is using it? If not, then it's fine to move it immediately. If they are, then we could help them transition to MacPorts, and then remove it. It's a bit better than removing it suddenly.

comment:5 Changed 6 years ago by Erik Schnetter

Does this problem still exist?

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain Erik Schnetter.
Next status will be 'review'.
as The resolution will be set.
to The owner will be changed from Erik Schnetter to the specified user.
Next status will be 'confirmed'.
The owner will be changed from Erik Schnetter to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.