Ha14 installation: Difference between revisions

From cctbx_xfel
Jump to navigation Jump to search
(Unified prerequisites for regular users and developers.i)
m (Aaron moved page Installation to Ha14 installation: deprecated installation instructions)
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Prerequisite: install and set up the PSDM suite ==
== Prerequisites ==


It is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Developers may additionally want to [[Set up ssh-agent | set up an ssh-agent]].  Note again that several sites already have ''cctbx.xfel'' installed, and that this step can be skipped for regular users not involved in the development of the software.  Once ''cctbx.xfel'' has been installed it must be [[Setup | set up]] before it can be used.
While these tutorials assume you wish to process XTC streams at SLAC, some users have stills collected from other sources and do not need the full PSDM suite.  If this is the case, see the installation directions below for installing on a non PSDM system.  Otherwise, it is assumed that the [[Set up PSDM software | PSDM software distribution has been set up]].  Note again that several sites already have ''cctbx.xfel'' installed, and so regular users not involved in the development of the software will not need the instructions here.


== Download and extract a source tree ==
Once ''cctbx.xfel'' has been installed it must be [[Setup | set up]] before it can be used.  Developers may additionally want to [[Set up ssh-agent | set up an ssh-agent]]. 


This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of <i>e.g.</i> psexport pool do. In what follows, the absolute path <code><b><i>/path/to/cctbx/sources</i></b></code> should be replaced with something more appropriate (a site-wide install will benefit from a location on a shared disk, whereas <code>~/projects/phenix-src</code> is a common choice among developers).  The directory must accessible everywhere ''cctbx.xfel'' is to be run.
Finally, you must have a user account on cci.lbl.gov in order to proceed, or else you will not be able to download the sources. A sourceforge account is only needed if you wish to commit changes back to the repository. If you don't have or don't want to use a sourceforge account, you can leave it off in the below commands where it is specified.


