Cross Install RDKit

English

toolchain-rpi.cmake

Prepare toolchain-rpi.cmake as below;

 

SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)

SET(CMAKE_C_COMPILER   arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)

# where is the target environment 
SET(CMAKE_FIND_ROOT_PATH  /opt/raspi/arm-linux-gnueabihf /opt/raspi/arm-linux-gnueabihf-rootfs )

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Make sure boost include files and libraries are installed under a sort of Linux standard path relative to /opt/raspi/arm-linux-gnueabihf such as /opt/raspi/arm-linux-gnueabihf/usr/local/include and /opt/raspi/arm-linux/gnueabihf/usr/local/lib, so that cmake will automatically find right place for boost with repect to CMAKE_FIND_ROOT_PATH directory.

Get rdkit from git

 git clone git://github.com/rdkit/rdkit

 

Add following  line to rdkit/CMakeList.txt (static link with boost-regex may cause a compile error with libSNParse.so, that require boost-regex shared library)

set(Boost_USE_STATIC_LIBS ON)

Modify follwing lines for rdkit/CMake

option(RDK_BUILD_PYTHON_WRAPPERS "build the standard python wrappers" OFF )
option(RDK_INSTALL_STATIC_LIBS "install the rdkit static libraries" OFF )

Some reason, I got an error when linking static library due to libptherad not found, so that I decided to disable static link library generation. 

Run cmake as

export RDBASE=`pwd`
mkdir build
cd build/
cmake -DCMAKE_INSTALL_PREFIX=/opt/raspi/arm-linux-gnueabihf/usr/local -DCMAKE_TOOLCHAIN_FILE=../../toolchain-rpi.cmake ..
make -j4
make install

 


Reference

http://www.cmake.org/Wiki/CMake_Cross_Compiling

User login