root/tags/lgt2251/INSTALL

Revision 2247, 8.5 KB (checked in by pmoura, 3 years ago)

Improved documentation.

  • 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.25.1
4
5Copyright (c) 1998-2005 Paulo Moura.  All Rights Reserved.
6=================================================================
7
8
9This file contains detailed instructions for installing and configuring
10Logtalk. You should also consult the "scripts/NOTES" file for a description
11of a set of shell scripts that might be used for Logtalk installation on
12some operating-systems and for easy Logtalk integration with popular
13Prolog compilers.
14
15Note that the broad compatibility of Logtalk, both with Prolog compilers and
16operating-systems, together with all the possible user scenarios, means that
17installation can vary from very simple by running a couple of scripts to the
18need of patching both Logtalk and Prolog compilers to workaround the lack of
19strong Prolog standards.
20
21
221. LOGTALK INSTALLATION
23
24Installing Logtalk can be as simple as decompressing the downloaded archive
25and copying the resulting directory to a suitable location. This location
26depends on the working environment and on the number of users. The Logtalk
27directory can reside in any user accessible location. Whenever possible, it
28is recommended that Logtalk be installed by a user with administrative rights,
29as described below. This leads to a setup where each Logtalk user may freely
30try and modify the provided examples, library, and configuration files with
31the option of, at any time, restoring the files to its original state by
32simply running one of the provided scripts.
33
34
35* Installing for a single user with no administrative rights:
36
37In the case of a single user with no administrative rights, the Logtalk
38directory may simply be copied to the user home directory.
39
40
41* Installing for one or more users by a user with administrative rights:
42
43In the case of installation by a user with administrative rights, the Logtalk
44directory can be copied to any location that its accessible by all the users
45(assuming that copying the Logtalk directory to each user home directory is,
46for some reason, not feasible or desired).
47
48The "scripts" sub-directory contains shell scripts for easy installation of
49Logtalk on MacOS X, Windows, Linux, and Unix-like operating systems (see the
50"scripts/NOTES" file for details).
51
52After running the appropriated script for your operating-system, the second
53step will be to run the Prolog integration scripts that you find on the
54"scripts" sub-directory, assuming that your favorite Prolog compilers are
55supported (if that is not the case, don't worry: just follow the steps
56described in the "QUICK_START" file). The third step is for each user to
57make a local copy of the Logtalk user-modifiable files to its home directory.
58This allows each user to easily customize Logtalk to its needs. These copies
59can be easily made by instructing end-users to simply run the shell command
60"cplgtdirs" (the corresponding scripts are described in the "scripts/NOTES"
61file).
62
63The "scripts/lgt_install.*" installation scripts make all files read-only in
64order to avoid user tempering. This is a convenient setup for computer labs,
65given that making directories world-writable is a security risk. Of course,
66the local copies made by the "cplgtdirs" scripts have both read and write
67permissions for the user running the script.
68
69When used with one of the Prolog compilers for which an integration script
70is provided on the "scripts" directory, this setup as the advantage of
71allowing each end-user to independently customize default compilation options
72and library paths.
73
74
752. LOGTALK CONFIGURATION
76
772.1 Setting environment variables
78
79You need to set two environment variables, LOGTALKHOME and LOGTALKUSER. The
80environment variable LOGTALKHOME should point to the Logtalk installation
81directory. The environment variable LOGTALKUSER should point to a directory
82in your home directory where you want to store the user-specific Logtalk files
83(for example, ~/logtalk). Both environment variables may be set for all users
84by a user with administration privileges. The two environment variables can
85have the same value if you are the only Logtalk user on your computer and if
86you have full permissions to the Logtalk installation directory. In addition,
87you may want to add the Logtalk sub-directory "xml", which contains useful
88scripts for processing XML documenting files, to your execution path.
89
90* Unix and Unix-like systems:
91
92If you use a csh shell, add the following line to your ~/.cshrc file:
93
94    setenv LOGTALKHOME /your/logtalk/installation/directory
95    setenv LOGTALKUSER $HOME/logtalk
96    setenv PATH $PATH:$LOGTALKUSER/xml:$LOGTALKHOME/scripts
97
98If you use a bash shell, add the following lines to your ~/.profile file:
99
100    LOGTALKHOME=/your/logtalk/installation/directory
101    LOGTALKUSER=$HOME/logtalk
102    PATH=$PATH:$LOGTALKUSER/xml:$LOGTALKHOME/scripts
103    export PATH LOGTALKHOME LOGTALKUSER
104
105When using the provided shell script for installing Logtalk, a symbolic link
106to the Logtalk installation directory is automatically created. The link is
107named "logtalk". In this case, you may use this symbolic link to define the
108LOGTALKHOME environment variable in order to avoid breaking it when upgrading
109Logtalk.
110
111* Windows systems:
112
113In Windows 95/98/ME, environment variables are defined in the "autoexec.bat"
114file (you will need to reboot after editing the file):
115
116    SET LOGTALKHOME=C:\your\logtalk\installation\folder\
117    SET LOGTALKUSER=%HOMEPATH%\logtalk
118
119In Windows 2000/XP, environment variables are defined using the System
120properties control panel (if you are a system administrator, you should
121use the JScript install script provided in the "scripts" sub-directory;
122this script sets the LOGTALKHOME environment variable for all users and
123also sets the LOGTALKUSER environment variable for the administrator user
124running the script).
125
126
1272.2 Setting library paths
128
129In Logtalk, a library is simply a directory containing source files. Library
130paths can be declared using a dynamic predicate. This allows compiling and
131loading of libraries and library files to be performed without worries about
132library paths. Assuming that you have used the "scripts/cplgtdirs.*" shell
133scripts for making a copy of the user-modifiable Logtalk files, you will find
134in the "$LOGTALKUSER/libpaths" directory a sample file which, when loaded,
135defines the library paths for the Logtalk standard library and for all the
136supplied examples. This file may need to be edited to match your Logtalk
137installation and your Prolog compiler and operating-system requirements. For
138more details, see the file "$LOGTALKUSER/libpaths/NOTES".
139
140
1412.3 Customizing Prolog configuration files
142
143Logtalk interfaces with a specific Prolog compiler via a configuration file
144that can be found on the "$LOGTALKUSER/configs" directory. These configuration
145files can be customized by changing the values of the default flags that are
146used by Logtalk when compiling source files. For a full description of these
147default flags, consult the "Running and debugging Logtalk programs" section of
148the User Manual. Some of the default flags that you may want to change are:
149"smart_compilation", "startup_message", "portability", "underscore_vars",
150"altdirs", and the set of documentation-related flags ("xml", "xsl", "xmlspec",
151and "doctype"). Be sure to read the "$LOGTALKUSER/configs/NOTES" file for
152Prolog specific notes; some Prolog compilers do not support the whole range of
153compilation flags. 
154
155
1562.4 Customizing documentation processing scripts and supporting files
157
158Logtalk provides, in the "$LOGTALKUSER/xml" directory, a set of shell scripts,
159CSS and XSLT style-sheets, and DTD and XML Schema files for processing the XML
160documenting files that are automatically generated when you compile source
161files. You may want to customize these scripts and their supporting files to
162modify the layout or style of the resulting PDF/(X)HTML files or to write new
163scripts and transformations to generate other formats. For more details, see
164the file "$LOGTALKUSER/xml/NOTES".
165
166
1673. CREATING NEW PROLOG TOP-LEVELS FOR AUTOMATIC LOADING OF LOGTALK
168
169Most Prolog compilers allows the user to define an initialization file that
170is automatically consulted at startup. This initialization file may contain
171directives for loading other files, such as the Logtalk configuration file
172and the Logtalk compiler. The "$LOGTALKHOME/scripts" sub-directory contains
173several scripts for automating the creation of these initialization files
174for some Prolog compilers. In addition, be sure to read the "configs/NOTES"
175file notes on the Prolog compilers that you intend to use.
Note: See TracBrowser for help on using the browser.