Ha14 installation: Difference between revisions

From cctbx_xfel
Jump to navigation Jump to search
(Move creation of cxi_user to source extraction.)
m (Add comment about the disabled labelit bundle downloads.)
Line 20: Line 20:
  $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz
  $ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz
  $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz
  $ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz
Note: new bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation. <!-- This should probably be some kind of warning box, see http://www.mediawiki.org/wiki/Template:Mbox -->
Note: new bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation. <!-- This should probably be some kind of warning box, see http://www.mediawiki.org/wiki/Template:Mbox XXX Note also that downloads of the labelit bundle are intentionally "disabled". -->


Extract the sources:
Extract the sources:
Line 31: Line 31:
  $ echo "from xfel.mono_simulation.mono_treatment import post_outlier_rejection" > cxi_user/__init__.py
  $ echo "from xfel.mono_simulation.mono_treatment import post_outlier_rejection" > cxi_user/__init__.py
  $ echo "from xfel.mono_simulation.mono_treatment import pre_get_predictions" >> cxi_user/__init__.py
  $ echo "from xfel.mono_simulation.mono_treatment import pre_get_predictions" >> cxi_user/__init__.py


== Configure the source tree ==
== Configure the source tree ==

Revision as of 21:20, 4 February 2014

IMPORTANT: installing cctbx.xfel is not necessary for most users, as cctbx.xfel is installed at SLAC already and is generally accessible. General users should instead go to setup to configure their unix account at SLAC to run cctbx.xfel.

Note that in this text $ denotes the prompt of any unprivileged user on the system. Certain shells may be configured to use % or > for that purpose. The user prompt is distinct from #, which denotes the prompt of the superuser. This installation can be performed by any regular user, no root superuser are required.

Prerequisite: install and set up the PSDM suite

See Set up PSDM software. It is assumed that ana_env.sh or ana_env.csh has been sourced, a release directory has been configured in ~/myrelease or ~/analisys-rel, and that an empty analysis package has been set up in ~/myrelease/my_ana_pkg or ~/analisys-rel/my_ana_pkg


Download and extract cctbx and LABELIT source bundles

This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of e.g. psexport pool do. In what follows, the absolute path /path/to/cctbx/directory should be replaced with something more appropriate. The directory should accessible everywhere cctbx.xfel is to be run.

$ mkdir /path/to/cctbx/directory
$ cd /path/to/cctbx/directory
$ wget http://cci.lbl.gov/cctbx_build/results/2013_08_13_0005/cctbx_bundle.tar.gz
$ wget http://cci.lbl.gov/~hattne/labelit/labelit_bundle_20130814.tar.gz

Note: new bundles are automatically prepared nightly. It is, however, not advisable to automatically update from the latest bundle. Please check with the program authors before upgrading a critical installation.

Extract the sources:

$ mkdir cctbx_project
$ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1
$ tar -xpvzf labelit_bundle_20130814.tar.gz

Add the cxi_user directory and its __init__.py module. This defines the default integration algorithm used by cctbx.xfel.

$ mkdir cxi_user
$ echo "from xfel.mono_simulation.mono_treatment import post_outlier_rejection" > cxi_user/__init__.py
$ echo "from xfel.mono_simulation.mono_treatment import pre_get_predictions" >> cxi_user/__init__.py

Configure the source tree

This next two steps require access to a C++ compiler and a Python interpreter, any minor version between 2.5 and 2.7. At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable via psanacs, do. The Python interpreter used to configure the source tree must be the same interpreter the PSDM suite uses. That interpreter can be located using find(1), e.g.

$ find $SIT_ROOT -executable -name python -type f

At SLAC this interpreter is located somewhere under /reg/g/psdm/sw/external/python. Then create and initialize the build directory and compile the sources using the appropriate Python interpreter.

$ mkdir cctbx_build
$ cd cctbx_build
$ python ../cctbx_project/libtbx/configure.py xfel

where python should be substituted with output of the previous find(1) command.

Now, initialise the running shell using the newly created configuration files. bash(1)-users should do

$ . setpaths.sh

while csh(1)-users should instead run

$ source setpaths.csh

Compile the sources

$ make
$ make

On SLAC's interactive nodes, this takes just over 6 minutes.

Edit shell configuration files

To make the changes to the environment persistent, bash(1) users are encouraged to add these lines to ~/.bashrc

test -r "/path/to/cctbx/directory/cctbx-build/setpaths.sh" && \
 . "/path/to/cctbx/directory/cctbx-build/setpaths.sh"

csh(1) users should instead add these lines to ~/.cshrc

test -r "/path/to/cctbx/directory/cctbx-build/setpaths.csh" && \
 source "/path/to/cctbx/directory/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.

Link cctbx.xfel modules to the PSDM suite.

$ cd ~/myrelease/my_ana_pkg
$ ln -s /path/to/cctbx/directory/cctbx_project/xfel/cxi/cspad_ana src
$ cd ..
$ scons

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.