Closed hebrewsnabla closed 1 year ago
You can adjust the library directory using the --libdir=lib
option. For Python in particular there are also additional options (see https://mesonbuild.com/Python-module.html#install_sources), -Dpython.purelibdir
and -Dpython.platlibdir
, for deciding where extension modules and where pure sources are installed.
See https://mesonbuild.com/Builtin-options.html#python-module for all available Python options during configuration.
You can adjust the library directory using the
--libdir=lib
option. For Python in particular there are also additional options (see https://mesonbuild.com/Python-module.html#install_sources),-Dpython.purelibdir
and-Dpython.platlibdir
, for deciding where extension modules and where pure sources are installed.See https://mesonbuild.com/Builtin-options.html#python-module for all available Python options during configuration.
Thanks! The additional options works for me.
This is installing into the purelibdir if you don't specify the pure: false
kwarg. But compiled C extension modules install to the platlibdir instead. Some OSes and Linux distros don't distinguish between platlib and purelib, defining both as the same directory... but some define them differently, particularly Debianlike distros.
For projects that mix both *.py
files and compiled extensions in the same importable package, pure python files need to use the same install schema as the compiled extensions. Otherwise, python's import system will notice __init__.py
, say "this is not a namespace package", and only use the first location that it finds, so it will not find the compiled extensions.
I would suggest adding that pure: false
kwarg.
I'm compiling this project with python interface enabled by
The compilation is ok, but I got an error when
import dftd3.pyscf
I check the location of _libdftd3 and find it's in lib64, so the library.py in lib cannot import it
Can this be fixed by some meson setting? I've tried change
meson configure _build --prefix=/home/wsr/s-dftd3
tomeson 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?