Sunday, June 28, 2009

Eclipse Galileo

Eclipse continues it's annual eclipse release, this year with Galileo. Available to download from here.

33 projects have released new updates, so something for everyone. Of particular note for Mac users, is the option for Cocoa, the successor to the Carbon API. (Pick when you download).

I've tried a handful of plugins and they all seem to work fine:
  • Subclipse
  • CDT (new release)
  • PyDev
  • Aptana Studio

You can find numerous reviews on the eclipse website.

Sunday, June 14, 2009

Eclipse with Django

Django is popular web framework written in Python. For Python users it is an obvious choice to deploy web applications. Once again I return to my favourite IDE to develop with Django - Eclipse.

Two plugins are needed to bring Django support to Eclipse. The second handles the Django template language. Grab the plugins:
  1. PyDev (Python)
  2. Aptana Studio (Python + Django)
Both plugins are from Aptana, PyDev is a plugin to their IDE. Thankfully, both work through Eclipse as well.

Monday, June 1, 2009

Eclipse with C++/OEChem

The final post in this series, allowing you to develop your OpenEye applications using Eclipse.

First off you will need to ensure the CDT plugin is installed, or download Eclipse for C++ developers.

Now we are set to go. Create a new C++ Project (Executable > Hello World). Edit/Add C++ files to the source folder. Next we need to inform the project about OpenEye.

  • Open your project properties (Project > Properties).
  • Pick C/C++ Build > Settings
  • Edit [ All Configurations ] (by default Debug and Release)
  • Set include paths (-I) under GCC C++ Compiler > Directories > Include paths
  • Add $OE_DIR/toolkits/include
  • Set library paths (-L) under GCC C++ Linker > Libraries > Library search path
  • Add $OE_DIR/toolkits/lib
  • Set specific libraries (-l) under GCC C++ Linker > Libraries > Libraries
  • Add oeplatform, oesystem, oechem, m, z, pthread
  • You can set further Makefile details from this panel (optimisation etc)
If you have multiple versions of the toolkit you can create a configuration for each one.

Between C++/Java/Python you should be able to code away happily within Eclipse.

Friday, May 1, 2009

Eclipse with Java/OEChem - Check out Java in Action

Following up from a previous post, here I present the settings required to get Eclipse running with the OEChem Java wrapper.

