
			 The Modules Package
			     Version 1.0

			   John L. Furlani
			Sun Microsystems, Inc.
		      john.furlani@East.Sun.COM
			   22 January 1992


1. Introduction
_______________

This directory contains a copy of The Modules Package that uses Tcl
(Tool Command Language) developed by  John Ousterhout at the
University of California at Berkeley.  You must obtain a copy of Tcl
at least version 6.0 -> 6.2.  Tcl should be available either at the
same site you obtained The Modules Package or sprite.berkeley.edu.

For an introduction to The Modules Package, see the paper, ``Modules:
Providing a Flexible User Environment'', in the Proceeding of the 1991
Large Installation Systems Administrators USENIX Conference.  A copy
of the paper is included in Postscript form in doc/Modules-Paper.ps.
The paper describes a much earlier version based on shell scripts
being sourced into the user environment.  The implementation details
may not be correct, but the package concepts haven't changed.


2. Documentation
________________

The ./doc directory contains both the paper and a single man page
describing both the user usage and the module writer's usage.


3. Building Modules
___________________

The Modules Package is written in ANSI C and should build on any
machine with an ANSI C compiler like the GNU C compiler.  The Tcl
package is written in traditional C and thus needs the '-traditional'
flag if compiling using gcc.  Follow the directions provided with Tcl
for building Tcl.

First, build Tcl and run the tests provided with Tcl to verify it
built correctly.

Second, edit the Makefile in the directory containing the Modules
distribution.  You'll have to change TCLSRCDIR and BINDIR.  Set
TCLSRCDIR to the directory containing the Tcl distribution WITH the
built Tcl library.  Set BINDIR to where you want modulecmd installed
when you run 'make install'.

If you're using gcc, do nothing but type 'make' and it should build
leaving the 'modulecmd' program in the Module distribution directory.

If you're using another compiler, edit the Makefile and change the CC=
line to point to that compiler.


4. Installing Modules
_____________________

First, you'll need to decide on a location to keep Modules on your network.

The path name to the initialization files must be the same on all of
the systems using Modules.  This is because your users' .cshrc or
other shell startup files must hard code this directory in order to
source their Modules initialization file.

You will also need to choose a location for the 'modulecmd' program
and all of your modulefiles.  The location of these can be different
on different systems, but it is not recommended.  These paths are
defined in the Modules init files.

Example:
	Decided to keep Modules in /depot/Modules.

	initialization file   -->  /depot/Modules/init
	modulefiles           -->  /depot/Modules/modulefiles
	modulecmd             -->  /depot/Modules/bin

	Edit each of the init files and set the appropriate variables.
	Here is the C Shell initialization file, 'csh'.

-------------
##
##	Aliases for Environment Modification
##
alias module 'eval `$MODULESHOME/bin/modulecmd csh \!*`'

setenv MODULESHOME /depot/Modules

if (! $?MODULEPATH ) then
  setenv MODULEPATH $MODULESHOME/modulefiles
endif

if (! $?LOADEDMODULES ) then
  setenv LOADEDMODULES
endif
-------------

	Thus, a user puts the following line in their .cshrc

	source /depot/Modules/init/csh

	and then loads initial module in their .login

	module load openwin lang


Once you have modified all of the init files for your network, install
them.

I have provided a number of sample modulefile in the
sample-modulefiles directory (surprise!:).  This should help provide
you with some idea on how to write modulefiles.

Finally, type 'make install' and 'modulecmd' will be installed into
the BINDIR directory.


5. Special Thanks
_________________

Ken Manheimer and Don Libes at the National Institute of Standards and
Technology deserve special thanks for their help and ideas toward 
the original paper, design considerations, and the use of Tcl.
Maureen Chew with Sun Microsystems provided me with a test
environment and many ideas on how to improve Modules.  There are many
others that deserve thanks but too many to list here -- thanks to
everyone that helped.


6. Bugs
_______

Report bugs to 'module-bugs@sunpix.East.Sun.COM'.  Please try to
provide a full environment listing and a copy of the modulefiles
you're trying to manipulate.  Be as explicit and detailed as possible.
Thanks.

