Did you know ... | Search Documentation: |
Janus platforms notes |
Janus relies on the C APIs of Prolog and Python and functions therefore independent from the platform. While the C, Python and Prolog code the builds Janus is platform independent, dynamically loading Prolog into Python or Python into Prolog depends on versions as well as several properties of the dynamic linking performed by the platform. In the sections below we describe some of the issues.
We tested the Windows platform using SWI-Prolog binaries from
https://www.swi-prolog.org/Downloads.html
and Python downloaded from
https://www.python.org/downloads/windows/.
The SWI-Prolog binary provides janus.dll
which is linked to
python3.dll
, a “stable API” based wrapper that
each Python 3 binary distribution provides in addition to python3xx.dll
.
Calling Python from Prolog is supported out of the box, provided the
folder holding
python3.dll
is in the search %PATH%
.
The Python package can be installed using pip as described in
section 9. Once built, this package
finds SWI-Prolog on %PATH%
or using the registry and should
be fairly independent from the Prolog version as long as it is version
9.1.12 or later.
On Linux systems we bind to the currently installed Prolog and Python version. This should work smoothly from source. Janus is included in the PPA distribution for Ubuntu as well as in the Docker images. It is currently not part of the SNAP distribution.
See section 9 for for building the janus_swi
Python package.
Unfortunately MacOS versions of Python do not ship with the
equivalent of python3.dll
found on Windows. This implies we
can only compile our binaries against a specific version of Python. We
will use the default Python binary for that, which is installed in
/Library/Frameworks/Python.framework/
The Macports version is also linked against an explicit version of Python, in this case provided by Macports.
The Python package janus_swi
may be compiled against any
version of Python selected by pip. See section
9 for details.