yuce / pyswip

PySwip is a Python-Prolog interface that enables querying SWI-Prolog in your Python programs.
https://pyswip.org
MIT License
482 stars 98 forks source link

use LIBSWIPL_PATH from environment #101

Closed chrbauer closed 5 months ago

chrbauer commented 4 years ago

On nixos the libswipl.so is not there, where pyswip could find it.

Output of swipl --dump-runtime-variables:

PLBASE="/nix/store/jlik9111a3hmfs6q5bwd7fnkyzdh08yf-swi-prolog-8.1.15/lib/swipl";
PLARCH="x86_64-linux";
PLBITS="64";
PLVERSION="80115";
PLSOEXT="so";
PLSOPATH="LD_LIBRARY_PATH";
PLLIBDIR="/nix/store/jlik9111a3hmfs6q5bwd7fnkyzdh08yf-swi-prolog-8.1.15/lib/swipl/lib/x86_64-linux";
PLLIB="-lswipl";
PLSHARED="yes";
PLTHREADS="yes";

but the shared lib is here: /nix/store/jlik9111a3hmfs6q5bwd7fnkyzdh08yf-swi-prolog-8.1.15/lib/libswipl.so.8

pyswip would expect it under $PLBASE/$PLARCH

swi-prolog on nixos is build with the flag -DSWIPL_INSTALL_IN_LIB=ON

one idea is to use a new environment variable, like in my patch. What do you think?

ashkan-leo commented 3 years ago

I have installed swi-prolog on macOS using nix package manager. I can't make pyswip work and I suspect this PR may fix it. Any idea for a workaround?