=== Regular users ===
== Standard installation using PSDM  ==
$ mkdir -p <b><i>/path/to/cctbx/sources</i></b>
===Quick start===
$ cd <b><i>/path/to/cctbx/sources</i></b>
This step has to be performed on a host with Internet access. Not all hosts at SLAC have that, but the members of <i>e.g.</i> pslogin pool do. Make and change to a working directory to contain the new source code and build (this directory should be accessible from any computing nodes ''cctbx.xfel'' will be run. Then download these bootstrap modules:
$ 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
$ mkdir cctbx_project
$ tar -xpvzf cctbx_bundle.tar.gz -C cctbx_project --strip-components=1
$ tar -xpvzf labelit_bundle_20130814.tar.gz


<!-- XXX Nightly bundles are stored in /net/cci/auto_build/cctbx/results -->
  wget https://raw.githubusercontent.com/cctbx/cctbx_project/master/libtbx/auto_build/bootstrap.py


{{ mbox
Then:
| type = speedy
| text = 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.  Also note that the labelit_bundle cannot currently be downloaded.
}}


=== Developers ===
  python bootstrap.py hot update --builder=xfel --cciuser=<cciusername> --sfuser=<githubusername>
<!-- XXX Why is this PHENIX when we really want cctbx.xfel -->
A user account on cci.lbl.gov is required, the name of which is to be substituted for <code><b><i>user</i></b></code> below.
$ mkdir -p <b><i>/path/to/cctbx/sources</i></b>
$ cd <b><i>/path/to/cctbx/sources</i></b>
$ svn export svn+ssh://<b><i>user</i></b>@cci.lbl.gov/phenix_regression/trunk/phenix_svn_getting_started.csh
$ ./phenix_svn_getting_started.csh <b><i>user</i></b>
$ rm phenix_svn_getting_started.csh


This command instructs bootstrap.py to download static packages required for ''cctbx.xfel'' (hot), and then to checkout the rest of the sources from cci.lbl.gov and github (update), using the user accounts specified by the cciuser and sfuser parameters, respectively.


== Create the <code>cxi_user</code> directory ==
===Alternate instructions for non-LBNL developers===
Our non-LBNL colleagues will now realize that the "python bootstrap" step does not work without cci username credentials, needed to obtain source code for the program LABELIT.  Developers are instructed to use the following alternate procedure:


Add the <code>cxi_user</code> directory and its <code>__init__.py</code> module.  This defines the default integration algorithm used by ''cctbx.xfel''.
  python bootstrap.py hot --builder=xfel --sfuser=<githubusername> # download the static packages
$ mkdir cxi_user
  python bootstrap.py update --builder=dials --sfuser=<githubusername> # download the github code for dials & cctbx
  $ cat > cxi_user/__init__.py << EOF
  mkdir modules/cxi_xdr_xes # create a stub directory for experiment-specific python code
from xfel.mono_simulation.mono_treatment import post_outlier_rejection
   
  from xfel.mono_simulation.mono_treatment import pre_get_predictions
Then download phenix from http://phenix-online.org and untar the packageLocate the modules directory in the phenix directory tree, and copy-paste the labelit subdirectory into the modules directory of your current working area.
EOF


== Configure the source tree ==
===Finish up the build===
To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the next step must be the one provided by the PSDM software distribution.  That interpreter can be located using find, <i>e.g.</i>
After downloading the sources, you need to be sure you have the appropriate compilers before executing the next command.  At SLAC, that means you need to ssh to one of the psana nodes, as the pslogin nodes do not have the requisite compilers.  When ready, configure and compile thusly:
 
  python bootstrap.py build --builder=xfel --with-python=`which python` --nproc=<# cores available for compile>
 
On SLAC's interactive nodes, this takes just over 6 minutes. To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the above command must be the one provided by the PSDM software distribution.  That interpreter can be located using find, <i>e.g.</i>
  $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename "*/$SIT_ARCH/*/python" 2> /dev/null
  $ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename "*/$SIT_ARCH/*/python" 2> /dev/null
At SLAC this interpreter is located somewhere under <code>/reg/g/psdm/sw/external/python</code>.  Then create and initialize the build directory, <code><b><i>/path/to/cctbx/build</i></b></code> below, using the Python interpreter located using the above find commandThe build directory is often located next to the source directory (<code>~/projects/phenix-build</code> is a common developer choice).
At SLAC this interpreter is located somewhere under <code>/reg/g/psdm/sw/external/python</code>.  Here we use `which python` to get this path automatically. 
 
Initialise the running shell using the newly created configuration filesbash-users should
$ . build/setpaths.sh
while csh-users will instead need to run
% source build/setpaths.csh


=== Regular users ===
To finalize the installation, see [[Setup]].
$ mkdir -p <b><i>/path/to/cctbx/build</i></b>
$ cd <b><i>/path/to/cctbx/build</i></b>
$ <b><i>python</i></b> <b><i>/path/to/cctbx/sources</i></b>/cctbx_project/libtbx/configure.py xfel


=== Developers ===
Note, you may also follow this procedure if you are on a machine where you have your own python that you want to use, instead of the one provided by PSDM.
$ mkdir -p <b><i>/path/to/cctbx/build</i></b>
$ cd <b><i>/path/to/cctbx/build</i></b>
$ <b><i>python</i></b> <b><i>/path/to/cctbx/sources</i></b>/cctbx_project/libtbx/configure.py cxi_xdr_xes labelit_regression phenix xfel
<!-- XXX at NERSC, it’s installed at /project/projectdirs/lcls XXX Note that we may require tntbx for singular value decomposition. -->


== Installation on a non-PSDM system ==


== Compile the sources ==
If you find yourself on a machine without PSDM and won't be dealing with XTC directly, for example if you have your own data collected as stills from a non-XFEL source, you can use the below commands in a new directory (again assuming you have a cci user account):


Initialise the running shell using the newly created configuration files. bash-users should
  # On Linux:
$ . setpaths.sh
  wget https://raw.githubusercontent.com/cctbx/cctbx_project/master/libtbx/auto_build/bootstrap.py
while csh-users will instead need to run
  # On MacOSX:
  % source setpaths.csh
  curl https://raw.githubusercontent.com/cctbx/cctbx_project/master/libtbx/auto_build/bootstrap.py > bootstrap.py
 
  python bootstrap.py hot update base build --builder=xfel --cciuser=<cciusername> --sfuser=<sourceforgeusername>
 
Here, in addition to hot, update and build, there's a command called 'base', which downloads a python and needed packages and compiles it. After this process completes, source the installation (for details see above), and then add scipy to it:
 
  . build/setpaths.sh
  libtbx.python -m easy_install scipy


The next step requires a C++ compiler.  At SLAC, the members of the psexport pool do not have any compilers installed, but the interactive nodes, reachable <i>via</i> psanacs, do. 
Please contact the authors if with any issuesSome gotchas:
$ cd <b><i>/path/to/cctbx/build</i></b>
$ make
On SLAC's interactive nodes, this takes just over 6 minutesTo finalize the installation, see [[Setup]].


<!-- It used to be necessary to run make twice, but that seems to no longer be the caseXXX Maybe should include a bit on running the regression tests here? -->
1) On a Mac, you will need to make sure you have the latest version of xcode installedConsider the command xcode-select --install. [NOTE: Xcode v. 8.2.1. for Mac OS 10.12 (Sierra) does not include a gFortran compiler. You will need to install gFortran separately if you need scipy.]


2) On linux you will likely need to install some dependencies, including gFortran. [Note: gFortran is needed only for the scipy installation, not for the core build based on cctbx.  Therefore, only install gFortran if you need scipy.]


== External links ==
== External links ==
Line 80: Line 74:


<!-- POSSBILE ADDITIONS:
<!-- POSSBILE ADDITIONS:
HOW TO KEEP UP TO DATE (links to psdm page, links to developers page: these pages assemble all the information in one place).


