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

cannot open shared object file: No such file or directory #2218

Closed
1 of 2 tasks
mscroggs opened this issue Sep 11, 2024 · 2 comments · Fixed by #2219
Closed
1 of 2 tasks

cannot open shared object file: No such file or directory #2218

mscroggs opened this issue Sep 11, 2024 · 2 comments · Fixed by #2219
Labels
bindings/cffi cffi bindings bug Something isn't working

Comments

@mscroggs
Copy link
Contributor

mscroggs commented Sep 11, 2024

Bug Description

Unable to find shared object when importing libary on Ubuntu.

Your maturin version (maturin --version)

1.7.1

Your Python version (python -V)

3.10.12

Your pip version (pip -V)

23.2.1

What bindings you're using

cffi

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

Getting this error when building https://github.com/bempp/ndelement, eg in the yanked pypi releases (https://pypi.org/project/ndelement/0.1.0.dev2/). Can get error locally by running:

maturin build
pip install target/wheels/ndelement-....whl
python -c "import ndelemement"
@mscroggs mscroggs added the bug Something isn't working label Sep 11, 2024
@mscroggs
Copy link
Contributor Author

This is fixed by #2219

@messense messense added the bindings/cffi cffi bindings label Sep 11, 2024
@messense
Copy link
Member

For future reference, the full error is

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.12/site-packages/ndelement/__init__.py", line 3, in <module>
    from ndelement import reference_cell, quadrature, polynomials, ciarlet
  File "/usr/local/lib/python3.12/site-packages/ndelement/reference_cell.py", line 6, in <module>
    from ndelement._ndelementrs import lib as _lib, ffi as _ffi
  File "/usr/local/lib/python3.12/site-packages/ndelement/_ndelementrs/__init__.py", line 6, in <module>
    lib = ffi.dlopen(os.path.join(os.path.dirname(__file__), '_ndelementrs.so'))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: cannot load library '/usr/local/lib/python3.12/site-packages/ndelement/_ndelementrs/_ndelementrs.so': libblas-babdd0d2.so.3: cannot open shared object file: No such file or directory

the problem is that the rpath is computed wrong:

root@5bc794e9f041:~# patchelf --print-rpath /usr/local/lib/python3.12/site-packages/ndelement/_ndelementrs/_ndelementrs.so
$ORIGIN/../ndelement.libs

should be $ORIGIN/../../ndelement.libs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bindings/cffi cffi bindings bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants