Skip to content

Error due to location of _libdftd3.cpython-xxx.so #25

@jeanwsr

Description

@jeanwsr

I'm compiling this project with python interface enabled by

meson setup _build -Dpython=true 
meson configure _build --prefix=/home/wsr/s-dftd3
meson install -C _build

The compilation is ok, but I got an error when import dftd3.pyscf

Traceback (most recent call last):
  File "/home/wsr/s-dftd3/lib/python3.10/site-packages/dftd3/library.py", line 25, in <module>
    from ._libdftd3 import ffi, lib
ModuleNotFoundError: No module named 'dftd3._libdftd3'

I check the location of _libdftd3 and find it's in lib64, so the library.py in lib cannot import it

wsr@yoga:~/simple-dftd3> ls ~/s-dftd3/lib64/python3.10/site-packages/dftd3/
_libdftd3.cpython-310-x86_64-linux-gnu.so
wsr@yoga:~/simple-dftd3> ls ~/s-dftd3/lib/python3.10/site-packages/dftd3/
ase.py       interface.py  parameters.py  pyscf.py     test_ase.py        test_library.py     test_pyscf.py
__init__.py  library.py    __pycache__    qcschema.py  test_interface.py  test_parameters.py  test_qcschema.py

Can this be fixed by some meson setting? I've tried change meson configure _build --prefix=/home/wsr/s-dftd3 to meson configure _build --prefix=/home/wsr/s-dftd3 --libdir=lib, but it doesn't work.
Or, can we change the way importing _libdftd3 so that its location does not matter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions