Permalink
Browse files

initial

  • Loading branch information...
0 parents commit 63e0c619ae4d4926494d8edcf3f1b6fc9bb4b324 @rvianello rvianello committed Apr 15, 2014
@@ -0,0 +1 @@
+*~
@@ -0,0 +1,8 @@
+set BOOSTDIR=%SRC_DIR%\boost
+
+"%SRC_DIR%\boost_1_55_0-msvc-10.0-%ARCH%.exe" /SILENT /DIR="%BOOSTDIR%"
+
+xcopy "%BOOSTDIR%\boost" "%LIBRARY_INC%\boost" /s /e /i
+
+xcopy "%BOOSTDIR%"\lib%ARCH%-msvc-10.0 "%LIBRARY_LIB%" /s /e
+
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Hints:
+# http://boost.2283326.n4.nabble.com/how-to-build-boost-with-bzip2-in-non-standard-location-td2661155.html
+# http://www.gentoo.org/proj/en/base/amd64/howtos/?part=1&chap=3
+
+# Build dependencies:
+# - bzip2-devel
+
+export CFLAGS="-m64 -pipe -O2 -march=x86-64 -fPIC -shared"
+export CXXFLAGS="${CFLAGS}"
+
+mkdir -vp ${PREFIX}/bin;
+
+./bootstrap.sh --prefix="${PREFIX}/";
+
+sed -i 's/^using python.*;//' ./project-config.jam
+
+PY_INC=`$PYTHON -c "from distutils import sysconfig; print (sysconfig.get_python_inc(0, '$PREFIX'))"`
+
+echo "using python" >> ./project-config.jam
+echo " : $PY_VER" >> ./project-config.jam
+echo " : $PYTHON" >> ./project-config.jam
+echo " : $PY_INC" >> ./project-config.jam
+echo " : $PREFIX/lib" >> ./project-config.jam
+echo " ;" >> ./project-config.jam
+
+./b2 -q install --debug-configuration;
+
@@ -0,0 +1,30 @@
+
+package:
+ name: boost
+ version: 1.55.0
+
+source:
+ fn: boost_1_55_0.tar.bz2 [unix]
+ url: http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2 [unix]
+ fn: boost_1_55_0-msvc-10.0-64.exe [win64]
+ url: http://downloads.sourceforge.net/project/boost/boost-binaries/1.55.0-build2/boost_1_55_0-msvc-10.0-64.exe [win64]
+ fn: boost_1_55_0-msvc-10.0-32.exe [win32]
+ url: http://download.sourceforge.net/project/boost/boost-binaries/1.55.0-build2/boost_1_55_0-msvc-10.0-32.exe [win32]
+
+build:
+ number: 1
+
+requirements:
+ build:
+ - zlib [unix]
+ - bzip2 [unix]
+ - python [unix]
+ run:
+ - zlib [unix]
+ - bzip2 [unix]
+ - python [unix]
+
+about:
+ home: http://www.boost.org/
+ license: Boost-1.0
+
@@ -0,0 +1,32 @@
+diff --git Code/PgSQL/rdkit/Makefile Code/PgSQL/rdkit/Makefile
+index f02e88d..2def1df 100644
+--- Code/PgSQL/rdkit/Makefile
++++ Code/PgSQL/rdkit/Makefile
+@@ -1,10 +1,10 @@
+-RDKIT=$(RDBASE)
+-USE_INCHI=0
+-STATIC_LINK=1
++RDKIT=$(PREFIX)
++USE_INCHI=1
++STATIC_LINK=0
+
+ ifeq ($(USE_INCHI),1)
+ INCHILIBS=-lRDInchiLib -lInchi
+- INCHIFLAGS=-I${RDKIT}/External -DBUILD_INCHI_SUPPORT
++ INCHIFLAGS=-DBUILD_INCHI_SUPPORT
+ INCHIREGRESS=inchi
+ endif
+
+@@ -17,11 +17,8 @@ else
+ endif
+
+ SHLIB_LINK += -pthread
+-ifndef BOOSTHOME
+- BOOSTHOME=/usr/local/include
+-endif
+
+-PG_CPPFLAGS = -I${BOOSTHOME} -I${RDKIT}/Code -DRDKITVER='"007200"' ${INCHIFLAGS} #-DUSE_BUILTIN_POPCOUNT -msse4.2
++PG_CPPFLAGS = -I${PREFIX}/include -I${PREFIX}/include/rdkit -DRDKITVER='"007200"' ${INCHIFLAGS} #-DUSE_BUILTIN_POPCOUNT -msse4.2
+
+ CPLUSPLUSFLAGS = $(filter-out -fexcess-precision=standard -Wmissing-prototypes -Wdeclaration-after-statement, $(CFLAGS))
+ CPLUSPLUSFLAGS += -Wno-unused-function
@@ -0,0 +1,13 @@
+diff --git Code/PgSQL/rdkit/adapter.cpp Code/PgSQL/rdkit/adapter.cpp
+index d3185b7..cdb5b13 100644
+--- Code/PgSQL/rdkit/adapter.cpp
++++ Code/PgSQL/rdkit/adapter.cpp
+@@ -47,7 +47,7 @@
+ #include <DataStructs/SparseIntVect.h>
+ #include <boost/integer_traits.hpp>
+ #ifdef BUILD_INCHI_SUPPORT
+-#include <INCHI-API/inchi.h>
++#include <GraphMol/inchi.h>
+ #endif
+ #include "rdkit.h"
+
@@ -0,0 +1,22 @@
+cd $SRC_DIR/Code/PgSQL/rdkit
+
+make
+make install
+
+export PGPORT=54321
+export PGDATA=$SRC_DIR/pgdata
+
+pg_ctl initdb
+pg_ctl start -l $PGDATA/log.txt
+
+# wait a few seconds just to make sure that the server has started
+sleep 5
+
+set +e
+make installcheck
+check_result=$?
+set -e
+
+pg_ctl stop
+
+exit $check_result
@@ -0,0 +1,25 @@
+package:
+ name: rdkit-postgresql
+ version: 2014.03.1pre
+
+source:
+ git_url: https://github.com/rdkit/rdkit.git
+ git_branch: master
+ patches:
+ - Makefile.patch
+ - adapter.cpp.patch
+
+build:
+ number: 1
+
+requirements:
+ build:
+ - rdkit
+ - postgresql
+ run:
+ - rdkit
+ - postgresql
+
+about:
+ home: http://rdkit.org
+ license: BSD
@@ -0,0 +1,2 @@
+*.pyc
+__pycache__
@@ -0,0 +1,32 @@
+%PYTHON% "%RECIPE_DIR%\fetch_inchi.py"
+%PYTHON% "%RECIPE_DIR%\fetch_avalontools.py"
+
+cmake ^
+ -G "NMake Makefiles" ^
+ -D RDK_INSTALL_INTREE=OFF ^
+ -D RDK_BUILD_INCHI_SUPPORT=ON ^
+ -D RDK_BUILD_AVALON_SUPPORT=ON ^
+ -D RDK_USE_FLEXBISON=OFF ^
+ -D AVALONTOOLS_DIR="%SRC_DIR%\External\AvalonTools\src\SourceDistribution" ^
+ -D PYTHON_EXECUTABLE="%PYTHON%" ^
+ -D PYTHON_INCLUDE_DIR="%PREFIX%\include" ^
+ -D PYTHON_LIBRARY="%PREFIX%\libs\python27.lib" ^
+ -D PYTHON_INSTDIR="%SP_DIR%" ^
+ -D BOOST_ROOT="%LIBRARY_PREFIX%" -D Boost_NO_SYSTEM_PATHS=ON ^
+ -D CMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
+ -D CMAKE_BUILD_TYPE=Release ^
+ .
+
+rem set
+
+nmake
+
+rem extend the environment settings in preparation to tests
+set RDBASE=%SRC_DIR%
+set PATH=%LIBRARY_LIB%;%PATH%
+set PYTHONPATH=%RDBASE%
+
+nmake test
+
+nmake install
+
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+$PYTHON "$RECIPE_DIR/fetch_inchi.py"
+$PYTHON "$RECIPE_DIR/fetch_avalontools.py"
+
+cmake \
+ -D RDK_INSTALL_INTREE=OFF \
+ -D RDK_INSTALL_STATIC_LIBS=OFF \
+ -D RDK_BUILD_INCHI_SUPPORT=ON \
+ -D RDK_BUILD_AVALON_SUPPORT=ON \
+ -D RDK_USE_FLEXBISON=OFF \
+ -D AVALONTOOLS_DIR=$SRC_DIR/External/AvalonTools/src/SourceDistribution \
+ -D CMAKE_SYSTEM_PREFIX_PATH=$PREFIX \
+ -D CMAKE_INSTALL_PREFIX=$PREFIX \
+ -D PYTHON_EXECUTABLE=$PYTHON \
+ -D PYTHON_NUMPY_INCLUDE_PATH=$SP_DIR/numpy/core/include \
+ -D BOOST_ROOT=$PREFIX -D Boost_NO_SYSTEM_PATHS=ON \
+ -D CMAKE_BUILD_TYPE=Release \
+ .
+
+make
+
+RDBASE=$SRC_DIR LD_LIBRARY_PATH="$PREFIX/lib;$SRC_DIR/lib" PYTHONPATH=$SRC_DIR make test
+
+make install
@@ -0,0 +1,19 @@
+import os
+import tarfile
+
+from utils import download_file
+
+AVALON_URL = (
+ 'http://downloads.sourceforge.net/project/avalontoolkit/'
+ 'AvalonToolkit_1.1_beta/AvalonToolkit_1.1_beta.source.tar'
+ )
+
+avalon_tarball = download_file(AVALON_URL)
+
+AVALON_SRC_DIR = os.path.join(
+ os.environ['SRC_DIR'], 'External', 'AvalonTools', 'src'
+ )
+
+os.makedirs(AVALON_SRC_DIR)
+
+tarfile.open(avalon_tarball).extractall(AVALON_SRC_DIR)
@@ -0,0 +1,21 @@
+import os
+import zipfile
+import shutil
+
+from utils import download_file
+
+INCHI_URL = (
+ 'http://www.inchi-trust.org/fileadmin/user_upload/software/'
+ 'inchi-v1.04/INCHI-1-API.ZIP'
+ )
+
+inchi_zipfile = download_file(INCHI_URL)
+
+zipfile.ZipFile(inchi_zipfile).extractall('.')
+
+INCHI_SRC_DIR = os.path.join(
+ os.environ['SRC_DIR'], 'External', 'INCHI-API', 'src'
+ )
+
+shutil.copytree('./INCHI-1-API/INCHI_API/inchi_dll', INCHI_SRC_DIR)
+
@@ -0,0 +1,33 @@
+package:
+ name: rdkit
+ version: 2014.03.1pre
+
+source:
+ git_url: https://github.com/rdkit/rdkit.git
+ git_branch: master
+
+build:
+ number: 1
+
+requirements:
+ build:
+ - cmake [unix]
+ - requests
+ - boost
+ - python
+ - numpy
+ - pil [py2k]
+ - freetype
+ - py2cairo [linux and py2k]
+ run:
+ - boost
+ - python
+ - numpy
+
+test:
+ imports:
+ - rdkit
+
+about:
+ home: http://rdkit.org
+ license: BSD
@@ -0,0 +1,18 @@
+from __future__ import print_function
+
+import requests
+
+
+# http://stackoverflow.com/questions/16694907/how-to-download-large-file-in-python-with-requests-py
+def download_file(url):
+ r = requests.get(url, stream=True)
+ filename = url.split('/')[-1]
+ with open(filename, 'wb') as f:
+ print("Downloading: ", filename)
+ for chunk in r.iter_content(chunk_size=8192):
+ if chunk: # filter out keep-alive new chunks
+ f.write(chunk)
+ f.flush()
+ return filename
+
+

0 comments on commit 63e0c61

Please sign in to comment.