-
Notifications
You must be signed in to change notification settings - Fork 145
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
auditwheel is removing from RPATH #404
Comments
Here is the debug repair run:
Is there any way to change this behavior? |
For what it's worth, this is my workaround for preventing the tool from removing preset rpath values.
|
Please provide more details on your layout, discarding things pointing outside the wheel as noted in the message is a sane behavior. |
Hi @mayeut, In an Anaconda environement, the application works correctly, because the python binary encodes an RPATH which can find the needed blas/lapack library:
In
Therefore the only
where the 3rd Note that:
I suggest not discarding things pointing inside of a valid Python environment may be a sane behavior. Unfortunately in my experience, Ubuntu does not have a proper |
IMHO, it's still sane to discard. there's an overlap with what's described here and this comment: #391 (comment) For PyPI distribution (I don't know enough about conda to give specifics here), you can use importlib.metadata to locate the mkl shared object you want to load if intel doesn't provide this in its MKL distribution package. |
MKL is several hundred megabytes long and I don't want to force it on users if they want to use another ABI compliant implementation of the BLAS/LAPACK library. Many python environments put "RPATH=$ORIGIN/../lib" on the Python executable. I think my approach is a valid workaround to the fact that Ubuntu Python and Homebrew Python does not do that, but Anaconda Python does. The fact that numpy is using a similar trick for their libraries indicates there may be some validity to my approach.
If there is no official support, I will continue to override the |
One additional issue, is that the MKL library is runtime dispatched to the specific processor. So the libmkl_rt.so dispatches to any of a large number of shared libraries, depending on the user's specific cpu. So it is not possible to just package one shared library out of the entire MKL package. |
conda uses its own packaging system & has been designed to handle native dependencies natively, so, taking numpy as an example since you introduced it, you'll see that the conda package & the PyPI package are not the same:
The conda specific package links against conda provided mkl with numpy having a well defined RPATH in the conda ecosystem. For conda, you might want to look at conda-forge to provide your package in a way that's specific to conda (including RPATH), which will also get rid of the sqlite/libquadmath dependencies bundled in your PyPI distribution. For the PyPI distribution, patching your
|
Summary:In my opinion, I would be willing to create a pull request to provide this whitelisting behavior. However, I am getting the impression that it would get immediately rejected. DiscussionMy approachThanks for your suggested solution, but it is not really applicable to the usage model to my software, as the modules are being loaded directly by the C++ extension using I was iterating through potential paths, but it preferable use If users decide not to use a conda or virtual environment, they are free to use Side noteWith respect to the quadmath and sqlite suggestions:
NumpyThanks for providing an explanation of the CondaI am not interested in providing a |
If other maintainers disagree with me, I might be convinced otherwise. cc @lkollar
The code shared works as-is for MKL when the patched RPATH is removed from devsim.
|
I agree with @mayeut. Hard coding the relative RPATH will not work reliably in all environments (what happens with Grafting a 700MB library might not be desirable, but the alternative's like @mayeut's example should be able to help. |
The grafting is not happening, since I am using
The I will continue with my hack, since there is no solution to the problem. I am unsure why, after notifying users they need to be using a |
* auditwheel (the tool required to make manylinux packages) does not seem to like our workaround * See Discussion in: pypa/auditwheel#404
Hello,
Using the manylinux2014 image to build my application with auditwheel, the repair is transforming the RPATH from:
to
Where it relocates zlib and sqlite into the devsim.libs directory.
Is there any way to prevent the tool from removing the trailing path? It is necessary to have this in my search path for a
dlopen
math library. Without this, my application cannot find a library since the$VIRTUAL_ENV/bin/python
did not set its own RPATH.The text was updated successfully, but these errors were encountered: