| 1 | ================================================================= |
|---|
| 2 | Logtalk - Object oriented extension to Prolog |
|---|
| 3 | Release 2.29.2 |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved. |
|---|
| 6 | ================================================================= |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | The recommended way of installing Logtalk is to use, whenever possible, one |
|---|
| 10 | of the provided installers. This file contains detailed instructions for |
|---|
| 11 | manual installation and configuration of Logtalk. You should also consult |
|---|
| 12 | the "scripts/NOTES" file for a description of a set of shell scripts that |
|---|
| 13 | might be used for Logtalk installation on some operating-systems and for |
|---|
| 14 | easy Logtalk integration with popular Prolog compilers. |
|---|
| 15 | |
|---|
| 16 | Note that the broad compatibility of Logtalk, both with Prolog compilers and |
|---|
| 17 | operating-systems, together with all the possible user scenarios, means that |
|---|
| 18 | installation can vary from very simple by running a couple of scripts to the |
|---|
| 19 | need of patching both Logtalk and Prolog compilers to workaround the lack of |
|---|
| 20 | strong Prolog standards. |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | 1. LOGTALK BASIC INSTALLATION |
|---|
| 24 | |
|---|
| 25 | Installing Logtalk can be as simple as decompressing the downloaded archive |
|---|
| 26 | and copying the resulting directory to a suitable location. This location |
|---|
| 27 | depends on the working environment and on the number of users. The Logtalk |
|---|
| 28 | directory can reside in any user accessible location. Whenever possible, it |
|---|
| 29 | is recommended that Logtalk be installed by a user with administrative rights, |
|---|
| 30 | as described below. This leads to a setup where each Logtalk user may freely |
|---|
| 31 | try and modify the provided examples, library, and configuration files with |
|---|
| 32 | the option of, at any time, restoring the files to its original state by |
|---|
| 33 | simply running one of the provided scripts. |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | * Installing for a single user with no administrative rights: |
|---|
| 37 | |
|---|
| 38 | In the case of a single user with no administrative rights, the Logtalk |
|---|
| 39 | directory may simply be copied to the user home directory. |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | * Installing for one or more users by a user with administrative rights: |
|---|
| 43 | |
|---|
| 44 | In the case of installation by a user with administrative rights, the Logtalk |
|---|
| 45 | directory can be copied to any location that its accessible by all the users |
|---|
| 46 | (assuming that copying the Logtalk directory to each user home directory is, |
|---|
| 47 | for some reason, not feasible or desired). |
|---|
| 48 | |
|---|
| 49 | The "scripts" sub-directory contains shell scripts for easy installation of |
|---|
| 50 | Logtalk on MacOS X, Windows, Linux, and Unix-like (POSIX) operating systems |
|---|
| 51 | (see the "scripts/NOTES" file for details). |
|---|
| 52 | |
|---|
| 53 | >> POSIX systems installation (starting from the Logtalk directory): |
|---|
| 54 | |
|---|
| 55 | % cd scripts |
|---|
| 56 | % sudo ./lgt_install.sh |
|---|
| 57 | |
|---|
| 58 | >> Windows installation (starting from the Logtalk directory): |
|---|
| 59 | |
|---|
| 60 | C:\logtalk> cd scripts |
|---|
| 61 | C:\logtalk> cscript lgt_install.js |
|---|
| 62 | RESTART |
|---|
| 63 | |
|---|
| 64 | The "scripts/lgt_install.*" installation scripts make all files read-only in |
|---|
| 65 | order to avoid user tempering. This is a convenient setup for computer labs, |
|---|
| 66 | given that making directories world-writable is a security risk. |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | 2. SETTING LOGTALK 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 | >> POSIX 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:$LOGTALKHOME/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:$LOGTALKHOME/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 2000/XP, environment variables are defined using the System |
|---|
| 106 | properties control panel. If you are a system administrator, the "scripts/ |
|---|
| 107 | lgt_install.js" JScript install script sets the LOGTALKHOME environment |
|---|
| 108 | variable for all users and also sets the LOGTALKUSER environment variable |
|---|
| 109 | for the administrator user running the script. |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | 3. COPYING THE LOGTALK USER-MODIFIABLE FILES TO USERS HOME DIRECTORIES |
|---|
| 113 | |
|---|
| 114 | If you installed Logtalk on your home directory, then skip this step if you |
|---|
| 115 | have set both Logtalk environment variables (LOGTALKHOME and LOGTALKUSER) to |
|---|
| 116 | point to the same directory. |
|---|
| 117 | |
|---|
| 118 | Each user must make a local copy of the Logtalk user-modifiable files to its |
|---|
| 119 | home directory. This setup allows each user to easily and independently |
|---|
| 120 | customize Logtalk to its needs. These copies can be easily made by instructing |
|---|
| 121 | end-users to simply run the shell scripts "cplgtdirs.*" (which are described |
|---|
| 122 | in the "scripts/NOTES" file). |
|---|
| 123 | |
|---|
| 124 | >> POSIX systems: |
|---|
| 125 | |
|---|
| 126 | % cplgtdirs |
|---|
| 127 | |
|---|
| 128 | >> Windows: |
|---|
| 129 | |
|---|
| 130 | C:\> cplgtdirs |
|---|
| 131 | |
|---|
| 132 | The local copies made by the "cplgtdirs" scripts have both read and write |
|---|
| 133 | permissions for the user running the script. When used with one of the |
|---|
| 134 | Prolog compilers for which an integration script is provided on the "scripts" |
|---|
| 135 | directory, this setup as the advantage of allowing each end-user to |
|---|
| 136 | independently customize default compilation options and library paths. |
|---|
| 137 | |
|---|
| 138 | |
|---|
| 139 | 4. CREATING NEW PROLOG TOP-LEVELS FOR AUTOMATIC LOADING OF LOGTALK |
|---|
| 140 | |
|---|
| 141 | Most Prolog compilers allows the user to define an initialization file that |
|---|
| 142 | is automatically consulted at startup. This initialization file may contain |
|---|
| 143 | directives for loading other files, such as the Logtalk configuration file |
|---|
| 144 | and the Logtalk compiler. The "$LOGTALKHOME/scripts" sub-directory contains |
|---|
| 145 | several scripts (named "make_*lgt.*") for automating the creation of these |
|---|
| 146 | initialization files for some Prolog compilers. In addition, be sure to read |
|---|
| 147 | the "configs/NOTES" file notes on the Prolog compilers that you intend to use. |
|---|
| 148 | There are also "makeall_lgt.*" scripts that try to run all the individual |
|---|
| 149 | "make_*lgt.*" scripts: |
|---|
| 150 | |
|---|
| 151 | >> POSIX systems: |
|---|
| 152 | |
|---|
| 153 | % cd $LOGTALKHOME/scripts |
|---|
| 154 | % sudo ./makeall_lgt.sh |
|---|
| 155 | |
|---|
| 156 | >> Windows: |
|---|
| 157 | |
|---|
| 158 | C:\> cd %LOGTALKHOME%\scripts |
|---|
| 159 | C:\> cscript makeall_lgt.js |
|---|
| 160 | |
|---|
| 161 | This assumes that your favorite Prolog compilers are supported by the |
|---|
| 162 | "make_*lgt.*" scripts. If that is not the case, don't worry: just follow |
|---|
| 163 | the steps described in the "QUICK_START" file. |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | 5. CUSTOMIZING LOGTALK |
|---|
| 167 | |
|---|
| 168 | Please see the file "CUSTOMIZE.txt" for details on how to customize your |
|---|
| 169 | Logtalk installation and working environment. |
|---|