Mercurial > hg > plml
view INSTALL @ 37:89688ebc447f tip
Deprecating this repository.
author | samer |
---|---|
date | Mon, 05 Jan 2015 17:42:03 +0000 |
parents | 256016cddcba |
children |
line wrap: on
line source
*** Prolog Matlab interface *** *** Authors: *** Samer Abdallah *** Centre for Digital Music, *** Queen Mary, University of London *** *** Christophe Rhodes *** Centre for Computational Creativity *** Goldsmiths College, University of London *** *** 2004--2012 ------------------------------------------------------------------------- BUILDING/INSTALLATION Before you start, you need a working SWI Prolog installation and a Matlab installation. The compilation is done using the swipl-ld utility that comes with SWI. This only has a hope of working on Unix systems, and I've only tried with Mac OS X and Linux. You also need the plcore package, which contains the required Prolog libraries utils.pl, dcgu.pl and ops.pl. *** Binary and Prolog code *** There is a template makefile in Makefile.templ Copy it to Makefile and adjust the configuration variables at the top to suit your system. Then run $ make $ make install This should copy the binary object and Prolog libraries to the target installation directory. SWI Prolog needs to be able to find them, eg, with INSTALL_PL_TO=~/lib/prolog and INSTALL_LIB_TO=~/lib/prolog/x86_64 I put file_search_path(foreign,'/Users/samer/lib/prolog/x86_64'). into my ~/.plrc Since ~/lib/prolog is automatically in the file_search_path(library,_), nothing else needs to be done. If you install the libraries somewhere else, you will need to add a file_search_path(library,PathToLibraries) clause. ** Matlab code ** The subdirectories of the matlab directory need to be in your matlab path, or the contents copied to somewhere already in you Matlab search path. ------------------------------------------------------------------------- SANITY CHECK NB: you need to make sure the required Matlab dynamic libraries are on your dyld search path before starting SWI Prolog. The bash script swiplml shows how you can do this by setting the DYLD_FALLBACK_LIBRARY_PATH environment variable before calling swipl, but be aware that there are several environment variables that can affect dynamic library loading and that they can have weird effects on your system if you have conflicting libraries is different places. See the dyld man page ('man dyld'). If the installation is ok, then the following should work (using the included swiplml script): $ swiplml ?- use_module(library(plml)). ... Yes. ?- ml_open(ml). % ml is the name assigned to the Matlab engine instance Matlab engine (ml) open. Yes ?- float(A)===2*pi. A = 6.28319 ?- A:float===2*pi. A = 6.28319