| 1 | ================================================================= |
|---|
| 2 | Logtalk - Object oriented extension to Prolog |
|---|
| 3 | Release 2.22.0 |
|---|
| 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:$LOGTALKHOME/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:$LOGTALKHOME/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 NT/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 both the LOGTALKHOME and the LOGTALKUSER environment variables). |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | 2.2 Setting library paths |
|---|
| 109 | |
|---|
| 110 | In Logtalk, a library is simply a directory containing source files. Library |
|---|
| 111 | paths can be declared using a dynamic predicate. This allows compiling and |
|---|
| 112 | loading of libraries and library files to be performed without worries about |
|---|
| 113 | library paths. In the "libpaths" directory you will find a sample file which |
|---|
| 114 | you can copy and edit to match your Logtalk installation and your Prolog |
|---|
| 115 | compiler and operating-system requirements. See the "libpaths/NOTES" file for |
|---|
| 116 | more details. |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | 2.3 Customizing prolog configuration files |
|---|
| 120 | |
|---|
| 121 | Logtalk interfaces with a specific Prolog compiler via a configuration file |
|---|
| 122 | that can be found on the "$LOGTALKUSER/configs" directory. These configuration |
|---|
| 123 | files can be customized by changing the values of the default flags and |
|---|
| 124 | compiler options which are used by Logtalk when compiling source files. For |
|---|
| 125 | a full description of these default flags and compiler options, consult the |
|---|
| 126 | "Running and debugging Logtalk programs" section of the User Manual. Some of |
|---|
| 127 | the default flags that you may want to change are: "portability", "altdirs", |
|---|
| 128 | "underscore_vars", "startup_message", "smart_compilation", and the set of |
|---|
| 129 | documentation-related flags ("xml", "xsl", "xmlspec", and "doctype"). Be sure |
|---|
| 130 | to read the "$LOGTALKUSER/configs/NOTES" file for Prolog specific notes; some |
|---|
| 131 | Prolog compilers do not support the whole range of compilation flags. |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | CREATING NEW PROLOG TOP-LEVELS FOR AUTOMATIC LOADING OF LOGTALK |
|---|
| 135 | |
|---|
| 136 | Most Prolog compilers allows the user to define an initialization file that |
|---|
| 137 | is automatically consulted at startup. This initialization file may contain |
|---|
| 138 | directives for loading other files, such as the Logtalk configuration file |
|---|
| 139 | and the Logtalk compiler. The "misc" sub-directory contains several scripts |
|---|
| 140 | for automating the creation of these initialization files for some Prolog |
|---|
| 141 | compilers. In addition, be sure to read the "configs/NOTES" file notes on the |
|---|
| 142 | Prolog compilers that you intend to use. |
|---|