These instructions have been tested on linux and the Mac, both using the system C++ compilers. Note that you need a compiler which supports C++17.
git clone https://github.com/rdkit/rdkit.git RDKit_git
this will create a directory called RDKit_git with the RDKit source.
mamba create -n py310_rdkit_build python=3.10 boost-cpp boost cairo pandas pillow freetype cmake numpy eigen matplotlib
from inside the RDKit source directory you checked out above:
conda activate py310_rdkit_build
mkdir build_demo
cd build_demo
cmake -DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_YAEHMOP_SUPPORT=ON -DRDK_BUILD_XYZ2MOL_SUPPORT=ON ..
That should run without errors. It’ll produce a bunch of warnings, but should end with something like:
-- Generating done
-- Build files have been written to: /localhome/glandrum/RDKit_git/build_demo
Now build it:
make -j8 install
That will take a while and generate a few warnings, but shouldn’t have any errors. The last line of the output should be something like this:
-- Installing: /localhome/glandrum/RDKit_git/rdkit/RDPaths.py
Do this from inside the RDKit source directory (not the build directory). On linux:
export RDBASE=`pwd`
export PYTHONPATH=$RDBASE
export LD_LIBRARY_PATH=$RDBASE/lib:$CONDA_PREFIX/lib
on the Mac, that is:
export RDBASE=`pwd`
export PYTHONPATH=$RDBASE
export DYLD_LIBRARY_PATH=$RDBASE/lib:$CONDA_PREFIX/lib
Now you can run the tests:
cd build_demo
ctest -j6 –output-on-failure
This will take a bit and generate a lot of output, but the last bit should look something like this:
100% tests passed, 0 tests failed out of 219
Total Test time (real) = 63.92 sec
That’s it!
In order to use the code you just need to repeat the export commands shown above. I find the following aliases really useful on linux:
alias remote_rdkit='unset RDBASE;export PYTHONPATH="";export LD_LIBRARY_PATH=""'
alias local_rdkit='conda activate py310_rdkit_build;export RDBASE="/localhome/glandrum/RDKit_git";export PYTHONPATH="$RDBASE";export LD_LIBRARY_PATH="$RDBASE/lib:$CONDA_PREFIX/lib"'
alias rdkit_vers='python -c "import rdkit;print(rdkit.__version__,rdkit.__file__)"'
local_rdkit sets up the shell to use my local RDKit build. remote_rdkit clears that stuff out so that you can use a conda rdkit install rdkit_vers shows you the current rdkit version and where the files are coming from