Hello,

I've been trying to build RDKit on Windows so that I can get the RDKit 
extension in pgAdmin (Postgres) but I've been unsuccessful.
I've tried to follow the instruction on https://www.rdkit.org/docs/Install.html 
to build RDKit and encountered several problems.
Some of them I manage to resolve myself but can someone help on this?

Here is what I've tried:

To start off, I'm using the Windows 11 64-bit OS and Postgres 14 was installed.
I then went to install the following:
Python 3.10 along with numpy and Pillow
Visual Studio 2022 with Visual Studio Community 2022, Visual Studio Build Tools 
2022
Cmake 3.23.0
Boost_1_78_0 using the .exe installer
And downloaded and extracted the rdkit-Release_2022_03_1

After install the above, I ran the below in Comand Prompt
cmake -DRDK_BUILD_PYTHON_WRAPPERS=ON -DBOOST_ROOT=C:/locall/boost_1_78_0 
-DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_AVALON_SUPPORT=ON -DRDK_BUILD_PGSQL=ON 
-DPostgreSQL_ROOT="C:\Program Files\PostgreSQL\14" -G"Visual Studio 17 2022" ..
came back with error:
The following variants have been tried and rejected:

  * boost_python310-vc143-mt-gd-x64-1_78.lib (shared, default on Windows is
  static, set Boost_USE_STATIC_LIBS=OFF to override)

  * boost_python310-vc143-mt-x64-1_78.lib (shared, default on Windows is
static, set Boost_USE_STATIC_LIBS=OFF to override)

I then edit the command line to
cmake -DRDK_BUILD_PYTHON_WRAPPERS=ON -DBOOST_ROOT=C:/locall/boost_1_78_0 
-DBoost_USE_STATIC_LIBS=OFF -DRDK_BUILD_INCHI_SUPPORT=ON 
-DRDK_BUILD_AVALON_SUPPORT=ON -DRDK_BUILD_PGSQL=ON 
-DPostgreSQL_ROOT="C:\Program Files\PostgreSQL\14" -G"Visual Studio 17 2022" ..
and this time following error occured
Could NOT find Eigen3 (missing: EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) (Required 
is at least version "2.91.0")
CMake Error at C:/Program 
Files/CMake/share/cmake-3.23/Modules/ExternalProject.cmake:2540 (message):
  error: could not find git for clone of Eigen

So I went to download and extracted eigen 3.4.0 and edit the command line to
cmake -DRDK_BUILD_PYTHON_WRAPPERS=ON -DBOOST_ROOT=C:/locall/boost_1_78_0 
-DBoost_USE_STATIC_LIBS=OFF -DEIGEN3_INCLUDE_DIR="C:/eigen-3.4.0" 
-DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_AVALON_SUPPORT=ON -DRDK_BUILD_PGSQL=ON 
-DPostgreSQL_ROOT="C:\Program Files\PostgreSQL\14" -G"Visual Studio 17 2022" ..
which gave the following error
CMake Error at C:/Program 
Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 
(message):
Could NOT find Freetype (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)

So again I went to obtain freetype-2.12.0 and build it following the 
instructions on 
https://bobhowto.wordpress.com/2020/11/10/build-freetype-on-windows-10-using-visual-studio-2017/,
 using VS 2022 instead, and edit the command line to
cmake -DRDK_BUILD_PYTHON_WRAPPERS=ON -DBOOST_ROOT=C:/local/boost_1_78_0 
-DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_AVALON_SUPPORT=ON 
-DBoost_USE_STATIC_LIBS=OFF -DEIGEN3_INCLUDE_DIR="C:/eigen-3.4.0" 
-DFREETYPE_INCLUDE_DIRS="C:/freetype-2.12.0/include" 
-DFREETYPE_LIBRARY="C:/freetype-2.12.0/objs/freetype.lib" -DRDK_BUILD_PGSQL=ON 
-DPostgreSQL_ROOT="C:\Program Files\PostgreSQL\14" -G"Visual Studio 17 2022" ..
and it managed to compile
However, when running
"C:\Program Files\Microsoft Visual 
Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" /m:4 
/p:Configuration=Release INSTALL.vcxproj
Gave the following error with 47 other warnings
"C:\rdkit-Release_2022_03_1\build\INSTALL.vcxproj" (default target) (1) ->
       "C:\rdkit-Release_2022_03_1\build\ALL_BUILD.vcxproj" (default target) 
