Difference between revisions of "Setup"

From cctbx_xfel
Jump to: navigation, search
(Prerequisities)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
''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.
+
<!-- XXX Should probably rename this page to "Set up ''cctbx.xfel''" or some such -->
  
== Run once ==
 
  
These steps need only be performed once before using ''cctbx.xfel''.
+
== Prerequisities ==
  
=== Configure ''pyana'' ===
+
The installation root directories of ''cctbx.xfel'' affect the absolute paths used in the following instructions and differ from site to site.  Some common installation root directories are listed below.
 +
{| class="wikitable sortable"
 +
|-
 +
! Site
 +
!class="unsortable"| Installation build directory
 +
!class="unsortable"| Installation source directory
 +
!class="unsortable"| Notes
 +
|-
 +
| BNL
 +
| <code>/usr/local/crys_test/cctbx/cctbx_build</code>
 +
| <code>/usr/local/crys_test/cctbx</code>
 +
|
 +
|-
 +
| CCI, LBNL
 +
|
 +
|
 +
| No central, shared installation available
 +
|-
 +
| NERSC
 +
|
 +
|
 +
| No central, shared installation available
 +
|-
 +
| SLAC
 +
| <code>/reg/g/cctbx/build</code>
 +
| <code>/reg/g/cctbx/sources</code>
 +
|
 +
|}
 +
''cctbx.xfel'' can be installed anywhere on the filesystem where write access is granted.  Developers will generally have ''cctbx.xfel'' installed in their home directory.  Even if ''cctbx.xfel'' is already installed, the environment must first be [[Set up PSDM software | prepared for the PSDM software distribution]].
  
Configuration files for ''pyana'' and ''cctbx.xfel'' are generally placed in a directory in your home account named ~/myrelease or ~/analisys-rel.  Follow [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Quick+Tour these instructions from SLAC] to configure ''pyana''.
+
== ''cctbx.xfel'' setup ==
  
=== Configure ''cctbx.xfel'' ===
+
To start using ''cctbx.xfel'', the environment has to be configured.  The details depend on the ''cctbx.xfel'' installation root directories and the user's shell.
 +
In what follows <code><b><i>/path/to/cctbx/build</i></b></code> and <code><b><i>/path/to/cctbx/sources</i></b></code> should be replaced with the actual build  and source directories of the ''cctbx.xfel'' installation.  bash-users can prepare the environment for ''cctbx.xfel'' using
 +
$ . <b><i>/path/to/cctbx/build</i></b>/setpaths.sh
 +
From a csh, the corresponding command is
 +
% source <b><i>/path/to/cctbx/build</i></b>/setpaths.csh
 +
Sourcing <code>setpaths</code> only modifies the environment of the <em>current shell</em>, and would have to be repeated every time a new shell is started.  To make the changes persistent, add
 +
test -r <b><i>/reg/g/cctbx/build</i></b>/setpaths.sh && \
 +
  . <b><i>/reg/g/cctbx/build</i></b>/setpaths.sh
 +
to <code>~/.bashrc</code>, or
 +
test -r <b><i>/reg/g/cctbx/build</i></b>/setpaths.csh && \
 +
  source <b><i>/reg/g/cctbx/build</i></b>/setpaths.csh
 +
to <code>~/.cshrc</code> as appropriate.
  
The simplest way to configure your environment to run ''cctbx.xfel'' is to run this command (bash(1) users):
+
To make the ''cctbx.xfel'' analysis modules available to PSDM's ''pyana'',
 
+
  $ cd <b><i>/path/to/test/release</i></b>
. /reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh
+
  $ sit_setup
 
+
  $ cd <b><i>my_ana_pkg</i></b>
csh(1) users should use this command:
+
  $ ln -fns <b><i>/path/to/cctbx/sources</i></b>/cctbx_project/xfel/cxi/cspad_ana src
 
+
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" && \
+
  . "/reg/d/ffb/cxi/temp/cctbx/cctbx_build/setpaths.sh"
+
 
+
csh(1) users should instead add these lines 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"
+
 
+
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:
+
  test -r "${HOME}/.bashrc" && . "${HOME}/.bashrc"
