Hi Paolo,

I finally had some time to look at this again and I tried building from a conda 
environment.
I looked at the instruction on https://github.com/rdkit/conda-rdkit and after 
getting a bit lost as to where the recipe for building boost is (found it 
through 
https://docs.conda.io/projects/conda-build/en/latest/user-guide/recipes/sample-recipes.html)
 I tried first building boost but got stuck.

Running $ conda build boost through command prompt ends up giving me this error 
message where the process is aborted:

(%BUILD_PREFIX%) %SRC_DIR%>call bootstrap.bat

Building Boost.Build engine

******  B A T C H   R E C U R S I O N  exceeds STACK limits ******

Recursion Count=336, Stack Usage=90 percent

******       B A T C H   PROCESSING IS   A B O R T E D      ******

Traceback (most recent call last):

  File "C:\Users\candy\anaconda3\Scripts\conda-build-script.py", line 10, in 
<module>

    sys.exit(main())

  File 
"C:\Users\candy\anaconda3\lib\site-packages\conda_build\cli\main_build.py", 
line 488, in main

    execute(sys.argv[1:])

  File 
"C:\Users\candy\anaconda3\lib\site-packages\conda_build\cli\main_build.py", 
line 477, in execute

    outputs = api.build(args.recipe, post=args.post, 
test_run_post=args.test_run_post,

  File "C:\Users\candy\anaconda3\lib\site-packages\conda_build\api.py", line 
186, in build

    return build_tree(

  File "C:\Users\candy\anaconda3\lib\site-packages\conda_build\build.py", line 
3088, in build_tree

    packages_from_this = build(metadata, stats,

  File "C:\Users\candy\anaconda3\lib\site-packages\conda_build\build.py", line 
2179, in build

    windows.build(m, build_file, stats=build_stats, 
provision_only=provision_only)

  File "C:\Users\candy\anaconda3\lib\site-packages\conda_build\windows.py", 
line 297, in build

    check_call_env(cmd, cwd=m.config.work_dir, stats=stats, 
rewrite_stdout_env=rewrite_env)

  File "C:\Users\candy\anaconda3\lib\site-packages\conda_build\utils.py", line 
410, in check_call_env

    return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)

  File "C:\Users\candy\anaconda3\lib\site-packages\conda_build\utils.py", line 
390, in _func_defaulting_env_to_os_environ

    raise subprocess.CalledProcessError(proc.returncode, _args)

subprocess.CalledProcessError: Command '['cmd.exe', '/d', '/c', 
'conda_build.bat']' returned non-zero exit status 255.



Any idea as to why this is happening and how to fix this?


Regards,
Charmaine Chu
Computational Chemist

[A close up of a sign  Description automatically 
generated]charmaine....@liverpoolchirochem.com<mailto:charmaine....@liverpoolchirochem.com>
[cid:image003.jpg@01D874FD.052AD270]<https://www.linkedin.com/company/liverpool-chirochem-ltd>+44
 (0)151 794 2936
liverpoolchirochem.com<https://www.liverpoolchirochem.com/>

This message and any files transmitted with it are the property of Liverpool 
ChiroChem Ltd., are confidential, and are intended solely for the use of the 
person or entity to whom this e-mail is addressed. If you are not one of the 
named recipient(s) or otherwise have reason to believe that you have received 
this message in error, please contact the sender and delete this message 
immediately from your computer. Any other use, retention, dissemination, 
forwarding, printing, or copying of this e-mail is strictly prohibited.

From: Paolo Tosco <paolo.tosco.m...@gmail.com>
Sent: 14 April 2022 18:41
To: Charmaine Siu Man Chu <charmaine....@liverpoolchirochem.com>
Cc: rdkit-discuss@lists.sourceforge.net
Subject: Re: [Rdkit-discuss] Building RDKit on Windows for pgAdmin (Postgres)

Hi Charmaine,

my suggestion is to build starting from a conda environment. That will 
significantly simplify your dependencies, since most packages are available 
pre-built.
You can look into .azure-pipelines\vs_build_dll.yml for how to set up your 
conda environment and for the cmake flags to use.
For Postgres, these are the cmake flags that I use to configure the PostgreSQL 
DLL build:

    -D RDK_BUILD_PGSQL=ON ^
    -D RDK_PGSQL_STATIC=OFF ^
    -D PostgreSQL_INCLUDE_DIR="C:/Program Files/PostgreSQL/14/include" ^
    -D PostgreSQL_TYPE_INCLUDE_DIR="C:/Program 
Files/PostgreSQL/14/include/server" ^
    -D PostgreSQL_LIBRARY="C:/Program Files/PostgreSQL/14/lib/postgres.lib" ^
    ..

Note that this is to build against Postgres installed using the Windows 
installer from the PostgreSQL website, not the version provided by conda.

Cheers,
p.


On Thu, Apr 14, 2022 at 11:36 AM Charmaine Siu Man Chu 
<charmaine....@liverpoolchirochem.com<mailto:charmaine....@liverpoolchirochem.com>>
 wrote:
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<mailto:Rdkit-discuss@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to