Difference between revisions of "Source Code"

From Phaserwiki
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
===Repository===
 +
 +
A public [https://git.csx.cam.ac.uk/x/cimr-phaser/phaser.git/summary Phaser git repository] is available for '''git clone''' and '''git pull''' only. This mirrors commits to the Phaser SVN respository in real time
 +
 +
The [http://www-structmed.cimr.cam.ac.uk/svn-cgi-bin/viewvc.cgi/ 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===
 
===Access===
  
Phaser code is open source. Code development is managed by [http://subversion.apache.org subversion] (SVN)
+
*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 | 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 | Licences for Phaser]], provided they are for internal use only. Distribution would require those changes to be incorporated into our SVN repository.  
  
*If you are interested in having access to the latest version of Phaser while developing pipelines, or just looking at the latest source code, you can download recent nightly builds of Phenix, which always contain the latest version of Phaser that has passed regression tests. For these purposes, you probably wouldn't need svn access.
+
===Full Access===
  
*If you would like to be kept informed of svn changes as they are committed, we can add your email addess to our svn commit email notification group, without you needing to have full svn access.
+
*Requests for permission to commit to the SVN repository via SSH should emailed to [mailto:cimr-phaser@lists.cam.ac.uk phaser-help]
  
*However, if you want to modify Phaser, then the University of Cambridge's [[ Licences | Licences for Phaser]] allow modification for internal use only. The only way that any changes could be distributed to anyone else would be for those changes to be incorporated into our svn repository. Please email to [mailto:cimr-phaser@lists.cam.ac.uk phaser-help] for further advice if you would like to modify the phaser source code.
 
  
===Repository===
+
===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 development svn repository is located at phaser-svn.cimr.cam.ac.uk.
+
====Building from an existing CTBX Installation====
 +
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:
 +
#Change directory to the modules/ folder within the CCTBX installation. Then do <pre>git clone git://git.uis.cam.ac.uk/cimr-phaser/phaser.git </pre>
 +
#Change directory to the build/ folder within the CCTBX installation
 +
#Delete all files and folders except '''config_modules.sh''' or '''config_modules.cmd'''
 +
#Edit '''config_modules.sh''' or '''config_modules.cmd''' script to like:
 +
#:*'''Linux or MacOS''':
 +
#:<pre>#!/bin/sh &#10;python ../modules/cctbx_project/libtbx/configure.py phaser --enable_openmp_if_possible=True</pre>
 +
#:*'''Windows using Microsoft VC++ 9.0'''
 +
#:<pre>python ..\modules\cctbx_project\libtbx\configure.py phaser --enable_openmp_if_possible=True</pre>
 +
#:*'''Windows using MinGW-W64 5.3.0'''
 +
#:<pre>python ..\modules\cctbx_project\libtbx\configure.py phaser --enable_openmp_if_possible=True --compiler=mingw --static_exe</pre>
 +
#Execute the '''config_modules.sh''' or '''config_modules.cmd''' script.
 +
#On Linux or MacOS source the file '''setpaths.sh''', on Windows execute the file '''setpaths.bat'''
 +
#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).
  
:'''View the [http://www-structmed.cimr.cam.ac.uk/svn-cgi-bin/viewvc.cgi/ Phaser SVN repository] online'''
+
====Bootstrap build of Phaser====
 +
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: <pre>python bootstrap.py --builder=phaser --nproc=8</pre> 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.
  
:''Viewing the Phaser SVN respository online is password restricted in order to manage IT security. Please email requests for the password to [mailto:cimr-phaser@lists.cam.ac.uk phaser-help].''
 
  
===Mirrors===
+
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.
  
*The Berkeley mirror at cci.lbl.gov is updated at midnight Berkeley time
+
===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 <pre>source build/setpaths.sh</pre> or on Windows <pre>build\setpaths.bat.</pre> From then on you can invoke python with the command <pre>cctbx.python</pre> and run scripts such as [[Python_Example_Scripts]]
  
:/net/cci/auto_build/repositories/phaser
+
===Nightly builds Regression Tests ===
 +
Regression tests of nightly builds are present on http://www-structmed.cimr.cam.ac.uk/Local/PhaserNightly/contents.html

Revision as of 16:24, 3 October 2018

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.

Building from an existing CTBX Installation

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).

Bootstrap build of Phaser

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

Nightly builds Regression Tests

Regression tests of nightly builds are present on http://www-structmed.cimr.cam.ac.uk/Local/PhaserNightly/contents.html