Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!uunet!in1.uu.net!newsflash.concordia.ca!CC.UMontreal.CA!IRO.UMontreal.CA!tarau
From: tarau@IRO.UMontreal.CA (Paul Tarau)
Subject: Re: bin prolog
Message-ID: <D77BtM.n1u@IRO.UMontreal.CA>
Sender: news@IRO.UMontreal.CA
Organization: Universite de Moncton, Canada
References: <mspalznf9zi7wgrvd@leo.fuw.edu.pl>
Date: Mon, 17 Apr 1995 22:58:33 GMT
Lines: 69

In article <mspalznf9zi7wgrvd@leo.fuw.edu.pl> mspal@fuw.edu.pl (Michal Spalinski) writes:

>I have not used prolog for quite a while, but now I started playing with it
>again and I have a couple of questions about BinPrlog (v. 3.30).
.........
>
>?- make_appl('fac.pl').
>*** undefined_predicate = make_appl/1:
>culprit = make_appl('fac.pl').
>no
>?-
..........
>2) Apparently all I need to run BinProlog is the file bp.pc.linux which
>sits in the BinProlog/bin directory. But what is the file bp.o.pc.linux,
>which resides in the same directory? There is also a directory
>BinProlog/src which seems to have some of the sources in it - how can I
>make use of that?


The problem comes from the fact that make_appl has been hidden in module "prolog"
in version 3.30. Here is a working example for a "hello" program:

main(true):-write(hello),nl.

% DO:
% ?-prolog:make_executable_unix_appl(
%     '/usr/local/bin/bp -q5', % AbsolutePathToEmulator (q=quietness)
%     'hello.pl',              % SourceFile
%      hello).                 % ExecutableFile

Please note that you have to locate the emulator (with something like
'which bp' on Linux). Then typing "hello" on the Linux command line
will also find and activate the emulator for your application.

The online help/1 facility is also usually enough to get
out of trouble, when you do not remember the exact name of the predicate,
especially if it is hidden in module "prolog".

?- help('appl').
prolog:do_apply/2-compiled
prolog:make_appl/1-compiled
prolog:make_executable_unix_appl/3-compiled

I would strongly suggest (and did my best to enforce this by hiding the
old make_executable_unix_appl/1 facility in module "prolog" :-)) to use
the new truly standalone executables obtained by compiling to C.  This
is what the libraries bp.o are for.  Do "make" in the
directory "pl2c" ("dynpl2c" on Solaris) to see how this works.
Just to prevent Murphy's law, please do not forget to rename 
bp.o.pc.linux to bp.o and bp.pc.linux to bp, although the make install
should have done it, presumably.

BinProlog being a team-of-one project, some parts of the documentation
might be slightly outdated as most of the members of the team have
spent (most of) their time on the (most) enjoyable part of it
and less on important duties as writing papers and documentation :-).
`We' will do our best to catch-up in the near future.

Please grep through the Prolog sources in directory "src" for exact
behavior, when you suspect differences with respect to the User Guide.
This directory contains the Prolog sources of the system which can be
adapted either to fix small problems or to customize the system to
your syntactic or semantic preferences. The command "?-make. " in directory
"src" will create a new wam.bp file with your changes to the sources
which can then be executed with "bp wam.bp".

Paul Tarau


