I had a little trouble building PyRosetta r46030 64-bit on Linux Mint 13 (Maya) 64-bit. This revision corresponds to PyRosetta v2.011. The problems were easy to fix but since they are currently undocumented*, I thought I would list the problems and solutions here. The main problem I had seems specific to Python 2.6 and certain Ubuntu/Mint distributions so it is no surprise that it is not in the documentation. I include all the steps I took for completeness and add some comments for those new to Linux.
Everything below was tested on Linux Mint 13. However, since Mint closely follows Ubuntu, the solution may also work on Ubuntu 12.04.
Mint 13 comes with Python 2.7.3 so I started by installing Python 2.6.8 as an optional installation. As a general rule of thumb, never overwrite your the default Python installation on your Linux OS as this can mess up your package manager which can mess up your OS (is this true for Mac OS X?). The steps below are specific to Debian distributions e.g. Ubuntu and Mint. For RHEL distributions e.g. CentOS, the steps are similar but 'yum' is used instead of 'apt-get' and some packages are named differently e.g. I believe libbz2-dev is bzip2-devel in RHEL distributions.
Install basic development packages
This list may not be sufficient and necessary for building Python for PyRosetta. Maybe someone can correct me here:
sudo apt-get install build-essential libbz2-dev libncursesw5-dev libreadline-gplv2-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev mysql-client libmysqlclient-dev
If this command fails, remove the failed package(s) from the apt-get command line and try again. Take note of those that failed though in case they are needed. You may need libreadline5-dev instead of libreadline-gplv2-dev.
Determine whether your Linux kernel is 32-bit or 64-bit
Run this command:
If you see x86_64 then you have a 64-bit kernel. Otherwise, it is 32-bit.
Download and build Python 2.6.8 (Python 2.6 is needed for PyRosetta on 64-bit Linux)
Run these commands:
gunzip -c Python-2.6.8.tgz | tar -xvf -
Make a directory where Python 2.6 will be installed
sudo mkdir /opt/python2.6
sudo chown yourusername:yourprimarygroup /opt/python2.6/
If you are using Linux Mint 13 (Maya) or Ubuntu 11.04 then your bz2 library (libbz2.so) may be installed in a non-standard location e.g. /usr/lib/x86_64-linux-gnu and Python 2.6 is not configured to search this path. This may be true for other distributions as well. In this case, you will need the following variable to be set in your environment:
export LDFLAGS="-L/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
We now build Python with options required for PyRosetta:
./configure --prefix=/opt/python2.6 --with-threads --enable-shared --enable-unicode=ucs4
Again, if you are using Linux Mint 13 or Ubuntu 11.04, unset the variable we set above:
Note that we have configured Python to install to /opt/python2.6. This ensures that we leave our existing installation, which may be crucial to the OS, safe. PyRosetta needs the
--enable-shared option (which builds shared libaries) and the
--enable-unicode option. If you have a modern Linux distribution then
--enable-unicode=ucs4 (wide unicode character support) should be the correct option. One forum user needed to use
--enable-unicode=ucs2 to build PyRosetta 1.1 on 32-bit machine but possibly this was due to PyRosetta 1.1 using an older version of Python? If someone knows, please answer below.
Configure the dynamic loader to find the Python 2.6 shared libraries
One way to achieve this is to edit the /etc/ld.so.conf file.
sudo vi /etc/ld.so.conf
Check the man page ('man ld') to check how this file is structured. It may be enough to add this path on a new line in the file:
Enforce the changes.
After following the installation instructions on the PyRosetta website (make sure to run SetPyRosettaEnvironment.sh), you should be able to run:
>> import rosetta
without any errors.
Hope this helps,
* I am not counting the forums as documentation even though the usual problem-solvers do a fantastic job.