Modify SLAC Central Linux Environment

On this page:

Note: If you have not already done so, be sure you have
fulfilled the basic prerequisites for using SLAC Central Linux.
(See Prerequisites: Basic.)

.cshrc

If you plan to use SLAC Central Linux, you will need to set up your environment in one of the following two ways in order to access external libraries (root, clhep, etc.). Based upon .cshrc status from which you start, modify your login profile using one of the following procedures:

  • If you are starting from the default .cshrc, which you received from the SCS with your new account, replace your default  .cshrc file with the file:

    /afs/slac.stanford.edu/g/glast/ground/scripts/user.cshrc

  • Note: If you are not familiar with Unix, Use the following procedure to update your .cshrc file:

    1. Are you accessing SLAC Public from a Windows or Linux/Mac machine?

    If you are coming from a windows machine, first:

      1. Open a secure shell (e.g., PuTTY).
      1. Log in to a SLAC Public Machine (e.g., yakut.slac.stanford.edu); see Public Machines at SLAC.
    If you are coming from a Linux or a Mac machine, use a command-line ssh:

    ssh -Y rhel5-32.slac.stanford.edu

    1. Do not change directories (i.e., remain in your home directory for now).
     
    1. At the $ prompt, enter:

    cp /afs/slac.stanford.edu/g/glast/ground/scripts/user.cshrc ./.cshrc

    1. Refer below to: SLAC Public Environment (after setup)

OR

  • If you already have a .cshrc script with statements which you want to keep, you may use the group script by adding the following lines to the top of your .cshrc

    set interactive=${?prompt}
    if ( ${?LD_LIBRARY_PATH} != 1 ) then
          setenv  LD_LIBRARY_PATH

    endif
    setenv     GLASTROOT /afs/slac.stanford.edu/g/glast
    source  ${GLASTROOT}/ground/scripts/group.cshrc

SLAC Central Linux Environment (after setting up .cshrc)

A non-customized, Slac Public user environment should look similar to the one shown below after updating the .cshrc file.

Tip: After logging in to a Slac Central Linux machine, check the environment variables by entering the env|sort command at the $ prompt. When using the NFS User Space, you will need to make special note of the environment variables set up for:

Note: ROOT for GLAST variables are not included in the script files. If using ROOT on SLAC Public, you will also want to add those variables to your .cshrc file. (See Set ROOT Environment Variables: Linux.)

Examples of environment variables in a SLAC Central Linux user's home directory:

BUILDS=/nfs/farm/g/glast/u09/builds/
CLASSPATH=:/afs/slac/g/glast/applications/CMT/v1r18p20061003/java/cmt.jar
CMTBASE=/afs/slac.stanford.edu/g/glast/applications/CMT
CMTCONFIG=rhel4_gcc34opt
CMTVERSION=v1r18p20061003
CMTROOT=/afs/slac/g/glast/applications/CMT/v1r18p20061003
CVSROOT=/nfs/slac/g/glast/ground/cvs
CVS_RSH=ssh
GLASTROOT=/afs/slac.stanford.edu/g/glast
GLAST_EXT=/afs/slac/g/glast/ground/GLAST_EXT/rhel4_gcc34opt
GROUPSCRIPTS=/afs/slac.stanford.edu/g/glast/ground/scripts
LATCalibRoot=/afs/slac/g/glast/ground/releases/calibrations/

SCons Environment Variables

Setting up environment variables is less complicated when using SCons builds: there are only three that you must watch closely:

  • BUILDS:
    • SCons versions are on the u35 disk.
    • The earlier CMT versions are on the u30 disk.

    When running on SLAC Central Linux with intent to use a Release Manager build, be sure that the BUILDS variable is pointing to u35:

    BUILDS=/nfs/farm/g/glast/u35/

  • GLAST_EXT:

    For SCons (at the time this was written, 08-24-2010), the correct values are:

 
rhel4 32 bit:
  /afs/slac/g/glast/ground/GLAST_EXT/redhat4-i686-32bit-gcc34
or   
rhel4 64 bit:
  /afs/slac/g/glast/ground/GLAST_EXT/redhat4-x86_64-64bit-gcc34
or   
rhel5 32 bit:
  /afs/slac/g/glast/ground/GLAST_EXT/redhat5-i686-32bit-gcc41