Make sure you have Eclipse and and working OpenEye installation setup and running first.

  1. Create a regular Java Project
  2. Configure your build path to add:
  3. a) Under sources add a linked source $OE_DIR/java/libs
  4. b) Under libraries add external jars, $OE_DIR/java/*.jar (add them all)
  5. Run your OEChem program, if you get license errors edit the run configuration; under environment add OE_LICENSE, with $OE_DIR/etc/oe_license.txt; OE_HOME with $OE_DIR and OEJAVA with $OE_DIR/java

Obviously substitute $OE_DIR with your actual absolute file path.

Now Eclipse's CDT can be used to use the C++ toolkit direct, so I'll post that - once I've started to use it!

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!

Friday, March 13, 2009

New content... shortly

Apologies for the lack of posts, moving home and job has made blogging a very low priority! I do have some topics lined up though, specifically:

  • Various installation howtos
  • Eclipse integration with OpenEye toolkits

Let me know if there is something specific, related to my previous posts that would be of interest and I'll try to blog on that too.

Friday, February 20, 2009

Chemistry on the iPhone

The iPhone has had plenty of press since it's initial announcement. In my view, one of the best features is the App store. With some 15,000 applications currently available there is something for everyone - including Chemists! From straight reference to 3D visualisation with touch interface these applications demonstrate what scientists could do on a smartphone. This is by no means an extensive list, but some apps that have caught my eye:
The App Store categories is the obvious way to find these, specifically in Education, Reference or Utilities. However, Solutions falls under Health & Fitness!

Anyone can write an App for the iPhone (and iPod Touch) using the SDK. It is Objective-C, not something I'm familiar with so that goes on my to do list for post-thesis!

Other smartphones are also introducing SDK's as well, e.g. Android. The mobile platform is becoming an increasingly important development arena. It is good to see that Chemistry has a presence there too.

Wednesday, February 11, 2009

Condor 7.2.0 success

Condor 7.2.0 is successfully running on our condor pool. Using our own compiles for Mac/PPC, openSUSE 10.3 64-bit and openSUSE 10.3 32-bit (used on 10.2/10.3/11.0/11.1 computers). Mac/Intel binaries from the condor development team.

For reference the configure options I've used are:

./configure --without-classads --without-openssl

openSUSE 10.x/11.0
./configure --disable-glibc-version-check --disable-gcc-version-check --disable-full-port --without-classads --without-gsoap

openSUSE 11.1
./configure --disable-glibc-version-check --disable-gcc-version-check --disable-full-port --without-classads --without-gsoap --without-coredumper

Otherwise compile as per my previous posts.

Wednesday, February 4, 2009

Make Java look native on Mac

Java is excellent as it just works on so many platforms. My Java software is used on Windows, Linux & Mac. Mac users will notice that the behaviour of Java applications doesn't follow that of the native applications (unlike on Windows/Linux). This is a bit annoying to be honest, however, there are several steps you can take to give a more Mac "feel" to your application.

This link was recently forwarded to me, some of it is certainly useful, although some outdated, but it will give you an idea of what you can alter to add that Mac feel.

Wednesday, January 28, 2009

MAMP on Leopard part III

The final part to MAMP is PHP. PHP is already installed but not configured. 

Apache needs to be told how to handle .php files (otherwise they are shown as plain text source in the browser). This handler needs to be added to /etc/apache2/httpd.conf, add near similar commands towards the end of the file.

AddType application/x-httpd-php .php

Also check whether the PHP module line is not commented, remove a # if present.

LoadModule php5_module libexec/apache2/

The PHP config file is not active by default, you will want to do this:

sudo cp /etc/php.ini.default /etc/php.ini

As you have installed MySQL, you will want PHP to be able to talk to it you need to edit two lines to ensure it actually works:

mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock

(Add the bold values) Then restart apache for the changes to take affect.

That completes this 3 part installation guide for MAMP on Leopard. P can also be Perl or Python, if you need those languages.

Tuesday, January 20, 2009

MAMP on Leopard part II

MySQL is the hugely popular SQL database server. It is the only part of MAMP that isn't installed by default with Leopard. No problem, a quick visit to will let you download it, select Mac OS X package format. (N.B. Pick the 32-bit version, the 64-bit will cause a headache later if you plan to use Perl's MySQL DBI, see my previous post).

Run all 3 applications within the download: mysql-5.1.X-osx10.5-x86.pkg, MySQLStartupItem.pkg and MySQL.prefPane.

MySQL can be started/stopped via the the MySQL panel in System preferences, or via the command-line:

sudo /Library/StartupItems/MySQLCOM/MySQLCOM {start|stop|restart}

Now it is installed you should remove the anonymous login accounts and add a password to the root account. There is plenty of information on securing MySQL available here.

Configure PHP in part III.

Monday, January 12, 2009

MAMP on Leopard part I

In this three part tutorial I'll detail how to take Mac OS X 10.5 Leopard (client version) from no MAMP to MAMP.

MAMP being a twist on the more common LAMP.
  • Mac OS X
  • Apache
  • MySQL
  • PHP (or Python or Perl)
MAMP is key for using modern web services and software, e.g. phpMyAdmin, MediaWiki, the list is almost endless. Each part of this tutorial will address one element. I assume you have Mac OS X Leopard installed, if not go buy yourself a Mac!

Apache2 comes with Leopard (and is periodically updated too). All you need to do is switch it on. Jump to System Preferences > Sharing, tick "Web sharing" from the list and apache is now running!

Find your configuration file at /etc/apache2/httpd.conf. Files for the default location can be found in /Library/WebServer/Documents and CGI scripts in /Library/WebServer/CGI-Executables. User websites (http://localhost/~username) can be found in the Sites folder of the specified user. Note the location of any of these can be altered using your httpd.conf. I recommend reading up on the manual before editing your .conf files first.

You can also stop/start apache via the command-line using:

sudo apachectl {start|stop|restart}

MySQL will be covered in part II.

Friday, January 9, 2009

Condor 7.2.0

After not much luck with 7.1.x, I've successfully compiled 7.2.0 on Mac/PPC, openSUSE 10.3 64-bit & openSUSE 11.0 32-bit.

All using the following configure options:

./configure --disable-glibc-version-check --disable-gcc-version-check --disable-full-port --without-classads --without-gsoap

All I need to do now is test it on my pool, but looks promising so far!