#229 "make shared" fails because multiple object files define the same functions

Both
open-fixed
None
5
2014-08-05
2013-05-15
No

Dear Clint,

Thanks again for your hard work.

Trying to get ATLAS updated in Sage, we found out that in the case where ATLAS tuning finds out that mutex implementations of ATL_{Dec,Free,...}Atomic functions are not slower than the assembly ones (and then calls make IForceMutex), then two objects in the static archive libatlas.a end up defining them and then repacking it into a shared library by running "make shared" fails because of these multiple definition.

Thanks in advance for your help,
best,
JP

Discussion

  • Volker Braun
    Volker Braun
    2013-08-30

    The failure only appears if mutex is faster than assembly in tune_count.c. You reliably trigger it by replacing if (tmut < tldec*1.02) with if (1). That is, calling the make iForceUseMutex ends up giving us duplicate symbols in the static library, which then causes an error when building the shared library.

    On i7 machines the assembly is always much faster, so it never happens on modern hardware. But some AMD machines seem to trigger this, e.g. lena on skynet.

     
  • Ticket moved from /p/math-atlas/support-requests/907/

     
  • I have not confirmed this myself, but I have no doubt it is true. Do you have a tested fix for this, or do you just manually remove the dupped symbols when it happens?

    I'm about to release a stable patch, but this section of code is delicate enough that I'm likely to leave the known but rare bug in rather than manipulate it myself and risk breaking something else.

    For developer, I hope to rewrite all this as part of the threaded overhaul . . .

    Thanks,
    Clint

     
  • I believe I have a fix for this. This piece-of-shit tracker removes all spaces in anything I attempt to show code with, so put the appropriate tabs.

    Before install, add the following lines to the end of Make.thr:
    killaobj:
    - rm -f $(aobj)
    - ar d $(ATLASlib) $(aobj)
    Then, add the following line as the first line of the <t>iForceUseMutex</t> in Make.ttune:
    cd $(BLDdir)/src/threads ; make killaobj

     
    • status: open --> open-fixed
    • assigned_to: R. Clint Whaley
    • Group: both_stable_and_developer --> Both
     
  • I've made this change to developer basefiles.