or   
rhel5 64 bit:
  /afs/slac/g/glast/ground/GLAST_EXT/redhat5-x86_64-64bit-gcc41

Note: The earlier CMT versions are at: /afs/slac/g/glast/ground/GLAST_EXT/rhel4_gcc34opt

Tip: It is strongly recommended that you routinely set GLAST_EXT when you login to SLAC Central Linux!

  • INST_DIR:
    • This path points to the directory where the package(s) you are working with are (or are to be) installed.

Example: Setup (when running Science Tools on SLAC Central Linux)

When you are performing Science Tools tutorial, it is normally assumed that you are running on a SLAC Central Linux RHEL5-64 machine in a bash shell.

KIPAC's "xray" packages. While the default login shell when using SLAC Central Linux is tcsh, the Fermi LAT Science Tools are often used together with some of HEASOFT tools within the FTOOLS environment (e.g., ds9, fv, XSPEC, etc.) At SLAC, configurations of the HEASOFT packages are maintained by KIPAC and intended primarily for use in a bash shell. (See The KIPAC software collection.)

When running a setup script, first:

  1. Refer to: SLAC Central Linux: Getting Started and then create a work directory (e.g., explore_LATdata) in your User Work Space.
  2. SSH to a RHEL5-64 machine: ssh rhel5-64
  3. Start a bash shell: bash
  4. If you have not already done so:
    1. Use the emacs editor and create the following file:
# used by /afs/slac/g/ki/software/etc/profile.xray during heasoft setup
heasoft 6.10
ciao none
caldb none
sas none
idl none
iraf none
starlink none
  1. Name the file .xrayrc and save it to your $HOME directory.

Note: The .xrayrc file works only when you are running in a bash shell. For more information on the .xrayrc file, see The KIPAC software collection page and scroll down to the section titled ~/.xrayrc Configuration File.

If this .xrayrc file is not in your $HOME directory when you run your setup script, you may experience problems when a Science Tool accesses the wrong version of an external library. To check if this file is in your ~HOME directory, issue the ls -a command. Periodically, you may wish to update this file as new HEASOFT versions are released.

  1. Create a setup script similar to the example shown below and save it to your ~HOME directory, then run the setup script; for example: source setup_mypyLike_environment

Important: Be sure that the kipac packages are sourced before the ScienceTools. (If the kipac packages are sourced after sourcing the ScienceTools, applications using cfitsio will fail.)

Assumptions

  • You are running SCons builds on SLAC Central Linux in a bash shell.
  • You have the .xrayrc file in your ~HOME directory.
  • The KIPAC tools are sourced before the Science Tools.
  • The data files you are working with are located in your work directory.
  • All commands will be issued from within your work directory.

Notes:

  • If you are used to working in a tcsh shell, observe that the bash "export" command equates to the C shell's "setenv" command.
Example setup script for running an optimized SCons ScienceTools-xx-xx-xx build on a SLAC Central Linux redhat5 64-bit machine and running KIPAC's FTOOLS packages:

# Set Environment Variables
# To run SAOImage ds9, FTOOLS,and XSPEC at SLAC
source /afs/slac.stanford.edu/g/ki/software/etc/profile.xray
# Define BUILDS for SCons versions (i.e., u35)
export BUILDS=/nfs/farm/g/glast/u35/ReleaseManagerBuild
# Define build type (defined for 64-bit redhat5 machine)
export BLDTYPE=redhat5-x86_64-64bit-gcc41
# Define GLAST_EXT (also defined for 64-bit redhat5 machine)
export GLAST_EXT=/afs/slac/g/glast/ground/GLAST_EXT/${BLDTYPE}
# INST_DIR should be set to root of base installation
# Define ScienceTools version
export INST_DIR=${BUILDS}/${BLDTYPE}/Optimized/ScienceTools/09-20-00
# The following line (or equivalent) should be included if you plan to run
# executables directly. Do not include if using wrapper scripts.
# Note last field in the path prior to filename is the variant.
source ${INST_DIR}/bin/redhat5-x86_64-64bit-gcc41-Optimized/_setup.sh
# Create environment variable My_Data
export My_Data=/afs/slac/g/glast/users/userName/workDirectory
# Change to My_Data directory
cd $My_Data
# end


Last updated by: Chuck Patterson 03/28/2011