My favorites | Sign in
Project Home Downloads Wiki Issues Source
RDKit build walk through for CentOS 5.5
Updated Jun 13, 2011 by

Instructions courtesy of Kirk DeLisle

The original instructions were performed on CentOS 5.5 using an SVN version of RDKit as of 15 Nov 2010.

5 Apr 2011: On the system previously used to build RDKit (above), I was able to build RDKit_2011_03_1beta1 by following only the RDKit section of the instructions below.

CMake, Flex, Bison

You may want to remove old versions of cmake, flex, and bison as these will be rebuilt with the latest versions. I've completed the process with and without the old versions present and not had any problems with version conflicts.

Build steps should be done as user, but all install steps must be done as root.

Linear Algebra Libraries

install atlas, atlas-devel, blas, blas-devel, lapack, lapack-devel through yum.

These linear algebra libraries are recommended by NumPy

yum install atlas, atlas-devel, blas blas-devel lapack lapack-devel

EDIT 23 Feb 2011:

There has been some discussion as to whether these libraries are required or not to build NumPy. The NumPy documentation states that they are recommended but not required: "NumPy does not require any external linear algebra libraries to be installed. However, if these are available, NumPy’s setup script can detect them and use them for building. A number of different LAPACK library setups can be used, including optimized LAPACK libraries such as ATLAS, MKL or the Accelerate/vecLib framework on OS X."

In my experience, I received errors during the build process when I didn't have at least one of these installed. It is likely that all three are not necessary, but I have not isolated them individually to see which ones are disposable.

The standard CentOS repo (base) has blas, blas-devel, lapack, and lapack-devel. For atlas and atlas-devel, you need to enable the epel repository:

rpm -Uvh

I also have RPMFusion repositories enabled, but they are not required.

GCC with MPFR 2.4.1

I have upgraded GCC on my LINUX install to version 4.4.5. Previously, I found the version of GCC on CentOS (4.1.2-48) to have many bugs, in particular template handling errors which prevented it from properly compiling boost and ultimately breaking the entire process at the last step. The only remedy I've found is to completely rebuild GCC. MPFR is a multi-precision floating point math library required for other libraries, so I've simply included it in this build. I don't know if the newest version of CentOS' GCC (v4.1.2) has this problem, so I rebuilt as a precaution. (Edit: 4.1.2-48 does have this issue, but I believe it is fixed in 4.1.2-49 - CentOS 5.5 doesn't have that update, however.) For MPFR 2.4.1, copy the expanded mpfr directory into the top level gcc directory tree as 'mpfr' (no version numbers or dates). The build process takes care of it after that so you don't have to build and link it on your own.

Create a build directory OUTSIDE the gcc directory structure and do all build steps from there - the build process will take a few hours.

mkdir gcc-build
cd gcc-build
make install

CMake 2.8.2

make install

flex 2.5.35

make install

bison 2.4.2

make install

python 2.7

Install with -fPIC flags set. Enable Unicode UCS4 support. Enable shared library support.

./configure CFLAGS=-fPIC --enable-unicode=ucs4 --enable-shared
make install

I also made sure Python was built with the newly compiled GCC, and not the system GCC. On the command line, you should see this: 4.4.5 on linux2

At this point you will probably need to add /usr/local:/usr/local/lib:/usr/local/lib64 to the front of LD_LIBRARY_PATH in order for the system to know which version of Python and various libraries should be preferred.

NumPy 1.5.0

python build
python install

Test this by:

>>> import numpy

If you get an error, you've done something wrong.

Boost 1.44.0

./ --with-libraries=python,regex
./bjam address-model=64 cflags=-fPIC cxxflags=-fPIC install 


Make sure all environment variables are set properly. For LD_LIBRARY_PATH, you may or may not need /usr/local/lib64 - it is necessary for me due to the way I've built and installed various pieces.

$RDBASE = <the directory where you have installed the RDKit code>
$LD_LIBRARY_PATH = /$RDBASE/lib:/usr/local/lib:/usr/local/lib64
mkdir build
cd build
make install

Testing the Build (optional, but recommended) from the Building with CMake wiki

  • cd to $RDBASE/build and do ctest

FreeType 2.4.3

make install

PIL 1.1.7

Modify the FREETYPE_ROOT environment variable (line 40) to point to the directory in which FreeType was built. In my case, /opt/freetype-2.4.3.

python build
python install


If you use the standard aggdraw package ( you have to use the following compiler flag on 64-bit systems.

export CFLAGS="-fpermissive"

One option is to modify the one line of code for 64-bit as discussed here:

In /agg2/include/agg_array.h change line #523 from this:

unsigned align = (alignment - unsigned(ptr) % > alignment) % alignment;

to this:

unsigned align = (alignment - (unsigned long)(ptr) % alignment) % alignment;

You will also need to modify aggdraw's line 21 to point to your freetype directory. Mine:


I can then get aggdraw to build, but running the gives a segmentation fault. If I go ahead and install, it seems to work just fine and the images produced from RDKit are much improved. The full build process is:

export CFLAGS="-fpermissive"
python build_ext -i
python install

Sign in to add a comment
Powered by Google Project Hosting