1<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> 2<!-- BEGIN LICENSE BLOCK 3 - Version: CMPL 1.1 4 - 5 - The contents of this file are subject to the Cisco-style Mozilla Public 6 - License Version 1.1 (the "License"); you may not use this file except 7 - in compliance with the License. You may obtain a copy of the License 8 - at www.eclipse-clp.org/license. 9 - 10 - Software distributed under the License is distributed on an "AS IS" 11 - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 12 - the License for the specific language governing rights and limitations 13 - under the License. 14 - 15 - The Original Code is The ECLiPSe Constraint Logic Programming System. 16 - The Initial Developer of the Original Code is Cisco Systems, Inc. 17 - Portions created by the Initial Developer are 18 - Copyright (C) 2006 Cisco Systems, Inc. All Rights Reserved. 19 - 20 - Contributor(s): 21 - 22 - END LICENSE BLOCK --> 23<html> 24<head> 25 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 26 <meta name="Author" content="Joachim Schimpf"> 27 <meta name="GENERATOR" content="Mozilla/4.76 [en] (X11; U; SunOS 5.7 sun4u) [Netscape]"> 28</head> 29<body> 30 31<h1> 32ECLiPSe Runtime Subset and Licensing Issues</h1> 33Scope: This note applies to ECLiPSe 5.2, Build #35 and later. 34<br>Author: Joachim Schimpf, IC-Parc 35<br>Date: 2001-10-28 36<br>Caution: inconsistent spelling of license/licence in different contexts! 37<h2> 38Packaging Scheme</h2> 39ECLiPSe is being distributed as a set of gzipped tar files. The supported 40architectures are currently: 41<br> 42<table BORDER WIDTH="40%" NOSAVE > 43<tr NOSAVE> 44<td NOSAVE>sun4</td> 45 46<td>SunOS 4 (being phased out)</td> 47</tr> 48 49<tr> 50<td>sparc_sunos5</td> 51 52<td>SunOS 5 (tested on 5.5 and 5.7)</td> 53</tr> 54 55<tr> 56<td>i386_linux</td> 57 58<td>Intel x86 Linux</td> 59</tr> 60 61<tr> 62<td>i386_nt</td> 63 64<td>Windows 95,98,2000,NT4</td> 65</tr> 66 67<tr NOSAVE> 68<td NOSAVE>alpha_linux</td> 69 70<td>64-bit Alpha Linux</td> 71</tr> 72</table> 73 74<p>Fore each of the architectures, there is the following set of packages 75(except that not all CPLEX/XPRESS interfaces are available on allarchitectures): 76<br> 77<table BORDER WIDTH="100%" NOSAVE > 78<tr NOSAVE> 79<td NOSAVE>eclipse_basic.tgz</td> 80 81<td>alternative</td> 82 83<td>ECLiPSe development system (flexlm-related predicates are dummy and 84fail always)</td> 85</tr> 86 87<tr> 88<td>eclipse_rt.tgz</td> 89 90<td>alternative</td> 91 92<td>ECLiPSe runtime subset (a subset of eclipse_basic) plus flexlm functionality</td> 93</tr> 94 95<tr> 96<td>eclipse_misc.tgz</td> 97 98<td>optional</td> 99 100<td>Public domain libraries, probably not relevant for PT</td> 101</tr> 102 103<tr> 104<td>eclipse_doc_online.tgz</td> 105 106<td>optional</td> 107 108<td>Documentation in html format</td> 109</tr> 110 111<tr> 112<td>eclipse_doc_print.tgz</td> 113 114<td>optional</td> 115 116<td>Documentation in pdf format (does not include Reference Manual)</td> 117</tr> 118 119<tr> 120<td>if_cplex65.tgz</td> 121 122<td>optional</td> 123 124<td>Interface to CPLEX 6.5 with CPLEX statically linked (requires development 125license)</td> 126</tr> 127 128<tr> 129<td>if_cplex71.tgz</td> 130 131<td>optional</td> 132 133<td>Interface to CPLEX 7.1 with CPLEX statically linked (requires runtime 134or development license)</td> 135</tr> 136 137<tr> 138<td>if_xpress12.tgz</td> 139 140<td>optional</td> 141 142<td>Interface to XPRESS 12.20 (requires development license)</td> 143</tr> 144 145<tr> 146<td>if_xpress1250.tgz</td> 147 148<td>optional</td> 149 150<td>Interface to XPRESS 12.50 (requires development license)</td> 151</tr> 152 153<tr> 154<td>if_xpress12parcrisk.tgz</td> 155 156<td>optional</td> 157 158<td>Interface to XPRESS 12.20 (requires intialisation with 'parcrisk' runtime 159key or development license)</td> 160</tr> 161</table> 162 163<p>Installing a development system: 164<ol> 165<li> 166Unpack eclipse_basic</li> 167 168<li> 169Only if you need the FlexLM functionality to be operational, unpack eclipse_rt 170as well</li> 171 172<li> 173Unpack eclipse_doc_online and eclipse_doc_print</li> 174 175<li> 176Unpack the if_xxx interfaces that you want to use for your development 177(if you install more than one, you will have to resolve ambiguities later, 178see below)</li> 179 180<li> 181Execute the RUNME script (on Unix) or the ecl_inst.tcl script (on Windows) 182as explained in the README file.</li> 183</ol> 184Installing a deployment system: 185<ol> 186<li> 187Unpack eclipse_rt</li> 188 189<li> 190Unpack one of the if_xxx interfaces, e.g. if_xpress12parcrisk for Riskwise</li> 191 192<li> 193If eclipse is used in embedded form, no further installation should be 194needed. Otherwise some registry entries and/or environment variables may 195need to be set, see README and Embedding Manual.</li> 196</ol> 197 198<h2> 199Runtime Subset</h2> 200The <i>ECLiPSe runtime subset</i> is contained in the package eclipse_rt.tgz. 201This subset does <b>not</b> contain: 202<ul> 203<li> 204the tkeclipse development environment</li> 205 206<li> 207development-related libraries (asm, document, daVinci, fcompile, pretty_printer, 208profile, remote_tools, toplevel, tracer etc)</li> 209 210<li> 211various compatibility libraries</li> 212</ul> 213This means that you cannot get an "Eclipse prompt" with this subset. It 214can only be used 215<ul> 216<li> 217together with a Java, C or C++ host program which loads the eclipse-library</li> 218 219<li> 220using the <i>eclipse</i> (or <i>eclipse.exe</i>) standalone executable 221with a <i>-e <goal></i> command line option</li> 222</ul> 223 224<h2> 225FlexLM licensing</h2> 226The ECLiPSe-API for the FlexLM licensing functionality is described in 227<a href="http://www.icparc.ic.ac.uk/eclipse/doc/doc/bips/lib_private/flexlm/index.html">Reference 228Manual/Non-public libraries/flexlm</a>. It consists of the four predicates: 229<br> 230<dt> 231licence_checkin(?Feature)</dt> 232 233<dd> 234Check in a FlexLM licence</dd> 235 236<dt> 237licence_checkout(+Feature, ++Policy, +Version, +Path, -Message, -Status)</dt> 238 239<dd> 240Check out a licenced feature from FlexLM</dd> 241 242<dt> 243licence_heartbeat(+Feature, +Minutes, -Reconnects, -FailedReconnects)</dt> 244 245<dd> 246Refresh a checked out FlexLM licence</dd> 247 248<dt> 249licence_held(+Feature)</dt> 250 251<dd> 252Check whether we already have a licence for a particular feature</dd> 253 254<br>This functionality is only operational in the <i>runtime subset</i>. 255An ECLiPSe <i>development system</i> by default contains only a dummy implementation 256of this API, which behaves as if there were no licenses available at all, 257i.e. licence_checkout/6 returns with Status=error and Message="ECLiPSe 258licence check failed", licence_checkin/1 always succeeds, and licence_heartbeat/4 259and licence_held/1 always fail. 260<p>To create a development environment <b>with</b> operational FlexLM licensing 261functionality, simply unpack both packages eclipse_basic.tgz and eclipse_rt.tgz 262into the same location. 263<h2> 264Eplex Library (interface to CPLEX and XPRESS-MP)</h2> 265The ECLiPSe library <b>eplex</b> is an interface between ECLiPSe and a 266third-party LP/MIP solver (currently supported are CPLEX and XPRESS-MP 267in various versions). The interface hides the differences between those 268solvers from the ECLiPSe programmer. However, the interface needs to be 269ported or at least rebuilt for every new release of the third-party solver. 270That's why the distribution contains several variants of if_xpress and 271if_cplex packages. They all implement the same functionality on the ECLiPSe 272side, but contain different versions of the solver. In addition, these 273solvers usually require a license to run. 274<h4> 275Loading the library</h4> 276Within ECLiPSe code, the use of the eplex library should normally be specified 277in generic form as 278<pre>:- lib(eplex).</pre> 279If only one variant of the library is installed (i.e. only a single if_cplex 280or if_xpress package has been unpacked), then this one gets loaded by ECLiPSe. 281This should normally be the case for a runtime installation of ECLiPSe. 282<h4> 283Selecting a particular library variant (development systems mainly)</h4> 284If an ECLiPSe installation has several variants of eplex installed, the 285ambiguity must be resolved. This can be done by specifically requesting 286a CPLEX or an XPRESS-MP variant by using either of the following: 287<pre>:- lib(eplex_xpress).</pre> 288 289<pre>:- lib(eplex_cplex).</pre> 290If this is still ambiguous (e.g. different versions installed), ECLiPSe 291will pick an arbitrary one. 292<p>A further way to select a particular solver is to make an entry in the 293<b>eplex_lic_info.ecl</b> 294file, which is located in the lib subdirectory of the ECLiPSe installation. 295This method is only recommended for development installations. The file 296contains entries of the form: 297<pre> licence(Hostname, Solver, Version, LicStr, LicNum).</pre> 298e.g. 299<pre> licence('breeze.icparc.ic.ac.uk', cplex, '65', '', 0).</pre> 300which specifies that on the given machine the if_cplex65 version of the 301interface should be used (the last two arguments will be passed to lp_get_license/2 302when ECLiPSe tries to obtain a license for the solver, see below). A default 303entry is written by giving an ECLiPSe variable in place of the machine 304name, e.g. 305<pre> licence(_Default, xpress, '12', default, 0).</pre> 306This line will match any machine and select if_xpress12 and expect XPRESS 307licensing information in a default location. Whenever an eplex_lic_info.ecl 308file is present, ECLiPSe will load the solver variant that corresponds 309to the first matching line in that file. 310<p>After loading the eplex library, it tries to obtain a license immediately 311by implicitly calling lp_get_license/0. lp_get_license/0 calls lp_get_license/2 312with the arguments being the last two arguments of the matching line in 313eplex_lic_info.ecl. Failure to obtain a license is not fatal (a warning 314may be printed), a license can always be obtained subsequently using lp_get_license/2. 315<h4> 316Obtaining a development license for CPLEX >= 7.1</h4> 317CPLEX 7 uses the ILOG license manager (ilm). You need to have a license 318file either in the default location /ilog/ilm/access.ilm, or in another 319location, in which case you need to set the environment variable ILOG_LICENSE_FILE 320to the absolute pathname of that file. For TOKEN type licenses, you also 321need to have a license demon (ilmd) running. With this setup, ECLiPSe needs 322no further information, and you can get a license by simply calling 323<pre> :- lp_get_license('', 0).</pre> 324or by making an entry in the eplex_lic_info.ecl file (see above) with the 325last two arguments being <tt>''</tt> and <tt>0</tt>, i.e. 326<pre><tt> licence(..., ..., ..., '', 0).</tt></pre> 327The license will then be automatically obtained when the library gets loaded 328or when you call lp_get_license/0. 329<h4> 330Obtaining a development license for XPRESS-MP</h4> 331XPRESS-MP uses a license file called xpress.pwd and possibly a dongle on 332Windows machines. There is a default xpress.pwd file which is included 333in the if_xpress package. This default file allows to use a restricted 334"student version" of XPRESS-MP, and it is also sufficient if you 335have a dongle plugged into your Windows machine. Otherwise, the location 336of the proper xpress.pwd file must be specified explicitly as an argument, 337or it can be given in the XPRESS environment variable. 338<p>For using the student version, or if you have a dongle, use 339<pre> :- lp_get_license(default, 0).</pre> 340For using an xpress.pwd file in the directory /my/pwd/location, use 341<pre> :- lp_get_license('/my/pwd/location', 0).</pre> 342If you want the value of the XPRESS environment variable to be used instead, 343give an empty string, i.e. 344<pre> :- lp_get_license('', 0).</pre> 345In all three cases, you can alternatively make an entry in the eplex_lic_info.ecl 346file with the last two arguments corresponding to the arguments of lp_get_license_info/2. 347The license will then be automatically obtained when the library gets loaded 348or when you call lp_get_license/0. 349<h4> 350Obtaining a runtime license for CPLEX >= 7.1</h4> 351This should work as follows, but it is an untested example since we don't 352have such a RUNTIME license yet: 353<pre>:- lib(eplex). 354 355:- ( lp_get_license("LICENSE parctechnologies-london\nRUNTIME CPLEX ...", 9999999) -> 356 true % got a runtime license 357 ; lp_get_license -> 358 true % got a development license 359 ; 360 writeln(error, "No license"), % got nothing 361 abort 362 ).</pre> 363lp_get_license/2 gets called with a license string and a number which is 364the signature for the string. 365<h4> 366Obtaining the Riskwise VAR license for XPRESS-MP</h4> 367XPRESS-MP uses a challenge-response scheme for its VAR (value added reseller) 368licenses. The VAR version for XPRESS-MP generates a random number, the 369ECLiPSe code has to apply a magic formula to it and pass the result back. 370For Riskwise, the ECLiPSe code should look as follows: 371<pre>:- lib(eplex). 372 373:- ( 374 ( lp_get_license_challenge(N) -> 375 Response is 90057741 - (N*N)//19, 376 lp_get_license("", Response) % get runtime license 377 ; 378 lp_get_license % try development license 379 ) 380 -> 381 true % got it 382 ; 383 writeln(error, "No license"), 384 abort 385 ).</pre> 386Note that lp_get_license_challenge/1 will succeed for VAR versions of XPRESS-MP 387(e.g. if_xpress12parcrisk) and fail for non-VAR versions (e.g. if_xpress12). 388You can therefore write the code such that it works for both. 389<h4> 390Completely generic code</h4> 391Unfortunately the differences in licensing between CPLEX and XPRESS-MP 392cannot be completely hidden by the eplex library. But you can use lp_get/2 393to write completely generic code as follows: 394<pre>:- lib(eplex). 395 396:- ( lp_get(optimizer, xpress) -> 397 ... code to get XPRESS-MP license ... 398 ; lp_get(optimizer, cplex) -> 399 ... code to get CPLEX license ... 400 ; 401 abort % should not occur 402 ). 403 404</pre> 405 406</body> 407</html> 408