Skip to content

Building PyRosetta from Source

James Hawley edited this page Aug 7, 2015 · 16 revisions

Following instructions from PyRosetta online documentation. All installs are local to the user.

It is recommended that one uses the default binaries provided by PyRosetta. However, the following scenarios are reasons for installing PyRosetta from source

  • You need to have bindings for your own custom C++ code that is not part of Rosetta master branch
  • PyRosetta needs to run custom-build Python (for example if you would like to use some Python packages from MacPorts, Fink or Homebrew who deploy its own version of Python)
  • You need to use a different version of Python
  • You can't install GLIBC required by pre-build binaries
  • You are running on a 32Bit system

Deploying PyRosetta Build Environment

Dependencies

Rosetta Source

Download Academic Version of Rosetta software, and extract the archive

tar xvzf rosetta_bin_linux_####.##.#####_bundle.tgz ~/rosetta_bin_linux

To easily install all of the following dependencies, run the following:

cd rosetta_bin_linux/
cd tools/PyRosetta.develop/
./DeployPyRosetta.py

This should take some time. If at the end everything installs correctly, skip to Building PyRosetta. Otherwise, keep reading the following subsections.

Python

Install Python >= 2.5. Most systems come with this installed, but if not, head to https://www.python.org/

CMake

Like Python, most systems have this installed by default. Install Cmake from here if not

./bootstrap --prefix=~/Applications/
make
make install

GCCXML

mkdir gccxml-cvs
cd gccxml-cvs
cvs -d :pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co -D 2009-04-15 gccxml
mkdir gccxml-build
cd gccxml-build
cmake ../gccxml -DCMAKE_INSTALL_PREFIX:PATH=~/Applications/

make && make install

PyGCCXML and Py++

Download PyGCCXML and Py++ archives from SourceForge, and extract the zip file.

unzip pygccxml-1.0.0.zip
cd pygccxml-1.0.0
python setup.py install --user
cd ..
unzip Py++-1.0.0.zip
cd Py++-1.0.0
python setup.py install --user

Check that all of the above are installed correctly

python
>>> import pygccxml, pyplusplus
>>> print pygccxml.__version__, pyplusplus.__version__

If installed correctly, the output is

1.0.0 1.0.0

LibBoost

Install Boost (download from http://boost.org or http://sourceforge.net/projects/boost/files/boost/). Most Linux distributions will come with boost. If so, skip to the next step. If not, run the following commands

tar xvzf boost_1_58_0.tar.gz
cd boost_1_58_0/
./bootstrap.sh --prefix=/home/<username>/Applications/
./b2 install --prefix=/home/<username>/Applications/

In the bootstrap command, the prefix must be an absolute path

Building Rosetta

Test the installation by navigating to ~/rosetta_bin_linux/main/source/src/python/bindings/ and run

./BuildBindings.py -I ~/Applications/include -L ~/Applications/lib -L ~/./local/lib

(This takes a very long time, there are lots of files to build)

Building PyRosetta

After successfully deploying PyRosetta build environment copy generated BuildPyRosetta.sh in to main Rosetta source dir: /rosetta/main/source/BuildPyRosetta.sh and run it within this dir in order to build PyRosetta.

Clone this wiki locally