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