How to build RDKit on Windows

RDKit is a cheminformatics library with a C++ and Python API. You typically need to build it only if you need to use the C++ API on Windows. Here are the steps that worked for me:

1. Install Python and Numpy.

2. Install Boost.

3. Install CMake.

4. Download the latest RDKit source code from Github here. I have found that their Sourceforge releases do not include the C++ libraries.

5. Create a build directory in RDKit directory and open a command-prompt there and type cmake-gui ..

6. In the CMake GUI, pick the version of Visual Studio. Click Configure, click Configure again and then click Generate. CMake generates the Visual Studio solution for RDKit.

7. Open the generated RDKit.sln solution file. Choose a build type (Release or Debug) that matches that of the cheminformatics project you are working on. Choose Build > Build Solution. RDKit should build successfully.

8. Add an environment variable named RDBASE with a value of the RDKit base directory.

9. Open the cheminformatics C++ project you are working on. Add $(RDBASE)/Code as an Include directory. Add $(RDBASE)/Build/lib/Debug or $(RDBASE)/Build/lib/Release as a Library directory. Add all the .lib files in the library directory for linking.

10. To use a RDKit class in your C++ source file, find the header file that contains it. You can do this by looking at C++ documentation of RDKit. You may need to add the header file path relative to $(RDBASE)/Code

Tried with: Visual Studio 2010, Boost 1.51 and Windows 7 x64

2 thoughts on “How to build RDKit on Windows

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.