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