Module framework

From HP-SEE Wiki

(Difference between revisions)
Jump to: navigation, search
(Created page with "= What are Environment Modules? = The Environment Modules package provides for the dynamic modification of a user's environment via modulefiles. Each modulefile contains the i...")
Line 11: Line 11:
Website: http://modules.sourceforge.net
Website: http://modules.sourceforge.net
 +
 +
= Install Instructions =
 +
1. Install tcl and tcl-dev packages
 +
    % yum install tcl tcl-dev
 +
2. Download and extract Modules framework
 +
    http://sourceforge.net/projects/modules/files/Modules/
 +
3.
= Quick Examples =  
= Quick Examples =  

Revision as of 14:02, 23 June 2011

Contents

What are Environment Modules?

The Environment Modules package provides for the dynamic modification of a user's environment via modulefiles.

Each modulefile contains the information needed to configure the shell for an application. Once the Modules package is initialized, the environment can be modified on a per-module basis using the module command which interprets modulefiles. Typically modulefiles instruct the module command to alter or set shell environment variables such as PATH, MANPATH, etc. modulefiles may be shared by many users on a system and users may have their own collection to supplement or replace the shared modulefiles.

Modules can be loaded and unloaded dynamically and atomically, in an clean fashion. All popular shells are supported, including bash, ksh, zsh, sh, csh, tcsh, as well as some scripting languages such as perl.

Modules are useful in managing different versions of applications. Modules can also be bundled into metamodules that will load an entire suite of different applications.

Website: http://modules.sourceforge.net

Install Instructions

1. Install tcl and tcl-dev packages

   % yum install tcl tcl-dev

2. Download and extract Modules framework

   http://sourceforge.net/projects/modules/files/Modules/

3.

Quick Examples

Here is an example of loading a module on a Linux machine under bash.

   % module load gcc/3.1.1
   % which gcc

/usr/local/gcc/3.1.1/linux/bin/gcc Now we'll switch to a different version of the module

   % module switch gcc gcc/3.2.0
   % which gcc
   /usr/local/gcc/3.2.0/linux/bin/gcc

And now we'll unload the module altogether

  % module unload gcc
  % which gcc
  gcc not found

Now we'll log into a different machine, using a different shell (tcsh).

   tardis-> module load gcc/3.1.1
   tardis-> which gcc
   /usr/local/gcc/3.1.1/sunos5.6/bin/gcc

Note that the command line is exactly the same, but the path has automatically configured to the correct architecture.

Documentation

Personal tools