(3) ->
       
"C:\rdkit-Release_2022_03_1\build\Code\GraphMol\Deprotect\Wrap\rdDeprotect.vcxproj"
 (default target) (20) ->
       
"C:\rdkit-Release_2022_03_1\build\Code\GraphMol\ChemReactions\ChemReactions.vcxproj"
 (default target) (48) ->
       
"C:\rdkit-Release_2022_03_1\build\Code\GraphMol\Descriptors\Descriptors.vcxproj"
 (default target) (55) ->
       
"C:\rdkit-Release_2022_03_1\build\Code\GraphMol\FileParsers\FileParsers.vcxproj"
 (default target) (56) ->
       (ClCompile target) ->
        
C:\rdkit-Release_2022_03_1\Code\GraphMol\FileParsers\PNGParser.cpp(25,10): 
fatal error C1083: Cannot open incl
       ude file: 'zlib.h': No such file or directory 
[C:\rdkit-Release_2022_03_1\build\Code\GraphMol\FileParsers\FilePa
       rsers.vcxproj]

So I went to obtain zlib 1.2.12 and build it via
cmake -G"Visual Studio 17 2022" ..
"C:\Program Files\Microsoft Visual 
Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" zlib.sln
copy /Y zconf.h ..
and compiled the boost libraries via
b2 --prefix=C:\local\boost_1_78_0 -sZLIB_SOURCE="C:/zlib-1.2.12" 
-sZLIB_INCLUDE="C:/zlib-1.2.12" -sZLIB_LIBPATH="C:/zlib-1.2.12/build/Release" 
-sZLIB_BINARY="C:/zlib-1.2.12/build/Release/zlib.lib" --debug-configuration -d0 
address-model=64 link=shared install
and changed the PATH in the environment variables to C:\local\boost_1_78_0\lib
but running the build code and the INSTALL.vcxproj gave the same error

As during the compilation -- Could NOT find ZLIB (missing: ZLIB_LIBRARY 
ZLIB_INCLUDE_DIR) was spotted, the command line was modified to point towards 
the zlib folder as follow
cmake -DRDK_BUILD_PYTHON_WRAPPERS=ON -DBOOST_ROOT=C:/local/boost_1_78_0 
-DZLIB_LIBRARY="C:/zlib-1.2.12/build/Release/zlib.lib" 
-DZLIB_INCLUDE_DIR="C:/zlib-1.2.12" -DBoost_USE_STATIC_LIBS=OFF 
-DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_AVALON_SUPPORT=ON -DRDK_BUILD_PGSQL=ON 
-DPostgreSQL_ROOT="C:/Program Files/PostgreSQL/14" 
-DEIGEN3_INCLUDE_DIR="C:/eigen-3.4.0" 
-DFREETYPE_INCLUDE_DIRS="C:/freetype-2.12.0/include" 
-DFREETYPE_LIBRARY="C:/freetype-2.12.0/objs/freetype.lib" -G"Visual Studio 17 
2022" ..
This time running the INSTALL.vcxproj gave 93 warnings but no errors
However, when starting up python in KNIME it gives the following error:
Error while loading python type extension RDKitMolDeserializer
Cause: DLL load failed while importing rdBase: The specified module could not 
be found.
And when loading the rdkit extension in pgAdmin gave
ERROR: could not load library "C:/Program Files/PostgreSQL/14/lib/rdkit.dll": 
The specified module could not be found.

I've made sure I delete the rdkit build folder each time I redo the 
compilation. Where had I gone wrong?

Regards,
Charmaine Chu
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to