|
Configuring your login environment
Tools and packages are located in various places on our
systems. E.g. standard Solaris programs can be found
under /usr/bin, and the current Studio compiler suite
under /opt/studio12.
To be able to access these different tool locations
requires configuring the environment of your login shell.
This usually means setting the "PATH" variable to include
the directories where programs are found.
It is possible to do this explicitly in your shell's
startup files. However, over time, what you have in your
files will not match newer versions of tools that have
been installed and having to make configuration changes is
a distraction.
UsepackageRather than have each person on the system edit their
shell startup files and insert environment settings
manually after having to hunt around for tool locations, 2
steps have already been taken to give you a nice default
environment.
- usepackage provides you with a command (actually a
shell alias/function) called "use" that changes your
environment for you.
- at login the system provides you with a sensible
default environment.
usepackage lets you set up your environment with a single
command and package name. Example: you are compiling some
software that requires Studio 10 instead of the system
default, Studio 12:
$ echo $PATH
/opt/studio12/SUNWspro/bin: .........
$ use studio10
$ echo $PATH
/opt/studio10/SUNWspro/bin: .........
This has prepended the bin directory for Studio 10 to your
PATH (and set the environment for the right man pages
too). Your login shell now will invoke the Studio 10
compilers (you can verify this with the command
"version").
To make this permanent (for every time you login), add a
"use" line to your login shell's startup file, e.g.
bash: ~/.bash_profile
csh/tcsh: ~/.login,
sh/ksh: ~/.profile
(In the /etc/skel directory you'll find the system-wide
default files that new accounts receive. There's a
comment in each default file with an example "use".)
The system will give you a default set of packages, which
can then be extended by your shell's startup files. To
see this default and all available packages, run "use -l",
e.g.
$ use -l
usepackage 1.7, Copyright (C) 1995-2003 Jonathan Hogg
Available packages are:
...
Available groups are:
standard-user-settings - sge6, ct6, studio12, x11, blastwave, ccs, system
chemistry - g03, autodock305
This means you will, automatically and with no effort on
your part, be able to use all the standard Solaris
programs, various GNU and utility packages, X11 programs,
Studio 12 compilers, MPI tools, and Grid Engine for
submitting jobs. If you want to add other packages or
package groups (e.g. chemistry oriented), just "use" the
package name or group.
The default grouping will be updated to track new
versions, e.g. when Studio 12 is the released compiler
suite, the package "studio12" will become part of
"standard-user-settings" instead, and new logins will pick
this up automatically.
Not for me
You can of course ignore all of this, and set your
environment by hand as you are used to, if you prefer.
Advanced Use
If you need to access the "use" command outside of the
login shell (e.g. customizing a package from a shell
script) it is possible to do so with a simple "source"
command. Please ask HPCVL user support about this.
|