Closed anntzer closed 11 months ago
Thanks. Yes, I need to improve the documentation here.
You need to do make install
before you do make pip_install
. Otherwise the DIPlib libraries will not be found by the Python module.
Alternatively, you could set DIP_PYDIP_WHEEL_INCLUDE_LIBS
to On
in the CMake configuration step. In this case, the DIPlib libraries will be copied over into the installed wheel.
I tried with cmake -DDIP_PYDIP_WHEEL_INCLUDE_LIBS=On ..
and things fail with the same error. Haven't tried with make install as I'd rather not move stuff into /usr; is it possible to install into a prefix?
Note, though, that the error ("ImportError: dynamic module does not define module export function (PyInit_PyDIP_bin)") suggests that the problem is not with finding diplib(?)
Yes, you can install into any prefix.
My working hypothesis is that the error message is inaccurate, that it cannot load the PyInit_PyDIP_bin module because some of its dependencies are missing.
It not working with the libraries included in the wheel is strange though. That might indicate some other issue. Check the Python version in thr CMake configuration output, and make sure it’s identical to the version of Python you’re trying to run this in. If not, configure in the CMake call the Python executable.
CMakeCache.txt says e.g. that
//Path to a program.
PYTHON_EXECUTABLE:FILEPATH=/home/antony/miniconda3/envs/default/bin/python
//Path to a library.
PYTHON_LIBRARY:FILEPATH=/home/antony/miniconda3/envs/default/lib/libpython3.10.so
which is correct.
I'll continue investigating...
Followup: I get the same failure using both conda-python (eveything in a conda env) or distro(fedora)-python (everything out of conda) on linux. OTOH I did manage to get things to work on Windows, which is better than nothing and at least I can move on and investigate whether I can e.g. improve the situation wrt #125.
Closing this because it's been inactive for long. Please reopen if you ever learn more!
Component pydip
Describe the bug Building pydip from source results in a library that fails to import
To Reproduce
Dumping the exported symbols from PyDIP_bin (
nm -gD PyDIP_bin.cpython-310-x86_64-linux-gnu.so
) shows that that symbol is indeed absent.System information:
ver
at the MATLAB command prompt, and copy-paste the result here).