Saturday, April 18, 2009

Eclipse with Python/OEChem

Eclipse is an excellent IDE. Alas it doesn't have support for Python - fear not the PyDev plugin comes to the rescue. (Installation information here).

While that now works like a charm, if you have an OpenEye license to hand (academics see this post) if would be great to use the Python toolkit through Eclipse.

Follow these steps to make your Python project OEChem ready:

Window > Preferences > Pydev > Interpreter - Python.
To Libraries add your $OE_DIR/python folder.
To Environment add OE_LICENSE and OE_DIR, with their respective locations.
Create a new PyDev project and it should have OE capability by default.

Java users don't worry, I'll cover OEChem/Java in my next post.

Thursday, April 16, 2009

GCC 4.3 on RHEL4

There comes a time when you'll need the latest (or newer compilers). Unfortunately they are not always easy to upgrade.

Here I've installed GCC 4.3 on RHEL4.4, but in principle should work for any distribution.

Download the latest version of these:

Compile binutils first

./configure --prefix=/home/craigb/binutils
make install

Add your new binaries to your PATH (export PATH=/home/craigb/binutils/bin:$PATH) and libraries to LD_LIBRARY_PATH (export LD_LIBRARY_PATH=/home/craigb/binutils/lib:$LD_LIBRARY_PATH) next compile GMP

./configure --prefix=/home/craigb/gmp
make install

Add these libraries to your LD_LIBRARY_PATH (export LD_LIBRARY_PATH=/home/craigb/gmp/lib:$LD_LIBRARY_PATH), next compile MPFR

Download the latest patches first
./configure --prefix=/home/craigb/mpfr
make install

Add these libraries to your LD_LIBRARY_PATH (like above), now compile GCC

cd /home/craigb/gcc-build (Note not the same folder as the source)
/home/craigb/gcc-4.3.3/configure --prefix=/home/craigb/gcc --with-gmp=/home/craigb/gmp --with-mpfr=/home/craigb/mpfr
make install

You should find GCC in /home/craigb/gcc/bin!

It is good practise to read the INSTALL and/or README files for all the applications before running the generic configure, make, make install above. If make check or make test is available do that as well.

Friday, April 3, 2009

Install CPMD

CPMD is massively parallel code. There is little point running it serially as it will literally take forever to do anything useful. I'm providing the instructions I used to compile the parallel version on our HPC facility, therefore they may need altering for your computer.

Some technical details:
  • CPMD 3.13.1
  • Intel compilers/MKL 10.1
  • openSUSE 10.3, 64-bit
./ IFORT-AMD64-MPI > Makefile

# In Makefile alter
FFLAGS = -pc64 -O2 -unroll
LFLAGS = -L/opt/intel/mkl/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
CC = mpicc -cc=icc
FC = mpif90 -fc=ifort -c
LD = mpif90 -fc-ifort -i-static

Run make, hopefully it will compile happily, copy cpmd.x to somewhere on your $PATH.

It would be wise to test your binary. First download cpmd-test.tar.gz from the contrib section of the downloads (tests are not included with the source). Run as mpisub 5x2 cpmd.x inp-1 or similiar depending on your setup. This command would use 5 dual processor computers.

Wednesday, April 1, 2009

Python training

Forgot to mention in my last post. If you are after Python/OEChem training and are not coming to EuroCUP, there is an alternative. Andrew Dalke is offering Python training for Cheminformatics. OEChem is just one part of this course, Django, SQL, R are also covered.

I've spoken to a previous attendee and he recommended it.

See Andrew's website for more details.


I'm off to OpenEye's third annual EuroCUP next month. I've not been to a vendor organised conference before, so am looking forward to it.

Although I've previously posted about the free academic license; I wish I'd taken advantage of mine more. Alas time didn't permit. That's now changed and I've learning Python as quick as I can to take full advantage of the Python/OEChem training session offered at EuroCUP.

I can jump straight into OEChem via Java, but the Python wrapper lends itself better for web-based applications. I've no plans (yet) to use the C++ toolkit directly.

I've used Eclipse as my editor of preference and will post how to configure it to use the Java & Python wrappers. Any C++ users feel free to contribute!