Rosetta  2021.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PyRosetta 4

Building with external Rosetta libraries

PyRosetta may be linked against externally compiled Rosetta shared libraries. This may be used to suppport "extras" builds or debug builds of the shared libraries with release-mode bindings. To support external links, configure & build via cmake and clang, then specify --external-link to

For example: ``` export CC=which clang export CXX=which clang++`

cd git rev-parse --show-toplevel

pushd source/cmake ./ all

pushd build_debug cmake -G ninja && ninja

popd popd

pushd source/src/python/PyRosetta python –external-link debug ````

Building PyRosetta under Anaconda python

If you use Anaconda python ( and would like to use it to build PyRosetta, you will need to make the build system aware of the location of the appropriate C headers and library. These values are specified using the python-include-dir and python-lib command line flags when calling For example, if Anaconda 3 is installed in the default location, the command to run would be:

python -jX --python-include-dir=$HOME/anaconda3/include/python3.5m --python-lib=$HOME/anaconda3/lib/libpython3.5m.dylib

where X is the number of jobs to parallelize the build over.

Bootstrap PyRosetta Development Environment

An existing PyRosetta build can be used to bootstrap a development environment for python-level development. The bootstrap process will (a) reset the work tree to match the source binary version and (b) copy the source binary compiled module and database into the PyRosetta src directory.

To bootstrap into a conda-based development environment:


Create and activate a development environment.

conda create -n pyrosetta-dev python=3.6 conda activate pyrosetta-dev

Install pyrosetta, optionally specifying a target development version.

conda install -c rosettacommons pyrosetta

Copy binary and reset tree to the prebuilt version.


Replace conda package with development-mode install of working tree.

conda remove pyrosetta && pushd src && python develop ```

The bootstrap process resets the git working tree to the prebuilt version in a detached HEAD state. To begin development create a feature branch git checkout -b user/py_feature. If you have already created commits on a existing branch your git HEAD will no longer point to this branch.

You can recover this initial work post-bootstrap by checkout, cherry-pick, or rebase. Assuming you were on an branch pre-bootstrap: