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

dlopen() our libblas and liblapack within libjulia-internal #41412

Merged
merged 1 commit into from
Jun 30, 2021

Conversation

staticfloat
Copy link
Member

@staticfloat staticfloat commented Jun 29, 2021

Fixes #41388

When loading our libblas and liblapack for the first time, we may
need to rely upon an RPATH that has been embedded within
libjulia-internal. If we use libblastrampoline to perform the
actual dlopen(), however, we don't have that RPATH at hand.

To fix this, we instead dlopen() the library first, to force the
proper loading of the library (which loads the library and its SONAME
into our process), which allows libblastrampoline's dlopen() to
immediately succeed, along the happy path of finding the library already
loaded.

When loading our `libblas` and `liblapack` for the first time, we may
need to rely upon an `RPATH` that has been embedded within
`libjulia-internal`.  If we use `libblastrampoline` to perform the
actual `dlopen()`, however, we don't have that `RPATH` at hand.

To fix this, we instead `dlopen()` the library first, to force the
proper loading of the library (which loads the library and its `SONAME`
into our process), which allows `libblastrampoline`'s `dlopen()` to
immediately succeed, along the happy path of finding the library already
loaded.
@staticfloat staticfloat requested a review from nalimilan June 29, 2021 22:57
@staticfloat
Copy link
Member Author

Fixes #41388

Copy link
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I can confirm this fixes #41388 locally.

@DilumAluthge DilumAluthge added the bugfix This change fixes an existing bug label Jun 30, 2021
@staticfloat staticfloat merged commit 97a62dd into master Jun 30, 2021
@staticfloat staticfloat deleted the sf/dont_trust_lbt_to_dlopen branch June 30, 2021 16:45
rashidrafeek pushed a commit to rashidrafeek/julia that referenced this pull request Jul 2, 2021
…uliaLang#41412)

When loading our `libblas` and `liblapack` for the first time, we may
need to rely upon an `RPATH` that has been embedded within
`libjulia-internal`.  If we use `libblastrampoline` to perform the
actual `dlopen()`, however, we don't have that `RPATH` at hand.

To fix this, we instead `dlopen()` the library first, to force the
proper loading of the library (which loads the library and its `SONAME`
into our process), which allows `libblastrampoline`'s `dlopen()` to
immediately succeed, along the happy path of finding the library already
loaded.
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
…uliaLang#41412)

When loading our `libblas` and `liblapack` for the first time, we may
need to rely upon an `RPATH` that has been embedded within
`libjulia-internal`.  If we use `libblastrampoline` to perform the
actual `dlopen()`, however, we don't have that `RPATH` at hand.

To fix this, we instead `dlopen()` the library first, to force the
proper loading of the library (which loads the library and its `SONAME`
into our process), which allows `libblastrampoline`'s `dlopen()` to
immediately succeed, along the happy path of finding the library already
loaded.
KristofferC pushed a commit that referenced this pull request Jul 5, 2021
…41412)

When loading our `libblas` and `liblapack` for the first time, we may
need to rely upon an `RPATH` that has been embedded within
`libjulia-internal`.  If we use `libblastrampoline` to perform the
actual `dlopen()`, however, we don't have that `RPATH` at hand.

To fix this, we instead `dlopen()` the library first, to force the
proper loading of the library (which loads the library and its `SONAME`
into our process), which allows `libblastrampoline`'s `dlopen()` to
immediately succeed, along the happy path of finding the library already
loaded.

(cherry picked from commit 97a62dd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build failure when setting custom prefix and libdir
4 participants