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