Difference between revisions of "Setup"

From cctbx_xfel
Jump to: navigation, search
(Test the installation)
(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 -->
  
== One-time setup ==
 
  
These steps need only be performed once before using ''cctbx.xfel''.
+
== Prerequisities ==
  
=== LCLS quick start ===
+
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]].
  
A ''test release'', which refers to a particular release of the LCLS packages, is represented by a directory in the file system, often called <code>analysis-rel</code> or <code>myrelease</code>. An analysis package within the test release in turn refers to the files implementing the analysis modules of the package. Details about installing of a test release and analysis packages are covered in [https://confluence.slac.stanford.edu/display/PCDS/Analysis+Workbook.+Quick+Tour Analysis Workbook.  Quick Tour].  Assuming the LCLS software is installed at <code>/reg/d/psdm</code>, the LCLS environment is prepared in a bash(1) shell using
+
== ''cctbx.xfel'' setup ==
<pre>
+
 
$ . /reg/g/psdm/etc/ana_env.sh
+
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.
</pre>
+
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
or
+
$ . <b><i>/path/to/cctbx/build</i></b>/setpaths.sh
<pre>
+
From a csh, the corresponding command is
% source /reg/g/psdm/etc/ana_env.csh
+
% source <b><i>/path/to/cctbx/build</i></b>/setpaths.csh
</pre>
+
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 startedTo make the changes persistent, add
for a csh(1)These settings may be made persistent by adding
+
test -r <b><i>/reg/g/cctbx/build</i></b>/setpaths.sh && \
<pre>
+
  . <b><i>/reg/g/cctbx/build</i></b>/setpaths.sh
test -r /reg/g/psdm/etc/ana_env.sh && . /reg/g/psdm/etc/ana_env.sh
+
</pre>
+
 
to <code>~/.bashrc</code>, or
 
to <code>~/.bashrc</code>, or
<pre>
+
test -r <b><i>/reg/g/cctbx/build</i></b>/setpaths.csh && \
test -r /reg/g/psdm/etc/ana_env.csh && . /reg/g/psdm/etc/ana_env.csh
+
  source <b><i>/reg/g/cctbx/build</i></b>/setpaths.csh
</pre>
+
to <code>~/.cshrc</code> as appropriate.
to <code>~/.cshrc</code> as appropriate.  A test released based on the most current LCLS software is then set up using
+
<pre>
+
$ newrel ana-current myrelease
+
$ cd myrelease
+
$ newpkg my_ana_pkg
+
</pre>
+
Linking the ''cctbx.xfel'' analysis modules to the analysis package is described in [[#Linking cctbx.xfel to pyana|Linking cctbx.xfel to pyana]].
+
  
=== ''cctbx.xfel'' setup ===
+
To make the ''cctbx.xfel'' analysis modules available to PSDM's ''pyana'',
To start using an installation of ''cctbx.xfel'', the environment has to be configured.  The details depend on the user's shell.
+
$ cd <b><i>/path/to/test/release</i></b>
 
+
<ul>
+
<li>
+
For a bash(1) shell, <code>setpaths.sh</code> should be sourced from the shell configuration files.  To do that, add
+
<pre>test -r "/reg/g/cctbx/build/setpaths.sh" && \
+
  . "/reg/g/cctbx/build/setpaths.sh"</pre>
+
to <code>~/.bashrc</code>.  This ensures the environment is properly prepared for non-interactive shells, ''e.g.'' the shells that are used to run jobs on the cluster.  To also be able to use ''cctbx.xfel'' from interactive shells, ''e.g.'' the shell started after logging in to a host, it is recommended to put
+
<pre>test -r "${HOME}/.bashrc" && . "${HOME}/.bashrc"</pre>
+
near the top of <code>~/.bash_profile</code>.  These changes will not take effect until a new shell is started.  To start using the ''cctbx.xfel'' environment from the running shell, source <code>setpaths.sh</code> on the command line,
+
<pre>. /reg/g/cctbx/build/setpaths.sh</pre>
+
</li>
+
 
+
<li>
+
csh(1)-users should instead source <code>setpaths.csh</code>.  Add
+
<pre>test -r "/reg/g/cctbx/build/setpaths.csh" && \
+
source "/reg/g/cctbx/build/setpaths.csh"</pre>
+
to <code>~/.cshrc</code>. There is no need to edit any additional files for interactive shells.  To set up the environment for the running shell, execute
+
<pre>source /reg/g/cctbx/build/setpaths.csh</pre>
+
on the command line.
+
</li>
+
</ul>
+
 
+
=== Linking ''cctbx.xfel'' to ''pyana'' ===
+
 
+
Run these commands to associate ''pyana'' and ''cctbx.xfel'':
+
$ cd ~/myrelease
+
 
  $ sit_setup
 
  $ sit_setup
  $ cd ~/myrelease/my_ana_pkg
+
  $ cd <b><i>my_ana_pkg</i></b>
  $ ln -s /reg/g/cctbx/sources/cctbx_project/xfel/cxi/cspad_ana src
+
  $ ln -fns <b><i>/path/to/cctbx/sources</i></b>/cctbx_project/xfel/cxi/cspad_ana src
 
  $ cd ..
 
  $ cd ..
$ ln -s /reg/g/cctbx/sources/cctbx_project/xfel/cxi/lsf.sh .
 
 
  $ scons
 
  $ scons
The last step compiles the analysis modules just linked in.
+
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:
+
$ cd ~/myrelease
+
$ sit_setup
+
 
+
== Test the installation ==
+
At SLAC, test that it is working by e.g.
+
$ cd ~/myrelease
+
 
  $ cxi.pyana -c /reg/g/cctbx/tutorials/setup/test.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0004-s00-c00.xtc
 
  $ cxi.pyana -c /reg/g/cctbx/tutorials/setup/test.cfg /reg/d/ana11/cxi/data/Mar2013calib/xtc/e236-r0004-s00-c00.xtc
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.
+
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.
 
+
-->
More specifically, this command starts pyana with a configuration file (-c) and an XTC file.  For more information, see the [[Overview]] and other tutorial pages.
+

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.