Re: [Rdkit-discuss] (no subject)
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Jan H. J. <ja...@bi...> - 2012-12-26 20:54:33
|
:: Building the RDKit PG cartridge on Windows, 64-bit. :: Open a Visual Studio x64 Command Prompt window, then run make.bat in that window. :: Based on the Makefile for the PG cartridge as in RDKit 2012_09_1. :: This one is built without InChI support for simplicity. @echo off set RDBASE=C:\RDKit_2012_09_1 set RDKIT=%RDBASE% set BOOSTHOME=C:\boost\boost_1_51_x64 set PG_INCL_ROOT=C:\pg_incl set PG_INCL_SERVER=%PG_INCL_ROOT%\server\ set PG_INCL_WIN32=%PG_INCL_ROOT%\server\port\win32\ set PG_ALL_INCLUDES=/I %PG_INCL_SERVER% /I %PG_INCL_WIN32% set INCLUDES=/I %BOOSTHOME% /I %RDKIT%\Code %PG_ALL_INCLUDES% :: According to :: http://exodusdb.googlecode.com/svn-history/r278/trunk/exodus/pgexodus/src/pgnaturalorder.cpp :: https://exodusdb.googlecode.com/svn-history/r641/trunk/exodus/libpgexodus/src/pgexodus.c :: it is important to define WIN32 and BUILDING_MODULE. :: :: WIN32 to avoid the following errors originating in pg_config_os.h: :: error C2011: 'timezone' : 'struct' type redefinition :: error C2011: 'itimerval' : 'struct' type redefinition :: :: BUILDING_MODULE to "ensure that Pg_module_function and friends are declared __declspec(dllexport)". :: :: NOMINMAX is to suppress macro generation in WinDef.h that confuses the compiler so std::min() won't :: be recognized, see e.g. http://www.suodenjoki.dk/us/archive/2010/min-max.htm set DEFINES=/D WIN32 /D BUILDING_MODULE /D NOMINMAX /D RDKITVER=\"006000\" set SRC_FILE_LIST=*.c *.cpp :: For testing compile options etc. it can be useful to have an explicit list instead, as below. :: set SRC_FILE_LIST=bfp_op.c cache.c guc.c mol_op.c low_gist.c rdkit_gist.c rdkit_io.c sfp_op.c adapter.cpp :: /TP - compile in C++ mode since MSVC's C support is quite out-dated (not C99 compliant). :: /MD - runtime linking. Omit this, and you will get tons of linking errors later. :: /EHsc - enable unwind semantics since the C++ code handles exceptions. for %%f in (%SRC_FILE_LIST%) do ( cl /TP /MD /EHsc /c %INCLUDES% %DEFINES% %%f if errorlevel 1 goto :error ) :: Linker setup. set LINK_DIRS=/LIBPATH:%BOOSTHOME%\lib\ /LIBPATH:%PG_INCL_ROOT%\lib\ /LIBPATH:%RDBASE%\build\lib\Release :: boost lib names prefixes and suffixes. set BOPRE=boost_ set BOSUF=-vc100-mt-1_51.lib set BOOST_LINK_LIBS=%BOPRE%system%BOSUF% %BOPRE%filesystem%BOSUF% %BOPRE%thread%BOSUF% %BOPRE%date_time%BOSUF% %BOPRE%chrono%BOSUF% :: set PG_LINK_LIBS=postgres.lib set RDKIT_LINK_LIBS=FileParsers.lib SmilesParse.lib Fingerprints.lib Subgraphs.lib SubstructMatch.lib Descriptors.lib PartialCharges.lib GraphMol.lib DataStructs.lib RDGeometryLib.lib RDGeneral.lib :: set ALL_LINK_LIBS=%BOOST_LINK_LIBS% %PG_LINK_LIBS% %RDKIT_LINK_LIBS% :: NOTE: Do not list rdkit_op.obj here, even though rdkit_op.c exists. It should not be linked in (see Linux Makefile). set OBJ_FILE_LIST=rdkit_io.obj mol_op.obj bfp_op.obj sfp_op.obj rdkit_gist.obj low_gist.obj guc.obj cache.obj adapter.obj link /DLL %LINK_DIRS% %ALL_LINK_LIBS% %OBJ_FILE_LIST% /out:rdkit.dll if errorlevel 1 goto :error goto :exit_ok :error echo "******** ERROR occurred **********" goto :end :exit_ok goto :end :end |