[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question on running several versions of IDL with a Floating-Type licence



Kristian Kjr wrote:
> 
> We recently got a Floating-Type licence here, with the licence manager
> running on a Debian GNU/Linux 2.1 .
> How do we get to run both IDL 5.2 and IDL 5.3 (by user's choice)?
> We have licence.dat files for IDL 5.2 and for IDL 5.3 but it seems that
> they both want to be called
> .../rsi/license/license.dat

Use the newest license file you have.  It will support versions up to and equal
what it permits.  For instance, keep both:

/usr/local/rsi/idl_5.3
and
/usr/local/rsi/idl_5.2.1

leaving /usr/local/rsi/license.dat as the newer 5.3 one.

An individual user may select either version by redefining their IDL_DIR
environment variable. 

You could write a simple system-wide script to do this (and a little more):

file idl5.3 with symlink idl5.2
<-------------------------------------------------------->
#!/bin/bash
base=/usr/local/rsi
[ -n "$IDL_DIR" ] && old_dir=$IDL_DIR

case "$0" in
	*5.2) export IDL_DIR=$base/idl_5.2.1;;
	*5.3) export IDL_DIR=$base/idl_5.3;;
esac

if [ -n "$old_dir" -a -n "$IDL_PATH" ]; then
	export IDL_PATH=$(echo $IDL_PATH | sed "s:$old_dir:$IDL_DIR:g")
fi

[ -z "$IDL_PATH" ] && export IDL_PATH="+$IDL_DIR/lib"
exec $IDL_DIR/bin/idl
<-------------------------------------------------------->

It simply sets the IDL_DIR environment variable depending on how it was called,
and makes sure the IDL_PATH is correct (you need to reference the same libraries
as the version you're using).  It works even if the user already has an IDL_PATH
and IDL_DIR defined, making use of the former as modified to point to the
correct libraries.  You can obviously add more directories to the case statement
and it would perform as expected, just make a new symlink with the expected name
(e.g. idl5.4).

For the curious, you can also use more than one license file, if you are
inclined (for example, if you have more than one server, and would like to fail
over if no licenses are available on one).  In that case, simply set the
environment variable LM_LICENSE_FILE to point to the license file you'd like to
use.  In this example this isn't necessary, and won't even work, since the
license file and license server need to match (this is an important point -- you
can use older versions of IDL with a given license server, but *not* older
versions of the license file!).  

You can also use the handy lmstat to test the license server status for
failovers, etc.  And for the very brave, you can run more than one license
server on the same machine, using different ports.

Good Luck,

JD

-- 
 J.D. Smith                             |*|      WORK: (607) 255-5842    
 Cornell University Dept. of Astronomy  |*|            (607) 255-6263
 304 Space Sciences Bldg.               |*|       FAX: (607) 255-5875 
 Ithaca, NY 14853                       |*|