root/tags/lgt2220/INSTALL

Revision 1730, 6.6 KB (checked in by pmoura, 4 years ago)

Improved installation and configuration instructions.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1=================================================================
2Logtalk - Object oriented extension to Prolog
3Release 2.22.0
4
5Copyright (c) 1998-2004 Paulo Moura.  All Rights Reserved.
6=================================================================
7
8
9This file contains detailed instruction for installing and configuring
10Logtalk.
11
12
131. LOGTALK INSTALLATION
14
15Installing Logtalk is just a matter of decompressing the downloaded archive
16and copying the resulting directory to a suitable location.
17
18The Logtalk directory can reside in any user accessible location. This
19location depends on the working environment and on the number of users.
20
21
22* Installing for a single user:
23
24In the case of a single user, the Logtalk directory may simply be copied to
25the user home directory. In alternative, assuming a user with administrative
26rights, the same setup described below for multiple users may be applied.
27This has the advantage of allowing the user to freely try and modify the
28provided examples, library, and configuration files with the option of, at
29any time, restoring the files to its original state by simply running one of
30the provided scripts.
31
32
33* Installing for multiple users:
34
35In the case of multiple users, the Logtalk directory can be copied to any
36location that its accessible by all the users (assuming that copying the
37Logtalk directory to each user home directory is, for some reason, not
38feasible or desired).
39
40The "misc" sub-directory contains shell scripts for easy installation of
41Logtalk on Windows, Unix, and Unix-like operating systems (for details,
42see the misc/NOTES file). These scripts make all files read-only in order
43to avoid user tempering. However, Logtalk directories such as "library"
44or "examples" must be user-writable as compiling Logtalk source files
45generates intermediate Prolog files, which are written to the same location
46as the source files. In addition, it is convenient that directories such as
47"configs", "libpaths", and "xml" be user-writable in order to allow each
48user to customize Logtalk to its needs. Given that making directories
49world-writable is a security risk, one solution is to copy the directories
50that need to be user-writable to each user home directory. The "misc" sub-
51directory contains shell scripts (named "cplgtdirs.*") which may be called
52by the end-users for making such copies. This is the preferred setup for a
53computer lab. When used with one of the Prolog compilers for which an
54integration script is provided on the "misc" directory, this setup allows
55end-users to independently customize default compilation options and
56library paths.
57
58
592. LOGTALK CONFIGURATION
60
612.1 Setting environment variables
62
63You need to set two environment variables, LOGTALKHOME and LOGTALKUSER. The
64environment variable LOGTALKHOME should point to the Logtalk installation
65directory. The environment variable LOGTALKUSER should point to a directory
66in your home directory where you want to store the user-specific Logtalk files
67(for example, ~/logtalk). Both environment variables may be set for all users
68by a user with administration privileges. The two environment variables can
69have the same value if you are the only Logtalk user on your computer and if
70you have full permissions to the Logtalk installation directory. In addition,
71you may want to add the Logtalk sub-directory "xml", which contains useful
72scripts for processing XML documenting files, to your execution path.
73
74* Unix and Unix-like systems:
75
76If you use a csh shell, add the following line to your ~/.cshrc file:
77
78    setenv LOGTALKHOME /your/logtalk/installation/directory
79    setenv LOGTALKUSER $HOME/logtalk
80    setenv PATH $PATH:$LOGTALKHOME/xml:$LOGTALKHOME/misc
81
82If you use a bash shell, add the following lines to your ~/.profile file:
83
84    LOGTALKHOME=/your/logtalk/installation/directory
85    LOGTALKUSER=$HOME/logtalk
86    PATH=$PATH:$LOGTALKHOME/xml:$LOGTALKHOME/misc
87    export PATH LOGTALKHOME LOGTALKUSER
88
89When using the provided shell script for installing Logtalk, a symbolic link
90to the Logtalk installation directory is automatically created. The link is
91named "logtalk". In this case, you may use this symbolic link to define the
92environment variable in order to avoid breaking it when upgrading Logtalk.
93
94* Windows systems:
95
96In Windows 95/98/ME, environment variables are defined in the "autoexec.bat"
97file (you will need to reboot after editing the file):
98
99    SET LOGTALKHOME=C:\your\installation\folder\
100    SET LOGTALKUSER=%HOMEPATH%\logtalk
101
102In Windows NT/2000/XP, environment variables are defined using the System
103properties control panel (if you are a system administrator, you should use
104the JScript install script provided in the "misc" sub-directory; this script
105sets both the LOGTALKHOME and the LOGTALKUSER environment variables).
106
107
1082.2 Setting library paths
109
110In Logtalk, a library is simply a directory containing source files. Library
111paths can be declared using a dynamic predicate. This allows compiling and
112loading of libraries and library files to be performed without worries about
113library paths. In the "libpaths" directory you will find a sample file which
114you can copy and edit to match your Logtalk installation and your Prolog
115compiler and operating-system requirements. See the "libpaths/NOTES" file for
116more details.
117
118
1192.3 Customizing prolog configuration files
120
121Logtalk interfaces with a specific Prolog compiler via a configuration file
122that can be found on the "$LOGTALKUSER/configs" directory. These configuration
123files can be customized by changing the values of the default flags and
124compiler options which are used by Logtalk when compiling source files. For
125a full description of these default flags and compiler options, consult the
126"Running and debugging Logtalk programs" section of the User Manual. Some of
127the default flags that you may want to change are: "portability", "altdirs",
128"underscore_vars", "startup_message", "smart_compilation", and the set of
129documentation-related flags ("xml", "xsl", "xmlspec", and "doctype"). Be sure
130to read the "$LOGTALKUSER/configs/NOTES" file for Prolog specific notes; some
131Prolog compilers do not support the whole range of compilation flags. 
132
133
134CREATING NEW PROLOG TOP-LEVELS FOR AUTOMATIC LOADING OF LOGTALK
135
136Most Prolog compilers allows the user to define an initialization file that
137is automatically consulted at startup. This initialization file may contain
138directives for loading other files, such as the Logtalk configuration file
139and the Logtalk compiler. The "misc" sub-directory contains several scripts
140for automating the creation of these initialization files for some Prolog
141compilers. In addition, be sure to read the "configs/NOTES" file notes on the
142Prolog compilers that you intend to use.
Note: See TracBrowser for help on using the browser.