2004-04-26 00:57:46 +01:00
|
|
|
=================================================================
|
|
|
|
Logtalk - Object oriented extension to Prolog
|
2004-12-30 00:35:38 +00:00
|
|
|
Release 2.22.3
|
2004-04-26 00:57:46 +01:00
|
|
|
|
|
|
|
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
|
|
|
=================================================================
|
|
|
|
|
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
This file contains detailed instruction for installing and configuring
|
|
|
|
Logtalk.
|
|
|
|
|
|
|
|
|
|
|
|
1. LOGTALK INSTALLATION
|
|
|
|
|
2004-09-15 00:11:12 +01:00
|
|
|
Installing Logtalk is just a matter of decompressing the downloaded archive
|
|
|
|
and copying the resulting directory to a suitable location.
|
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
The Logtalk directory can reside in any user accessible location. This
|
|
|
|
location depends on the working environment and on the number of users.
|
2004-04-26 00:57:46 +01:00
|
|
|
|
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
* Installing for a single user:
|
2004-04-26 00:57:46 +01:00
|
|
|
|
2004-07-25 19:47:43 +01:00
|
|
|
In the case of a single user, the Logtalk directory may simply be copied to
|
2004-11-29 20:36:31 +00:00
|
|
|
the user home directory. In alternative, assuming a user with administrative
|
|
|
|
rights, the same setup described below for multiple users may be applied.
|
|
|
|
This has the advantage of allowing the user to freely try and modify the
|
|
|
|
provided examples, library, and configuration files with the option of, at
|
|
|
|
any time, restoring the files to its original state by simply running one of
|
|
|
|
the provided scripts.
|
2004-04-26 00:57:46 +01:00
|
|
|
|
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
* Installing for multiple users:
|
2004-04-26 00:57:46 +01:00
|
|
|
|
2004-07-25 19:47:43 +01:00
|
|
|
In the case of multiple users, the Logtalk directory can be copied to any
|
2004-08-16 17:41:11 +01:00
|
|
|
location that its accessible by all the users (assuming that copying the
|
2004-11-29 20:36:31 +00:00
|
|
|
Logtalk directory to each user home directory is, for some reason, not
|
|
|
|
feasible or desired).
|
|
|
|
|
|
|
|
The "misc" sub-directory contains shell scripts for easy installation of
|
|
|
|
Logtalk on Windows, Unix, and Unix-like operating systems (for details,
|
|
|
|
see the misc/NOTES file). These scripts make all files read-only in order
|
|
|
|
to avoid user tempering. However, Logtalk directories such as "library"
|
|
|
|
or "examples" must be user-writable as compiling Logtalk source files
|
|
|
|
generates intermediate Prolog files, which are written to the same location
|
|
|
|
as the source files. In addition, it is convenient that directories such as
|
|
|
|
"configs", "libpaths", and "xml" be user-writable in order to allow each
|
|
|
|
user to customize Logtalk to its needs. Given that making directories
|
|
|
|
world-writable is a security risk, one solution is to copy the directories
|
|
|
|
that need to be user-writable to each user home directory. The "misc" sub-
|
|
|
|
directory contains shell scripts (named "cplgtdirs.*") which may be called
|
|
|
|
by the end-users for making such copies. This is the preferred setup for a
|
|
|
|
computer lab. When used with one of the Prolog compilers for which an
|
|
|
|
integration script is provided on the "misc" directory, this setup allows
|
|
|
|
end-users to independently customize default compilation options and
|
|
|
|
library paths.
|
|
|
|
|
|
|
|
|
|
|
|
2. LOGTALK CONFIGURATION
|
|
|
|
|
|
|
|
2.1 Setting environment variables
|
|
|
|
|
|
|
|
You need to set two environment variables, LOGTALKHOME and LOGTALKUSER. The
|
|
|
|
environment variable LOGTALKHOME should point to the Logtalk installation
|
|
|
|
directory. The environment variable LOGTALKUSER should point to a directory
|
|
|
|
in your home directory where you want to store the user-specific Logtalk files
|
|
|
|
(for example, ~/logtalk). Both environment variables may be set for all users
|
|
|
|
by a user with administration privileges. The two environment variables can
|
|
|
|
have the same value if you are the only Logtalk user on your computer and if
|
|
|
|
you have full permissions to the Logtalk installation directory. In addition,
|
|
|
|
you may want to add the Logtalk sub-directory "xml", which contains useful
|
|
|
|
scripts for processing XML documenting files, to your execution path.
|
2004-04-26 00:57:46 +01:00
|
|
|
|
2004-08-16 17:41:11 +01:00
|
|
|
* Unix and Unix-like systems:
|
|
|
|
|
|
|
|
If you use a csh shell, add the following line to your ~/.cshrc file:
|
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
setenv LOGTALKHOME /your/logtalk/installation/directory
|
|
|
|
setenv LOGTALKUSER $HOME/logtalk
|
2004-12-05 21:52:49 +00:00
|
|
|
setenv PATH $PATH:$LOGTALKUSER/xml:$LOGTALKHOME/misc
|
2004-04-26 00:57:46 +01:00
|
|
|
|
|
|
|
If you use a bash shell, add the following lines to your ~/.profile file:
|
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
LOGTALKHOME=/your/logtalk/installation/directory
|
|
|
|
LOGTALKUSER=$HOME/logtalk
|
2004-12-05 21:52:49 +00:00
|
|
|
PATH=$PATH:$LOGTALKUSER/xml:$LOGTALKHOME/misc
|
2004-11-29 20:36:31 +00:00
|
|
|
export PATH LOGTALKHOME LOGTALKUSER
|
2004-04-26 00:57:46 +01:00
|
|
|
|
|
|
|
When using the provided shell script for installing Logtalk, a symbolic link
|
|
|
|
to the Logtalk installation directory is automatically created. The link is
|
2004-08-16 17:41:11 +01:00
|
|
|
named "logtalk". In this case, you may use this symbolic link to define the
|
2004-04-26 00:57:46 +01:00
|
|
|
environment variable in order to avoid breaking it when upgrading Logtalk.
|
2004-06-13 19:04:28 +01:00
|
|
|
|
2004-08-16 17:41:11 +01:00
|
|
|
* Windows systems:
|
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
In Windows 95/98/ME, environment variables are defined in the "autoexec.bat"
|
2004-08-16 17:41:11 +01:00
|
|
|
file (you will need to reboot after editing the file):
|
|
|
|
|
|
|
|
SET LOGTALKHOME=C:\your\installation\folder\
|
2004-11-29 20:36:31 +00:00
|
|
|
SET LOGTALKUSER=%HOMEPATH%\logtalk
|
2004-08-16 17:41:11 +01:00
|
|
|
|
2004-12-05 21:52:49 +00:00
|
|
|
In Windows 2000/XP, environment variables are defined using the System
|
2004-09-15 00:11:12 +01:00
|
|
|
properties control panel (if you are a system administrator, you should use
|
2004-11-29 20:36:31 +00:00
|
|
|
the JScript install script provided in the "misc" sub-directory; this script
|
2004-12-25 03:06:18 +00:00
|
|
|
sets the LOGTALKHOME environment variable for all users and also sets the
|
|
|
|
LOGTALKUSER environment variable for the administrator user running the
|
|
|
|
script).
|
2004-11-29 20:36:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
2.2 Setting library paths
|
|
|
|
|
|
|
|
In Logtalk, a library is simply a directory containing source files. Library
|
|
|
|
paths can be declared using a dynamic predicate. This allows compiling and
|
|
|
|
loading of libraries and library files to be performed without worries about
|
2004-12-05 21:52:49 +00:00
|
|
|
library paths. In the "$LOGTALKUSER/libpaths" directory you will find a sample
|
2004-12-25 03:06:18 +00:00
|
|
|
file which, when loaded, defines the library paths for the Logtalk standard
|
|
|
|
library and for all the supplied examples. This file may need to be edited to
|
|
|
|
match your Logtalk installation and your Prolog compiler and operating-system
|
|
|
|
requirements. For more details, see the file "$LOGTALKUSER/libpaths/NOTES".
|
2004-08-16 17:41:11 +01:00
|
|
|
|
2004-06-13 19:04:28 +01:00
|
|
|
|
2004-12-05 21:52:49 +00:00
|
|
|
2.3 Customizing Prolog configuration files
|
2004-11-16 19:37:30 +00:00
|
|
|
|
|
|
|
Logtalk interfaces with a specific Prolog compiler via a configuration file
|
2004-11-29 20:36:31 +00:00
|
|
|
that can be found on the "$LOGTALKUSER/configs" directory. These configuration
|
2004-11-16 19:37:30 +00:00
|
|
|
files can be customized by changing the values of the default flags and
|
|
|
|
compiler options which are used by Logtalk when compiling source files. For
|
|
|
|
a full description of these default flags and compiler options, consult the
|
|
|
|
"Running and debugging Logtalk programs" section of the User Manual. Some of
|
|
|
|
the default flags that you may want to change are: "portability", "altdirs",
|
|
|
|
"underscore_vars", "startup_message", "smart_compilation", and the set of
|
|
|
|
documentation-related flags ("xml", "xsl", "xmlspec", and "doctype"). Be sure
|
2004-11-29 20:36:31 +00:00
|
|
|
to read the "$LOGTALKUSER/configs/NOTES" file for Prolog specific notes; some
|
2004-11-16 19:37:30 +00:00
|
|
|
Prolog compilers do not support the whole range of compilation flags.
|
|
|
|
|
|
|
|
|
2004-12-05 21:52:49 +00:00
|
|
|
2.4 Customizing documentation processing scripts and supporting files
|
|
|
|
|
|
|
|
Logtalk provides, in the "$LOGTALKUSER/xml" directory, a set of shell scripts,
|
|
|
|
CSS and XSLT style-sheets, and DTD and XML Schema files for processing the XML
|
|
|
|
documenting files that are automatically generated when you compile source
|
|
|
|
files. You may want to customize these scripts and their supporting files to
|
|
|
|
modify the layout or style of the resulting PDF/(X)HTML files or to write new
|
|
|
|
scripts and transformations to generate other formats. For more details, see
|
|
|
|
the file "$LOGTALKUSER/xml/NOTES".
|
|
|
|
|
|
|
|
|
2004-06-13 19:04:28 +01:00
|
|
|
CREATING NEW PROLOG TOP-LEVELS FOR AUTOMATIC LOADING OF LOGTALK
|
|
|
|
|
|
|
|
Most Prolog compilers allows the user to define an initialization file that
|
|
|
|
is automatically consulted at startup. This initialization file may contain
|
|
|
|
directives for loading other files, such as the Logtalk configuration file
|
2004-08-16 17:41:11 +01:00
|
|
|
and the Logtalk compiler. The "misc" sub-directory contains several scripts
|
|
|
|
for automating the creation of these initialization files for some Prolog
|
2004-11-29 20:36:31 +00:00
|
|
|
compilers. In addition, be sure to read the "configs/NOTES" file notes on the
|
2004-08-16 17:41:11 +01:00
|
|
|
Prolog compilers that you intend to use.
|