Update conda package of rdkit-postgresql #rdkit #postgresql

Yesterday, I enjoyed mishima.syk #16. Due to recent COVID-19, we moved the meeting to virtual style and worked very well. As same as RDKit UGM 2020, we used Zoom for presentation and discord for discussion and chat. Discord was very useful and easy to use. Thank for all participants and member of the community. The meeting is interesting because there are many topics will be presented here for example, chemoinformatics, bioinformatics, quantum chemistry, drug discovery workflow, new life style and more. The back ground of attendees were not only industry but also academia, students etc.

I presented about integration of pychembldb and razi which will be useful for handling ChEMBL DB with rdkit.
My slide deck was uploaded here.
https://github.com/Mishima-syk/16/tree/master/iwatobipen

This code uses rdkit-postresql package which is installed via conda. Recently rdkit is version upped from 202003 to 202009 however, rdkit-postgresql is not updated for 202009.

I would like to move my env from 202003 to 202009, so I tried to make rdkit-posgresql 202009.

To make the package, nice document is provided in conda-rdkit repo.

At first I installed some packages for conda build. And get source code with git command.

$ conda install conda-build
$ conda install anaconda-client
$ git clone https://github.com/rdkit/conda-rdkit.git
$ cd conda-rdkit

Then I modified following files.

#rdkit-postgresql/conda_build_config.yaml
postgresql:
  -- 9.6
  -- 10
  -- 11
  +- 10.5
-libboost: 1.67
+libboost: 1.73

pin_run_as_build:
  postgresql: x.x
  libboost:
    max_pin: x.x
# conda-rdkit/rdkit-postgresql/build.sh
mkdir -p build
cd build
# in case there are any old psql builds: remove them
rm -rf Code/PgSQL

cmake \
    -D RDK_BUILD_PGSQL=ON \
    -D RDK_PGSQL_STATIC=ON \
    -D RDK_INSTALL_STATIC_LIBS=ON \
    -D RDK_INSTALL_INTREE=OFF \
    -D RDK_INSTALL_STATIC_LIBS=OFF \
    -D RDK_INSTALL_DEV_COMPONENT=OFF \
    -D RDK_BUILD_INCHI_SUPPORT=ON \
    -D RDK_BUILD_AVALON_SUPPORT=ON \
    -D RDK_BUILD_FREESASA_SUPPORT=OFF \
    -D RDK_USE_FLEXBISON=OFF \
    -D RDK_BUILD_THREADSAFE_SSS=ON \
    -D RDK_TEST_MULTITHREADED=ON \
    -D RDK_BUILD_CPP_TESTS=OFF \
    -D RDK_BUILD_PYTHON_WRAPPERS=OFF \
    -D RDK_USE_BOOST_SERIALIZATION=OFF \
    -D RDK_OPTIMIZE_NATIVE=OFF \       <<< this line was added
    -D CMAKE_SYSTEM_PREFIX_PATH=$PREFIX \
    -D CMAKE_INSTALL_PREFIX=$PREFIX \
    -D BOOST_ROOT=$PREFIX -D Boost_NO_SYSTEM_PATHS=ON \
    -D CMAKE_BUILD_TYPE=Release \
    ..

make -j$CPU_COUNT

cd ./Code/PgSQL/rdkit

/bin/bash -e ./pgsql_install.sh

export PGPORT=54321
export PGDATA=$SRC_DIR/pgdata

rm -rf $PGDATA # cleanup required when building variants
pg_ctl initdb

# ensure that the rdkit extension is loaded at process startup
echo "shared_preload_libraries = 'rdkit'" >> $PGDATA/postgresql.conf

pg_ctl start -l $PGDATA/log.txt

# wait a few seconds just to make sure that the server has started
sleep 2

set +e
ctest
check_result=$?
set -e

pg_ctl stop

exit $check_result

Then run build command.

$ conda-build rdkit-postgresql

After building rdkit-postgresql package will be able to install via conda. And I uploaded the package to my conda repo. I’m using postgresql10.5 so the package will work with postgresql 10.5. I’ll try to build the package for other version of postgresql.

https://anaconda.org/iwatobipen/rdkit-postgresql

Any comments, requests and suggestion will be greatly appreciated.

Advertisement

Published by iwatobipen

I'm medicinal chemist in mid size of pharmaceutical company. I love chemoinfo, cording, organic synthesis, my family.

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 )

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.

%d bloggers like this: