Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadSymbol: remove RTLD_LOCAL in dlopen #7

Merged
merged 1 commit into from Jun 22, 2016
Merged

Conversation

timj
Copy link
Member

@timj timj commented Jun 21, 2016

Mario Juric notes:
Otherwise (at least on OS X) when a library opened as such is
needed later by a different library, its symbols aren't found.

In particular, this was a problem with MKL-enabled numpy on
anaconda, causing errors such as this (when building ip-diffim):

====
ImportError: dlopen(/Users/mjuric/projects/conda-lsst/miniconda/envs/_build/lib/python2.7/site-packages/scipy/linalg/_fblas.so, 2): Symbol not found: ___kmpc_atomic_cmplx4_add
  Referenced from: /Users/mjuric/projects/conda-lsst/miniconda/envs/_build/lib/python2.7/site-packages/scipy/linalg/../../../../libmkl_intel_thread.dylib
    Expected in: flat namespace
     in /Users/mjuric/projects/conda-lsst/miniconda/envs/_build/lib/python2.7/site-packages/scipy/linalg/../../../../libmkl_intel_thread.dylib
====

The problem is easy to replicate in general, by importing the
`_lsstcppimport` module, followed by importing `numpy`.

Removing RTLD_LOCAL fixes this on the Mac, and shouldn't impact Linux
because it is the default there.

Mario Juric notes:
    Otherwise (at least on OS X) when a library opened as such is
    needed later by a different library, its symbols aren't found.

    In particular, this was a problem with MKL-enabled numpy on
    anaconda, causing errors such as this (when building ip-diffim):

    ====
    ImportError: dlopen(/Users/mjuric/projects/conda-lsst/miniconda/envs/_build/lib/python2.7/site-packages/scipy/linalg/_fblas.so, 2): Symbol not found: ___kmpc_atomic_cmplx4_add
      Referenced from: /Users/mjuric/projects/conda-lsst/miniconda/envs/_build/lib/python2.7/site-packages/scipy/linalg/../../../../libmkl_intel_thread.dylib
        Expected in: flat namespace
         in /Users/mjuric/projects/conda-lsst/miniconda/envs/_build/lib/python2.7/site-packages/scipy/linalg/../../../../libmkl_intel_thread.dylib
    ====

    The problem is easy to replicate in general, by importing the
    `_lsstcppimport` module, followed by importing `numpy`.

Removing RTLD_LOCAL fixes this on the Mac, and shouldn't impact Linux
because it is the default there.
@PaulPrice PaulPrice merged commit 4fb95f7 into master Jun 22, 2016
@ktlim ktlim deleted the tickets/DM-6587 branch August 25, 2018 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants