Source Code

From Phaserwiki
Jump to: navigation, search

Repository

A public Phaser git repository is available for git clone and git pull only. This mirrors commits to the Phaser SVN respository in real time

The Phaser SVN repository is located in Cambridge on the CIMR server (password restricted)

The Berkeley mirror at cci.lbl.gov is updated at midnight Berkeley time

/net/cci/auto_build/repositories/phaser

Access

  • You can download nightly builds of Phenix (binaries), which contain the latest version of Phaser that has passed regression tests
  • You can compile code with real-time updates from the git repository. This code may not pass regression tests. The git repository is best used for obtaining instant bugfixes, after communication with one of the Phaser developers
  • If you are developing a pipeline using Phaser, we are keen to work with you to add features, fix bugs and help you use Phaser optimally
  • Note the University of Cambridge's Licences for Phaser with regards to making Phaser part of a pipeline available online
  • Source code modifications are allowed under the University of Cambridge's Licences for Phaser, provided they are for internal use only. Distribution would require those changes to be incorporated into our SVN repository.

Full Access

  • Requests for permission to commit to the SVN repository via SSH should emailed to phaser-help


Building Phaser from source

Phaser can be built as an executable file for the platforms Linux, MacOS, Windows (using VC++ 9.0) and Windows (using g++ in MinGW-W64). It can also be built as python modules useful for python scripting. There are two ways to achieve this.


The quick way is to start from an existing installation of CCTBX (available from http://cci.lbl.gov/cctbx_build/) to allow building the Phaser executable. Install CCTBX for the desired platform on your system first. For MinGW-W64 use the Windows build of CCTBX. Assuming python2.7 is present on your system Phaser can be built from a CCTBX installation with the following steps from a Bash shell or a Windows command prompt:

  1. Change directory to the modules/ folder within the CCTBX installation. Then do
    git clone git://git.uis.cam.ac.uk/cimr-phaser/phaser.git 
  2. Change directory to the build/ folder within the CCTBX installation
  3. Delete all files and folders except config_modules.sh or config_modules.cmd
  4. Edit config_modules.sh or config_modules.cmd script to like:
    • Linux or MacOS:
    #!/bin/sh 
    python ../modules/cctbx_project/libtbx/configure.py phaser --enable_openmp_if_possible=True
    • Windows using Microsoft VC++ 9.0
    python ..\modules\cctbx_project\libtbx\configure.py phaser --enable_openmp_if_possible=True
    • Windows using MinGW-W64 5.3.0
    python ..\modules\cctbx_project\libtbx\configure.py phaser --enable_openmp_if_possible=True --compiler=mingw --static_exe
  5. Execute the config_modules.sh or config_modules.cmd script.
  6. On Linux or MacOS source the file setpaths.sh, on Windows execute the file setpaths.bat
  7. On Linux or MacOS do libtbx.scons -j nproc exe/phaser, on Windows do libtbx.scons -j nproc exe\phaser.exe. Here nproc is the number of available CPUs to do the compilation. This will produce the Phaser executable within the build/exe directory. If Phaser python modules are also desired then omit the exe/phaser or exe\phaser.exe argument (does not apply to a MinGW-W64 build unless the installed version of your CCTBX was built for MinGW-W64).


A simpler but slower way to build Phaser is to run a "bootstrap build". Download the file bootstrap.py (as detailed on https://github.com/cctbx/cctbx_project#installation ) to where you want to build phaser. Assuming that python 2.7 and the compiler is available from the PATH environment variable now run the command:
python bootstrap.py --builder=phaser --nproc=8
from a command prompt or bash shell. This will build a stripped down version of CCTBX in addition to Phaser and its python modules. The Phaser executable is located in the directory build/exe.


The steps to build Phaser change from time to time as the developments of required components like CCTBX are moving targets. The steps outlined here may therefore differ from the actual ones at short or no notice.

Using Phaser from Python

Having compiled Phaser as above Phaser can now be accessed from the python interpreter that is part of CCTBX. To invoke it on Linux or MacOS it is necessary first to execute
source build/setpaths.sh
or on Windows
build\setpaths.bat.
From then on you can invoke python with the command
cctbx.python
and run scripts such as Python_Example_Scripts