Hall B EPICS "setup"
I've written a script to set up the environment needed to use
our local version of EPICS. The command is:
source /usr/site2/epics_physics/setup/setup_epics
You will probably want to define an alias for this, e. g.,
alias setup_epics /usr/site2/epics_physics/setup/setup_epics
Reader's Digest Condensed Version
---------------------------------
Assuming the above-mentioned alias is defined,
setup_epics prod
or simply
setup_epics
will give the current production version of our EPICS files. And
setup epics devel
will give a version that reflects the latest (or nearly the latest)
version of the software. It's actually more complicated than that; see
the rest of the note.
What the Script Does
--------------------
This script will accept arguments that can be used to modify the
definitions of the EPICS and BASEB environment variables. If these
arguments are not supplied, then it will look for an existing
setting for these variables and assign default values if the
settings are not found. To summarize, the order of precedence is:
precedence source of definition
---------- --------------------
high command line argument
middle pre-set environment variable
low default
So, to get the defaults, the variables must be unset. If you need
to, you can do this explicitly, for example:
unsetenv BASEB
To check whether or not BASEB is defined:
echo $BASEB
The next sections explain in detail how the definitions are made.
Default
-------
If both EPICS and BASEB are unset, then the command
setup_epics
will set EPICS as
/usr/site2/epics_physics/hallb/hallB
and BASEB as
$EPICS/prod/baseB
Pre-Set Environment Variable
----------------------------
If both EPICS and BASEB are set, then the command
setup_epics
will leave these definitions alone. You could for example have EPICS =
/home/ren/epics and BASEB = /home/stimpy/baseB and setup_epics will
not change these settings.
Command Line Argument
---------------------
For example:
setup_epics baseB_arg epics_arg
Working from the end, the second argument is used to define EPICS as
/usr/site2/epics_physics/hallb/epics_arg
and then the first argument is used to define BASEB as
$EPICS/baseB_arg/baseB
Combinations
------------
If an argument is not supplied, then the rules for pre-set and default
take over for that argument only. So for example, assuming that
neither EPICS nor BASEB are set
setup_epics devel
gives
EPICS = /usr/site2/epics_physics/hallb/hallB
BASEB = /usr/site2/epics_physics/hallb/devel/baseB
since EPICS is allowed to default (no second argument), and the
command line argument "devel" causes BASEB to become
$EPICS/devel/baseB.
Again assuming that neither EPICS nor BASEB are set
setup_epics "" R3.13.0
gives
EPICS = /usr/site2/epics_physics/hallb/R3.13.0
BASEB = /usr/site2/epics_physics/hallb/R3.13.0/prod/baseB
since the command line argument "R3.13.0" forces the definition of
EPICS and BASEB is allowed to default to $EPICS/prod/baseB. The null
string ("") acts as a place holder.
CVS
---
The script and this documentation file are under CVS control. To get
your own copy use the command
cvs checkout setup
This creates the directory setup in your default directory which in
turn contains the files. (Note that you must have CVSROOT set properly
before attempting this.)
--
Mark M. Ito, Thomas Jefferson National Accelerator Facility
12000 Jefferson Ave., Mail Stop 12H, Newport News, VA 23606
Email: marki@jlab.org, Office: (757)269-7175, Pager: (757)680-7175