Difference between revisions of "Setup"

From cctbx_xfel
Jump to: navigation, search
(Corrected link.)
(Configure cctbx.xfel)
Line 11: Line 11:
 
Installation of a "test release" and analysis packages is covered in [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Quick+Tour Analysis Workbook.  Quick Tour].  Linking the ''cctbx.xfel'' analysis modules to the analysis package is described in [[#Linking cctbx.xfel to pyana|Linking cctbx.xfel to pyana]].
 
Installation of a "test release" and analysis packages is covered in [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Quick+Tour Analysis Workbook.  Quick Tour].  Linking the ''cctbx.xfel'' analysis modules to the analysis package is described in [[#Linking cctbx.xfel to pyana|Linking cctbx.xfel to pyana]].
  
=== Configure ''cctbx.xfel'' ===
+
=== ''cctbx.xfel'' setup ===
 
+
==== bash(1) ====
The simplest way to configure your environment to run ''cctbx.xfel'' is to run this command (bash(1) users):
+
To set up the ''cctbx.xfel''-environment for a bash(1) shell, <code>setpaths.sh</code> has to be sourced,
  
 
  . /reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh
 
  . /reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh
  
csh(1) users should use this command:
+
To avoid having to perform this step on each login, the lines below should be added to <code>~/.bashrc</code> file
  
source /reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.csh
 
 
To make these changes persistent, bash(1) users are encouraged to add these lines to ~/.bashrc
 
 
  test -r "/reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh" && \
 
  test -r "/reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh" && \
 
   . "/reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh"
 
   . "/reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh"
  
csh(1) users should instead add these lines to ~/.cshrc
+
This ensures the environment is properly prepared for non-interactive shells, which are used to launch jobs on the cluster.  To prepare the environment for interactive bash(1) shells it is recommended to put the lines below near the top of <code>~/.bash_profile</code>:
 +
 
 +
test -r "${HOME}/.bashrc" && . "${HOME}/.bashrc"
 +
 
 +
==== csh(1) ====
 +
csh(1)-users should instead source <code>setpaths.csh</code>,
 +
 
 +
source /reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.csh
 +
 
 +
and add the lines below to <code>~/.cshrc</code>
 +
 
 
  test -r "/reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.csh" && \
 
  test -r "/reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.csh" && \
 
   source "/reg/d/ffb/cxi/temp/cctbx/cctbx-build/setpaths.csh"
 
   source "/reg/d/ffb/cxi/temp/cctbx/cctbx-build/setpaths.csh"
  
Note: to avoid surprises when running ''cctbx.xfel'' from a non-interactive shell, it is recommended that bash(1) users edit ~/.bash_profile, and put this line near the top:
+
For csh(1) there is no need to edit any additional files for interactive shells.
test -r "${HOME}/.bashrc" && . "${HOME}/.bashrc"
+
A job submitted to the cluster will typically run ''cctbx.xfel'' from a non-interactive shell.
+
  
 
=== Linking ''cctbx.xfel'' to ''pyana'' ===
 
=== Linking ''cctbx.xfel'' to ''pyana'' ===

Revision as of 02:51, 27 September 2013

cctbx.xfel is installed at SLAC for general use. Before it can be used, the following setup commands need to be run to configure the environment.

Run once

These steps need only be performed once before using cctbx.xfel.

LCLS release setup

cctbx.xfel extends a release of the LCLS analysis packages with a set of analysis modules. A test release, which refers to a particular release of the LCLS packages, is represented by a directory in the file system, often called analysis-rel or myrelease. An analysis package within the test release in turn refers to the files implementing the analysis modules of cctbx.xfel.

Installation of a "test release" and analysis packages is covered in Analysis Workbook. Quick Tour. Linking the cctbx.xfel analysis modules to the analysis package is described in Linking cctbx.xfel to pyana.

cctbx.xfel setup

bash(1)

To set up the cctbx.xfel-environment for a bash(1) shell, setpaths.sh has to be sourced,

. /reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh

To avoid having to perform this step on each login, the lines below should be added to ~/.bashrc file

test -r "/reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh" && \
 . "/reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh"

This ensures the environment is properly prepared for non-interactive shells, which are used to launch jobs on the cluster. To prepare the environment for interactive bash(1) shells it is recommended to put the lines below near the top of ~/.bash_profile:

test -r "${HOME}/.bashrc" && . "${HOME}/.bashrc"

csh(1)

csh(1)-users should instead source setpaths.csh,

source /reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.csh

and add the lines below to ~/.cshrc

test -r "/reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.csh" && \
 source "/reg/d/ffb/cxi/temp/cctbx/cctbx-build/setpaths.csh"

For csh(1) there is no need to edit any additional files for interactive shells.

Linking cctbx.xfel to pyana

Run these commands to associate pyana and cctbx.xfel:

$ cd ~/myrelease/my_ana_pkg
$ ln -s /reg/d/ffb/cxi/temp/cctbx/cctbx_project/xfel/cxi/cspad_ana src
$ cd ..
$ scons

The last step compiles the analysis modules just linked in.

Run each time on logging on to SLAC

Whenever you log on to a fresh shell at SLAC, before you can use any portion of cctbx.xfel that uses pyana, you must run these commands:

$ cd ~/myrelease
$ sit_setup

Test the installation

At SLAC, test that it is working by e.g.

$ cd ~/myrelease
$ cxi.pyana -c /reg/d/ffb/cxi/temp/cctbx/tutorials/setup/test.cfg /reg/d/ffb/cxi/temp/Feb2013calib/e290-r0069-s00-c00.xtc

This should start a viewer, displaying dark-subtracted averages from an XTC stream.