| 1 | ================================================================ |
|---|
| 2 | Logtalk - Open source object-oriented logic programming language |
|---|
| 3 | Release 2.43.3 |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1998-2011 Paulo Moura. All Rights Reserved. |
|---|
| 6 | Logtalk is free software. You can redistribute it and/or modify |
|---|
| 7 | it under the terms of the "Artistic License 2.0" as published by |
|---|
| 8 | The Perl Foundation. Consult the "LICENSE.txt" file for details. |
|---|
| 9 | ================================================================ |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | The recommended way of installing Logtalk is to use, whenever possible, one |
|---|
| 13 | of the provided installers. This file contains detailed instructions for |
|---|
| 14 | *manual* installation and configuration of Logtalk. You should also consult |
|---|
| 15 | the "scripts/NOTES.txt" and "integration/NOTES.txt" files for a description |
|---|
| 16 | of a set of shell scripts that might be used for Logtalk installation on |
|---|
| 17 | some operating-systems and for easy Logtalk integration with popular Prolog |
|---|
| 18 | compilers. |
|---|
| 19 | |
|---|
| 20 | The POSIX shell scripts assume that "/bin/bash" is available. |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | 1. LOGTALK BASIC INSTALLATION |
|---|
| 24 | |
|---|
| 25 | Manual installation of Logtalk can be accomplished by decompressing the |
|---|
| 26 | downloaded archive (or checking out a Logtalk working copy from the official |
|---|
| 27 | Subversion server), running an installation script, and defining a couple of |
|---|
| 28 | environment variables. You can install Logtalk in any user accessible location. |
|---|
| 29 | Whenever possible, it is recommended that Logtalk be installed by a user with |
|---|
| 30 | administrative rights, as described below. This leads to a setup where each |
|---|
| 31 | Logtalk user may freely try and modify the provided examples, library, and |
|---|
| 32 | configuration files with the option of, at any time, restoring the files to |
|---|
| 33 | its original state by simply running one of the provided scripts. |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | * Installing for a single user with no administrative rights: |
|---|
| 37 | |
|---|
| 38 | For POSIX systems, first, open a terminal, change the current directory to |
|---|
| 39 | the Logtalk directory, and then type: |
|---|
| 40 | |
|---|
| 41 | % cd scripts |
|---|
| 42 | % ./install.sh $HOME |
|---|
| 43 | |
|---|
| 44 | This will install Logtalk into the $HOME/share and $HOME/bin directories (the |
|---|
| 45 | $HOME/bin path must be in your PATH environment variable). |
|---|
| 46 | |
|---|
| 47 | If you're using Windows, you can simply use the provided installer (which |
|---|
| 48 | supports both admin and non-admin users) to perform a full installation. |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | * Installing for one or more users by a user with administrative rights: |
|---|
| 52 | |
|---|
| 53 | For POSIX systems, first, open a terminal, change the current directory to |
|---|
| 54 | the Logtalk directory, and then type: |
|---|
| 55 | |
|---|
| 56 | % cd scripts |
|---|
| 57 | % sudo ./install.sh |
|---|
| 58 | |
|---|
| 59 | This installation script makes all files read-only for non-admin users in |
|---|
| 60 | order to avoid user tempering. This is a convenient setup for computer labs, |
|---|
| 61 | given that making directories world-writable is a security risk. The install |
|---|
| 62 | script accepts an installation prefix as argument. For example: |
|---|
| 63 | |
|---|
| 64 | % sudo ./install.sh /opt/local |
|---|
| 65 | |
|---|
| 66 | If no prefix is given, the default installation prefix depends on the |
|---|
| 67 | operating-system: |
|---|
| 68 | |
|---|
| 69 | Mac OS X: /opt/local |
|---|
| 70 | Debian distributions: /usr |
|---|
| 71 | Other POSIX systems: /usr/local |
|---|
| 72 | |
|---|
| 73 | The script installs Logtalk in the "$prefix/share" directory with useful |
|---|
| 74 | scripts written to the "$prefix/bin" directory, which should be in your path. |
|---|
| 75 | |
|---|
| 76 | If you're using Windows, you can simply use the provided GUI installer (which |
|---|
| 77 | supports both admin and non-admin users) to perform a full installation. |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | 2. SETTING LOGTALK ENVIRONMENT VARIABLES |
|---|
| 81 | |
|---|
| 82 | You need to set two environment variables, LOGTALKHOME and LOGTALKUSER. The |
|---|
| 83 | environment variable LOGTALKHOME should be set to the Logtalk installation |
|---|
| 84 | directory. The environment variable LOGTALKUSER should point to a directory |
|---|
| 85 | in your home directory where you want to store the user-specific Logtalk files |
|---|
| 86 | (by default, "$HOME/logtalk" on POSIX systems and "My Documents\Logtalk" on |
|---|
| 87 | Windows"). Both environment variables may be set for all users by a user with |
|---|
| 88 | administration privileges. |
|---|
| 89 | |
|---|
| 90 | For POSIX systems, 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:$LOGTALKHOME/integration |
|---|
| 95 | MANPATH=$MANPATH:$LOGTALKHOME/man |
|---|
| 96 | export LOGTALKHOME LOGTALKUSER PATH MANPATH |
|---|
| 97 | |
|---|
| 98 | If you use instead a csh shell, add the following line to your ~/.cshrc file: |
|---|
| 99 | |
|---|
| 100 | setenv LOGTALKHOME /your/logtalk/installation/directory |
|---|
| 101 | setenv LOGTALKUSER $HOME/logtalk |
|---|
| 102 | setenv PATH $PATH:$LOGTALKHOME/xml:$LOGTALKHOME/scripts:$LOGTALKHOME/integration |
|---|
| 103 | setenv MANPATH $MANPATH:$LOGTALKHOME/man |
|---|
| 104 | |
|---|
| 105 | Don't use relative paths such as ../ or ./ in the definition of the environment |
|---|
| 106 | variables. Some Prolog compilers don't expand environment variables, resulting |
|---|
| 107 | in "file not found" errors when attempting to use the Logtalk integration scripts. |
|---|
| 108 | |
|---|
| 109 | When using the provided shell script for installing Logtalk, a symbolic link |
|---|
| 110 | to the Logtalk installation directory is automatically created. The link is |
|---|
| 111 | named "logtalk". In this case, you may use this symbolic link to define the |
|---|
| 112 | LOGTALKHOME environment variable in order to avoid breaking it when upgrading |
|---|
| 113 | Logtalk. |
|---|
| 114 | |
|---|
| 115 | If you're using Windows, the provided GUI installer (which supports both admin |
|---|
| 116 | and non-admin users) takes care of the definition of the environment variables. |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | 3. END-USER SETUP (COPYING LOGTALK USER-MODIFIABLE FILES TO USERS HOME DIRS) |
|---|
| 120 | |
|---|
| 121 | If you installed Logtalk on your home directory, then skip this step if and only |
|---|
| 122 | if you have set both Logtalk environment variables (LOGTALKHOME and LOGTALKUSER) |
|---|
| 123 | to point to the same directory. |
|---|
| 124 | |
|---|
| 125 | Each user must make a local copy of the Logtalk user-modifiable files |
|---|
| 126 | (examples, libraries, and other supporting files) in his/her home directory. |
|---|
| 127 | These copies can be easily made by running the "logtalk_user_setup" shell |
|---|
| 128 | script (see the "scripts/NOTES.txt" file for details): |
|---|
| 129 | |
|---|
| 130 | >> POSIX systems: |
|---|
| 131 | |
|---|
| 132 | % logtalk_user_setup |
|---|
| 133 | |
|---|
| 134 | >> Windows: |
|---|
| 135 | |
|---|
| 136 | C:\> logtalk_user_setup |
|---|
| 137 | |
|---|
| 138 | The local copies made by the "logtalk_user_setup" scripts have both read and |
|---|
| 139 | write permissions for the user running the script. When used with one of the |
|---|
| 140 | back-end Prolog compilers for which an integration script is provided on |
|---|
| 141 | the "integration" directory, this setup as the advantage of allowing each |
|---|
| 142 | end-user to independently customize default compilation options, library |
|---|
| 143 | paths, and modify and experiment with the provided libraries and examples. |
|---|
| 144 | |
|---|
| 145 | Windows (admin and non-admin) users may also use the Logtalk GUI installer |
|---|
| 146 | to setup their Logtalk user folder and the LOGTALKUSER environment variable. |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | 4. CREATING NEW PROLOG TOP-LEVELS FOR AUTOMATIC LOADING OF LOGTALK |
|---|
| 150 | |
|---|
| 151 | Most Prolog compilers allows the user to define an initialization file that |
|---|
| 152 | is automatically consulted at startup. These initialization files may contain |
|---|
| 153 | directives for loading other files, such as the Logtalk configuration file |
|---|
| 154 | and the Logtalk compiler. The "$LOGTALKHOME/integration" sub-directory |
|---|
| 155 | contains several pre-made scripts (named "*lgt.*") for running Logtalk with |
|---|
| 156 | selected back-end Prolog compilers. You can use these scripts as examples |
|---|
| 157 | when creating initialization files for other Prolog compilers. Be sure to |
|---|
| 158 | read the "configs/NOTES.txt" file notes on the Prolog compilers that you |
|---|
| 159 | intend to use. |
|---|
| 160 | |
|---|
| 161 | |
|---|
| 162 | 5. CUSTOMIZING LOGTALK |
|---|
| 163 | |
|---|
| 164 | Please see the file "CUSTOMIZE.txt" for details on how to customize your |
|---|
| 165 | Logtalk installation and working environment. |
|---|