## Tuesday, March 15, 2011

### HowTo create the right environment to use PyRosetta on a Linux box

Since one year I have been involved in a project for which I decided to use a program called PyRosetta. From the website: "PyRosetta is an interactive Python-based interface to the powerful Rosetta molecular modeling suite. It enables users to design their own custom molecular modeling algorithms using Rosetta sampling methods and energy functions." The program comes as pre-compiled binaries for various platforms. The Mac version works fine in an out-of-the-box fashion, most likely because my Mac laptop and the small Mac-Mini where I installed PyRosetta are quite up-to-date. Unfortunately these resources are not sufficient to let me use extensively the program, but I had to struggle a lot to be able to use it on the Linux based clusters we have available here at the Department. Here is how I managed.

The Linux 64bit version of PyRosetta didn't run out-of-the-box, just like that. PyRosetta has a user forum that is only now slowly starting to work, so it wasn't easy to access more detailed information. If you don't have root access to your system, or simply you don't want to mess around with the rest of your installation you will need a local installation of gcc, and Python.

Let's suppose you are installing everything in /home/pyuser/programs . You need first to locally install mpc, mpfr and gmp, following the respective instructions. Download then gcc 4.5.2 or newer and tailor configure it from an object directory with:
../gcc-4.5.2/configure --prefix=/home/pyuser/programs --enable-bootstrap --enable-shared --enable-thread=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,fortran --disable-libgcj --with-tune=generic --witharch_32=i586 --build=x86_64-redhat-linux6E --with-gmp=/home/pyuser/programs --with-mpfr=/home/pyuser/programs --with-mpc=/home/pyuser/programs
Then run make and make install. Afterward you will need a local installation of Python 2.6, compiled with the just made gcc. Run the configure command as:
./configure --prefix=/home/pyuser/programs --enable-shared LDFLAGS='"Wl,-rpath /home/pyuser/programs/lib" --enable-unicode=ucs4
The directory /home/pyuser/programs/lib must be already present prior to the configure command, even if empty.

Then run make and make install. Once done, add /home/pyuser/programs, /home/pyuser/programs/bin to $PATH and /home/pyuser/programs/lib, /home/pyuser/programs/lib64 to$LD_LIBRARY_PATH before any other previously present path. You can check if your installation is correct by typing python. The output should look like something similar to this:
Python 2.6.5 (r265:79063, Jan 24 2011, 16:57:13)
[GCC 4.5.2] on linux2
If everything worked fine then you are good to go, just remember to source SetPyRosettaEnvironment.sh.

One final note: these instructions are relative to PyRosetta 1.0. Recently a 2.0 version has been announced as a Beta, based on the recently released version 3.2 of Rosetta. Unfortunately once again the only indications about which are the system requirements consist in "standard linux/Mac distributions".