.. highlight:: bash Environment Setup ================= Before using the Allegro computers, it is advised to set up your system to get full access to the system-wide installation of python modules, binaries, etc. .. _label-rc: General Setup ------------- There are two scripts that set up all the environment variables to use the software, find programs, etc. The first script is for all users of the Allegro computing environment, the second one is for Allegro personnel. **NOTE!** If you don't run these, you won't be able to find stuff. The best way to run the scripts is add the following lines to your private setup scripts. * **Bash** users should add these lines to their ``~/.bashrc``:: lustreroot_file='/home/alma/etc/lustre_root' if [[ -r $lustreroot_file ]]; then lustreroot=`cat $lustreroot_file` else lustreroot='/lustre1' fi alg_user_setup=$lustreroot/allegro/bin/bashrc_user.sh if [[ -r $alg_user_setup ]]; then . $alg_user_setup fi alg_staff_setup=$lustreroot/allegro/allegro_staff/bin/bashrc_allegro.sh if [[ -r $alg_staff_setup ]]; then . $alg_staff_setup fi * **C-Shell** users should add these lines to their ``~/.cshrc``:: set lustre_root_file="/home/alma/etc/lustre_root" if ( -r $lustre_root_file ) then set lustreroot=`cat $lustre_root_file` else set lustreroot="/lustre1" endif set alg_user_setup=$lustreroot/allegro/bin/cshrc_user.csh if ( -r $alg_user_setup ) then source $alg_user_setup endif set alg_staff_setup=$lustreroot/allegro/allegro_staff/bin/cshrc_allegro.csh if ( -r $alg_staff_setup ) then source $alg_staff_setup endif Once you've made these additions, you won't need to bother about the scripts any more. You will automatically be able to find CASA etc from the command line every time you log in. After you source these scripts, you will have automatically defined some environment variables. All users see the following ones: ======================== ============================================= ============================================ name current value description ======================== ============================================= ============================================ ``$ALLEGRO`` ``/lustre2/allegro`` Allegro root directory ``$ALLEGRO_MAINTENANCE`` ``$ALLEGRO/etc/login_messages/maintenance`` Maintenance File (only present if scheduled) ======================== ============================================= ============================================ Allegro members see additional envars, including: ======================== ============================================= ============================================ name current value description ======================== ============================================= ============================================ ``$ALLEGRO_STAFF`` ``$ALLEGRO/allegro_staff`` Allegro staff directory ``$ALLEGRO_LOG`` ``$ALLEGRO_STAFF/log`` Directory for various kinds of logs ``$ALLEGRO_DB`` ``$ALLEGRO_STAFF/.db`` Database directory ``$ALLEGRO_GIT`` ``/net/chaxa/data1/allegro/github`` Allegro github ``$ALLEGRO_QA2_STYLE`` an integer (currently 4) QA2 delivery style (needed for QA2 scripts) ======================== ============================================= ============================================ .. note:: It should be noted that by sourcing these scripts, your default for the umask will be ``umask 002``. This means that by default, the group gets the same permissions as you, and others will not have write permission. CASA ---- .. highlight:: python To load the user-provided CASA tasks and other modules when you work on the Allegro computers, simply add the following lines to your ``~/.casa/init.py``:: import socket hostName = socket.gethostname().split('.')[0] # this seems to be the most robust/portable way to obtain the hostname. available_hosts = open('/home/alma/etc/available_hosts').read().split('\n')[:-1] if hostName in available_hosts: allegro = os.getenv('ALLEGRO') allegro_staff = os.getenv('ALLEGRO_STAFF') exec(open('%s/etc/casa/init.py' % allegro).read()) exec(open('%s/etc/casa/init.py' % allegro_staff).read()) .. note:: Please NOTE that the advice on ESO's QA2 Twiki is not consistent with this. All of the stuff they recommend to add to your .casa/init.py is already implemented by our Allegro login scripts and by the allegro_staff CASA init.py referred to above. It's better to use our advised init.py insert above and ignore theirs. ;)