Periodically the most recent cctbx source code including all its dependencies is automatically exported from the source code databases (SVN, CVS) and bundled into self-extracting files that are published at:
This web page also provides self-extracting binary distributions for a variety of platforms. It is most convenient to use these binary bundles if possible. Installation is very simple and fast. The minimal instructions are shown at the download page.
Source code bundles are available if a binary distribution cannot be used. Under Unix, if Python 2.2.1 or higher is pre-installed on the target platform, the smaller cctbx_bundle.selfx can be. However, in general it will be best to download the cctbx_python_*_bundle.selfx file because the installation script will automatically install Python before proceeding with the installation of the cctbx modules.
The Unix bundles include a file cctbx_install_script.csh. This script is known to work with the following compilers:
- Linux: any gcc >= 3.0
- Tru64 Unix: cxx 6.5 or cxx 7.1
- IRIX: CC 7.41
- Mac OS 10.3 and OS 10.4 with Apple's compiler
Other Unix platforms will most likely require adjustments of the build scripts.
The self-extracting source code bundle for Windows (cctbx_bundle.exe) does not include an installation script.
Please note: The following instructions are for developers! The self-extracting (.selfx) source bundles perform all the steps automatically.
Building from sources requires Python 2.2.1 or higher and a suitable C++ compiler (see above). If Python is not available already it can be installed in the following way:
gunzip -c Python-2.5.1.tar.gz | tar xf - cd Python-2.5.1 ./configure --prefix=/your/choice make make install
This installation does not require a privileged account (e.g. root). It may be convenient (but is not required) to add the directory /your/choice/bin to the command-line search PATH, e.g. using csh:
set path=(/your/choice/bin $path)
The most recent, complete cctbx source code is available in the file cctbx_bundle.tar.gz published at the cctbx build page. To unpack this file in a new, empty directory:
gunzip -c cctbx_bundle.tar.gz | tar xf -
This creates a subdirectory cctbx_sources. The installation procedure should be executed in another directory, e.g.:
mkdir cctbx_build cd cctbx_build /your/choice/bin/python ../cctbx_sources/libtbx/configure.py mmtbx
The last command initializes the cctbx_build directory and creates a file setpaths.csh (among others). This file must be used to initialize a new shell or process with the cctbx settings:
source setpaths.csh
Shells other than csh may require a different command.
To compile all cctbx modules enter:
libtbx.scons
On a machine with multiple CPUs enter:
libtbx.scons -j N
where N is the number of CPUs available. The time required for the compilations scales linearly with the number of CPUs available.
libtbx.scons is similar to the more familar make command, only much more versatile. libtbx.scons is a thin wrapper around SCons. The SCons documentation applies without modification.
To run some regression tests after the compilation is finished enter:
source setpaths_all.csh libtbx.python $SCITBX_DIST/run_tests.py libtbx.python $CCTBX_DIST/run_tests.py --Quick
The output should show many OK. A Python Traceback is an indicator for problems.
The cctbx installation requires Visual C++ 7.1 (Visual Studio .NET 2003) or Visual C++ 8.0 (Visual Studio .NET 2005).
To install Python under Windows 2000 it is best to use a binary installer from the Python download page. The default choices presented by the installation wizard are usually fine.
The most recent, complete cctbx source code is available in the self-extracting file cctbx_bundle.exe published at the cctbx build page. To unpack this file in a new, empty directory simply enter:
cctbx_bundle.exe
This creates a subdirectory cctbx_sources. The installation procedure should be executed in another directory, e.g.:
mkdir cctbx_build cd cctbx_build C:\python25\python.exe ..\cctbx_sources\libtbx\configure.py mmtbx
The last command initializes the cctbx_build directory and creates a file setpaths.bat (among others). This file must be used to initialize a new shell or process with the cctbx settings:
setpaths.bat
To compile all cctbx modules enter:
libtbx.scons
On a machine with multiple CPUs enter:
libtbx.scons -j N
where N is the number of CPUs available. The time required for the compilations scales linearly with the number of CPUs available.
libtbx.scons is similar to the more familar make command, only much more versatile. libtbx.scons is a thin wrapper around SCons. The SCons documentation applies without modification.
To run some regression tests after the compilation is finished enter:
setpaths_all.bat libtbx.python %SCITBX_DIST%\run_tests.py libtbx.python %CCTBX_DIST%\run_tests.py --Quick
The output should show many OK. A Python Traceback is an indicator for problems.
Optionally, the iotbx module can be linked against the CBF library (P. Ellis & H. Bernstein) to support detector images written in CBF format. Download the CBF library, version 0.7.8.1 or above, from this Web page .
When compiling from sources, CBF support is contingent on the correct placement of the CBFlib source tree. Under Unix, run this command to unpack the CBFlib sources in cctbx_sources:
libtbx.unpack_in_sources CBFlib_0.7.8.tar.gz
Within the cctbx_sources directory, link the new source package as follows:
ln -s CBFlib_0.7.8 cbflib
Under Windows, unpack the CBFlib source distribution manually followed by:
rename CBFlib_0.7.8 cbflib
Now switch to the build directory, then reconfigure and recompile:
libtbx.configure mmtbx libtbx.scons
Objects for reading CBF-formatted files are defined in the iotbx.detectors package.
To participate in the development of the cctbx modules or to get easy access to the most recent changes it may be useful to checkout some modules directly from the SVN databases maintained at Sourceforge.
To replace the modules extracted from a source code bundle:
cd cctbx_sources set modules=(libtbx boost_adaptbx omptbx scitbx chiltbx cctbx cbflib_adaptbx iotbx mmtbx clipper_adaptbx) rm -rf $modules libtbx.sourceforge_checkout cctbx $modules
To recompile run the libtbx.scons command again (source setpaths.csh or run setpaths.bat first if necessary).
It is also possible to replace the boost directory from a cctbx source code bundle with a working copy of the boost SVN tree . However, many Boost developers do not have access to all platforms for testing. In practice it sometimes happens that a svn update of the boost tree leads to compilation errors on one platform or another. Therefore we believe that most users are best served by the tested boost libraries included in the cctbx source code bundles.
The source code in the ccp4io_502_cci module is kindly provided by CCP4. We feel that it is not appropriate to keep this code in a SVN tree on Sourceforge.