# Remove RTLD_LOCAL

XMLWordPrintable

#### Details

• Type: Bug
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Story Points:
0.25
• Sprint:
DRP F16-1
• Team:
Data Release Production

#### Description

Mario Juric writes:

The recent convenience functions & checks you merged into base break MKL on OS X. I traced it down the other night and your code requires a one-word change (removal of RTLD_LOCAL).

Could you plug that in when you get a chance?

PS: The problem is that on OS X, apparently once you load a library with RTLD_LOCAL, it will remain local even when it’s subsequently auto-loaded as a dependency of another library (which then won’t be able to find the symbols it needs, ergo the error message). In particular, the issue here is that running:

 getMklThreads = loadSymbol("libiomp5", "omp_get_max_threads"); 

loads libiomp5 as RTLD_LOCAL, and then the next time when the linker needs it (when loading MKL-enabled numpy on OS X, which is linked against libmkl_core, which itself is linked against libiomp5) it doesn’t find its symbols.

I need to check that this won't break things on Linux.

#### Activity

Hide
Tim Jenness added a comment -

Gosh. At least we can all agree that the assignee is the person who did the work...

Show
Tim Jenness added a comment - Gosh. At least we can all agree that the assignee is the person who did the work...
Hide
Paul Price added a comment -

No, we can't! I just copied Mario's patch.

Show
Paul Price added a comment - No, we can't! I just copied Mario's patch.
Hide
Tim Jenness added a comment -

We can't even trust the reporter because Mario Juric was obviously the reporter...

Show
Tim Jenness added a comment - We can't even trust the reporter because Mario Juric was obviously the reporter...
Hide
John Swinbank added a comment -

I have conveniently sidestepped my scheduling headaches by marking this as a bug, so we can legitimately pick it up mid-sprint.

Show
John Swinbank added a comment - I have conveniently sidestepped my scheduling headaches by marking this as a bug, so we can legitimately pick it up mid-sprint.
Hide
Paul Price added a comment -

Merged to master.

Show
Paul Price added a comment - Merged to master.

#### People

Assignee:
Paul Price
Reporter:
Paul Price
Reviewers:
Tim Jenness
Watchers:
John Swinbank, Mario Juric, Paul Price, Tim Jenness