COMMON PITFALLS:
COMMON PITFALLS:

Latest revision as of 23:13, 6 November 2018

Prerequisites

While these tutorials assume you wish to process XTC streams at SLAC, some users have stills collected from other sources and do not need the full PSDM suite. If this is the case, see the installation directions below for installing on a non PSDM system. Otherwise, it is assumed that the PSDM software distribution has been set up. Note again that several sites already have cctbx.xfel installed, and so regular users not involved in the development of the software will not need the instructions here.

Once cctbx.xfel has been installed it must be set up before it can be used. Developers may additionally want to set up an ssh-agent.

Finally, you must have a user account on cci.lbl.gov in order to proceed, or else you will not be able to download the sources. A sourceforge account is only needed if you wish to commit changes back to the repository. If you don't have or don't want to use a sourceforge account, you can leave it off in the below commands where it is specified.

Standard installation using PSDM

Quick start

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. pslogin pool do. Make and change to a working directory to contain the new source code and build (this directory should be accessible from any computing nodes cctbx.xfel will be run. Then download these bootstrap modules:

 wget https://raw.githubusercontent.com/cctbx/cctbx_project/master/libtbx/auto_build/bootstrap.py

Then:

 python bootstrap.py hot update --builder=xfel --cciuser=<cciusername> --sfuser=<githubusername>

This command instructs bootstrap.py to download static packages required for cctbx.xfel (hot), and then to checkout the rest of the sources from cci.lbl.gov and github (update), using the user accounts specified by the cciuser and sfuser parameters, respectively.

Alternate instructions for non-LBNL developers

Our non-LBNL colleagues will now realize that the "python bootstrap" step does not work without cci username credentials, needed to obtain source code for the program LABELIT. Developers are instructed to use the following alternate procedure:

 python bootstrap.py hot --builder=xfel --sfuser=<githubusername> # download the static packages
 python bootstrap.py update --builder=dials --sfuser=<githubusername> # download the github code for dials & cctbx
 mkdir modules/cxi_xdr_xes # create a stub directory for experiment-specific python code

Then download phenix from http://phenix-online.org and untar the package. Locate the modules directory in the phenix directory tree, and copy-paste the labelit subdirectory into the modules directory of your current working area.

Finish up the build

After downloading the sources, you need to be sure you have the appropriate compilers before executing the next command. At SLAC, that means you need to ssh to one of the psana nodes, as the pslogin nodes do not have the requisite compilers. When ready, configure and compile thusly:

 python bootstrap.py build --builder=xfel --with-python=`which python` --nproc=<# cores available for compile>

On SLAC's interactive nodes, this takes just over 6 minutes. To avoid problems with run-time dynamic linking of Python extensions, the Python interpreter required for the above command must be the one provided by the PSDM software distribution. That interpreter can be located using find, e.g.

$ find $SIT_ROOT/sw/external/python -perm /0111 -type f -wholename "*/$SIT_ARCH/*/python" 2> /dev/null

At SLAC this interpreter is located somewhere under /reg/g/psdm/sw/external/python. Here we use `which python` to get this path automatically.

Initialise the running shell using the newly created configuration files. bash-users should

$ . build/setpaths.sh

while csh-users will instead need to run

% source build/setpaths.csh

To finalize the installation, see Setup.

Note, you may also follow this procedure if you are on a machine where you have your own python that you want to use, instead of the one provided by PSDM.

Installation on a non-PSDM system

If you find yourself on a machine without PSDM and won't be dealing with XTC directly, for example if you have your own data collected as stills from a non-XFEL source, you can use the below commands in a new directory (again assuming you have a cci user account):

 # On Linux:
 wget https://raw.githubusercontent.com/cctbx/cctbx_project/master/libtbx/auto_build/bootstrap.py
 # On MacOSX:
 curl https://raw.githubusercontent.com/cctbx/cctbx_project/master/libtbx/auto_build/bootstrap.py > bootstrap.py
 python bootstrap.py hot update base build --builder=xfel --cciuser=<cciusername> --sfuser=<sourceforgeusername>

Here, in addition to hot, update and build, there's a command called 'base', which downloads a python and needed packages and compiles it. After this process completes, source the installation (for details see above), and then add scipy to it:

 . build/setpaths.sh
 libtbx.python -m easy_install scipy

Please contact the authors if with any issues. Some gotchas:

1) On a Mac, you will need to make sure you have the latest version of xcode installed. Consider the command xcode-select --install. [NOTE: Xcode v. 8.2.1. for Mac OS 10.12 (Sierra) does not include a gFortran compiler. You will need to install gFortran separately if you need scipy.]

2) On linux you will likely need to install some dependencies, including gFortran. [Note: gFortran is needed only for the scipy installation, not for the core build based on cctbx. Therefore, only install gFortran if you need scipy.]

External links