Stefan Svensson wrote:
> I try to learn how to set up Modules, but I have not yet found any
> documentation on how to set up a cross-platform environment where you have
> different platforms (Solaris, HP-UX, SGI, Linux), os revisions (Solaris
> 5.6, 7, 8; HP-UX 9, 10.20, 11; etc) and, of course, different application
> versions.
>
> Are there any documents on this, does anyone have any experience - or do I
> have to find out the hard way? :-)
Your can use the .version or .modulerc to control which version of an application
is going to be the default on a particular platform with something like this:
#%Module
#
# $Id: .version,v 1.7 2002-07-26 10:28:25-04 dmores Exp $
#
##########################################################################
switch -regexp -- [uname sysname].[uname release] {
{ "HP-UX.*" }
{ set ModulesVersion "20.5" }
{ "SunOS.5.*" }
{ set ModulesVersion "25.3" }
}
The 20.5 and 25.3 refer to directories by that name where the .version file lives - e.g. appname/20.5
and appname/25.3 - where the .version file is in directory appname. The modulefile for each version
lives in the 20.5 and 25.3 subdirectory. You can also have a .version file in each subdiretory if you need
more than one modulefile to choose from but want one to be the default.
In modulefiles you can use a similar arrangement to set the environment based on
the platform type with something like this TCL code fragment:
set TOOL_HOME /home/tool_25.3_a
#------ O/S specific settings
switch -regexp -- [uname sysname].[uname release] {
SunOS.5.* {
append-path PATH $TOOL_HOME/sol/bin
}
HP-UX.* {
append-path PATH $TOOL_HOME/hpux/bin
}
default {
error "The modulefile [module-info name]: is not supported under O/S [uname sysname].[uname release]"
}
}
This is an arrangement we have been using successfully for the past 10 years with Modules version 2.2b. Version 3.x still has problems with more than two directory levels.
Hope this helps you.
Dave
|