+
A job submitted to the cluster will typically run ''cctbx.xfel'' from a non-interactive shell.
+
 
+
=== Linking ''pyana'' to ''cctbx.xfel'' ===
+
 
+
Run these commands to associate ''pyana'' and ''cctbx.xfel'' together:
+
  $ cd ~/myrelease/my_ana_pkg
+
  $ ln -s /reg/d/ffb/cxi/temp/cctbx/cctbx_project/xfel/cxi/cspad_ana src
+
 
  $ cd ..
 
  $ cd ..
 
  $ scons
 
  $ scons
 +
where <code><b><i>/path/to/test/release</i></b></code> and <code><b><i>my_ana_pkg</i></b></code> are the path to the test release and the name of the analysis package chosen while [[Set up PSDM software | setting up the PSDM software distribution]].  The last step compiles the ''cctbx.xfel'' analysis modules.  These steps need only be performed once.
  
== Run each time on logging on to SLAC ==
+
<!--
 
+
At SLAC, test that it is working by <i>e.g.</i>
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:
+
  $ cxi.pyana -c /reg/g/cctbx/tutorials/setup/test.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0004-s00-c00.xtc
$ cd ~/myrelease
+
This should start a viewer, displaying dark-subtracted averages from an XTC stream. Press the green run button to see the images.  This particular stream has a series of misses at its beginning; hits will appear presently.  More specifically, this command starts ''pyana'' with a configuration file (<code>-c</code>) and an XTC file.  For more information, see the [[Overview]] and other tutorial pages.
$ sit_setup
+
-->
 
+
== Test the installation ==
+
At SLAC, test that it is working by e.g.
+
$ cd ~/myrelease
+
  $ cxi.pyana -c ~hattne/myrelease/test.cfg /reg/d/psdm/cxi/cxi78513/xtc/e280-r0245-s00-c00.xtc
+
This should start a viewer, displaying dark-subtracted averages from an XTC stream.
+

Latest revision as of 19:09, 5 March 2015


Prerequisities

The installation root directories of cctbx.xfel affect the absolute paths used in the following instructions and differ from site to site. Some common installation root directories are listed below.

Site Installation build directory Installation source directory Notes
BNL /usr/local/crys_test/cctbx/cctbx_build /usr/local/crys_test/cctbx
CCI, LBNL No central, shared installation available
NERSC No central, shared installation available
SLAC /reg/g/cctbx/build /reg/g/cctbx/sources

cctbx.xfel can be installed anywhere on the filesystem where write access is granted. Developers will generally have cctbx.xfel installed in their home directory. Even if cctbx.xfel is already installed, the environment must first be prepared for the PSDM software distribution.

cctbx.xfel setup

To start using cctbx.xfel, the environment has to be configured. The details depend on the cctbx.xfel installation root directories and the user's shell. In what follows /path/to/cctbx/build and /path/to/cctbx/sources should be replaced with the actual build and source directories of the cctbx.xfel installation. bash-users can prepare the environment for cctbx.xfel using

$ . /path/to/cctbx/build/setpaths.sh

From a csh, the corresponding command is

% source /path/to/cctbx/build/setpaths.csh

Sourcing setpaths only modifies the environment of the current shell, and would have to be repeated every time a new shell is started. To make the changes persistent, add

test -r /reg/g/cctbx/build/setpaths.sh && \
  . /reg/g/cctbx/build/setpaths.sh

to ~/.bashrc, or

test -r /reg/g/cctbx/build/setpaths.csh && \
  source /reg/g/cctbx/build/setpaths.csh

to ~/.cshrc as appropriate.

To make the cctbx.xfel analysis modules available to PSDM's pyana,

$ cd /path/to/test/release
$ sit_setup
$ cd my_ana_pkg
$ ln -fns /path/to/cctbx/sources/cctbx_project/xfel/cxi/cspad_ana src
$ cd ..
$ scons

where /path/to/test/release and my_ana_pkg are the path to the test release and the name of the analysis package chosen while setting up the PSDM software distribution. The last step compiles the cctbx.xfel analysis modules. These steps need only be performed once.