Skip to content

Commit 5ef9a75

Browse files
github-actions[bot]Create or Update Pull Request Actionkuelumbus
authored
🤖 Bump RDKit version to Release_2024_03_6 (#113)
* Set RDKit version to Release_2024_03_6 * Fix boost detection issue with case-sensetive * Add python3 directory hint to cmake * Improve python root path finding. * Typo * Improve Python version detection for win * Add system lib install path of python * typo * Improve finding python 3 on win * Improve python finding for windows * Bump cmake and setupt tools * Add missing comma * improve lib finding * oops * deactivate tmate action * bump cibuildweehl * print config vars * Fix library path for python on win * Try * enable debug mode * give more search pa * Fix path * path * Get windows paths * oops * Fix * fix * try * test * test * Enable debug * t * Fix * test * Verbose output for compilation * verbose * Try 10 * enable find debug * fix * Fix * Clean up an try ninja for windows * Remove ninja on windows --------- Co-authored-by: Create or Update Pull Request Action <create-or-update-pull-request@users.noreply.github.com> Co-authored-by: Christopher Kuenneth <christopher.kuenneth@gmail.com>
1 parent ce65a31 commit 5ef9a75

File tree

4 files changed

+46
-20
lines changed

4 files changed

+46
-20
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
CIBW_ARCHS: aarch64
1919

2020
command: |
21-
python3 -m pip install cibuildwheel==2.20.0
21+
python3 -m pip install cibuildwheel==2.21.3
2222
python3 -m cibuildwheel --output-dir wheelhouse
2323
- store_artifacts:
2424
path: wheelhouse/

.github/workflows/wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ jobs:
159159
cd C:\\rdkit
160160
echo "C:\\libs" >> $GITHUB_PATH
161161
fi
162-
python -m pip install cibuildwheel==2.20.0
162+
python -m pip install cibuildwheel==2.21.3
163163
python -m cibuildwheel --output-dir wheelhouse
164164
shell: bash
165165

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[build-system]
22
requires = [
3-
"setuptools==69.2.0",
3+
"setuptools==75.2.0",
44
"wheel",
5-
"cmake == 3.26.4",
5+
"cmake == 3.30.4",
66
"numpy",
77
"conan == 1.64.0",
88
"ninja",

setup.py

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
from pathlib import Path
66
from shutil import copytree, rmtree, ignore_patterns
77
from subprocess import call, check_call
8-
from sysconfig import get_paths
8+
import sysconfig
99
from textwrap import dedent
1010

1111
from setuptools import Extension, find_packages, setup
1212
from setuptools.command.build_ext import build_ext as build_ext_orig
1313

1414
# RDKit version to build (tag from github repository)
15-
rdkit_tag = "Release_2024_03_5"
15+
rdkit_tag = "Release_2024_03_6"
1616

1717
with open("README.md", "r", encoding="utf-8") as fh:
1818
long_description = fh.read()
@@ -168,14 +168,28 @@ def replace_all(file, search_exp, replace_exp):
168168

169169
# Fix a bug in conan or rdkit: target name for numpy is boost::numpy{pyversion} with small 'b'
170170
# and not Boost::numpy{pyversion}
171-
# Line 345 in 2024_03_04 in CMakeLists.txt
172-
# target_link_libraries(rdkit_py_base INTERFACE Boost::${Boost_Python_Lib} "Boost::numpy${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
171+
# Line 312 in 2024_03_06 in CMakeLists.txt
172+
# NEW: target_link_libraries(rdkit_py_base INTERFACE "Boost::python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}" "Boost::numpy${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
173173
replace_all(
174174
"CMakeLists.txt",
175-
'target_link_libraries(rdkit_py_base INTERFACE Boost::${Boost_Python_Lib} "Boost::numpy${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")',
176-
'target_link_libraries(rdkit_py_base INTERFACE Boost::${Boost_Python_Lib} "boost::numpy${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")',
175+
'target_link_libraries(rdkit_py_base INTERFACE "Boost::python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}" "Boost::numpy${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")',
176+
'target_link_libraries(rdkit_py_base INTERFACE "boost::python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}" "boost::numpy${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")',
177177
)
178178

179+
# on windows, cmake is not configured to detect the python*.lib dynamic library
180+
#
181+
# replace_all(
182+
# "CMakeLists.txt",
183+
# 'target_link_libraries(rdkit_py_base INTERFACE ${Python3_LIBRARIES} )',
184+
# 'message("HERE")\n message(${Python3_LIBRARIES})\n target_link_libraries(rdkit_py_base INTERFACE ${Python3_LIBRARIES} )',
185+
# )
186+
187+
# on windows; bug in 2024_03_6
188+
replace_all(
189+
"CMakeLists.txt",
190+
'target_link_libraries(rdkit_py_base INTERFACE ${Python3_LIBRARY} )',
191+
'target_link_libraries(rdkit_py_base INTERFACE ${Python3_LIBRARIES} )',
192+
)
179193

180194
if "macosx" in os.environ["CIBW_BUILD"]:
181195
# Replace Cairo with cairo because conan uses lower case target names
@@ -192,22 +206,28 @@ def replace_all(file, search_exp, replace_exp):
192206
)
193207

194208

209+
210+
print("---- Conf vars", file=sys.stderr)
211+
print(sysconfig.get_paths(), file=sys.stderr)
212+
print(sysconfig.get_config_vars(), file=sys.stderr)
213+
print("---- Conf vars", file=sys.stderr)
214+
215+
195216
# Define CMake options
196217
options = [
218+
# f"-DCMAKE_FIND_DEBUG_MODE=ON", # Enable debug mode
197219
f"-DCMAKE_TOOLCHAIN_FILE={conan_toolchain_path / 'conan_toolchain.cmake'}",
198220
# For the toolchain file this needs to be set
199221
f"-DCMAKE_POLICY_DEFAULT_CMP0091=NEW",
200222
# Boost_VERSION_STRING is set but Boost_LIB_VERSION is not set by conan.
201223
# Boost_LIB_VERSION is required by RDKit => Set manually
202224
f"-DBoost_LIB_VERSION={boost_lib_version}",
203-
# Select correct python interpreter
204-
f"-DPYTHON_EXECUTABLE={sys.executable}",
205-
f"-DPYTHON_INCLUDE_DIR={get_paths()['include']}",
225+
# Select correct python 3 version
226+
f"-DPython3_ROOT_DIR={Path(sys.prefix)}",
206227
# RDKit build flags
207228
"-DRDK_BUILD_INCHI_SUPPORT=ON",
208229
"-DRDK_BUILD_AVALON_SUPPORT=ON",
209230
"-DRDK_BUILD_PYTHON_WRAPPERS=ON",
210-
"-DRDK_BOOST_PYTHON3_NAME=python", # Overwrite this. This is the name of the interface in cmake defined by conan.
211231
"-DRDK_BUILD_YAEHMOP_SUPPORT=ON",
212232
"-DRDK_BUILD_XYZ2MOL_SUPPORT=ON",
213233
"-DRDK_INSTALL_INTREE=OFF",
@@ -228,17 +248,17 @@ def replace_all(file, search_exp, replace_exp):
228248
vcpkg_path = cwd
229249
vcpkg_inc = vcpkg_path / "vcpkg_installed" / "x64-windows" / "include"
230250
vcpkg_lib = vcpkg_path / "vcpkg_installed" / "x64-windows" / "lib"
251+
231252
if sys.platform == "win32":
253+
def to_win_path(pt: Path):
254+
return str(pt).replace("\\", "/")
255+
232256
options += [
233-
"-Ax64",
234257
# DRDK_INSTALL_STATIC_LIBS should be fixed in newer RDKit builds. Remove?
235258
"-DRDK_INSTALL_STATIC_LIBS=OFF",
236259
"-DRDK_INSTALL_DLLS_MSVC=ON",
237260
]
238261

239-
def to_win_path(pt: Path):
240-
return str(pt).replace("\\", "/")
241-
242262
# Link cairo and freetype
243263
options += [
244264
f"-DCAIRO_INCLUDE_DIR={to_win_path(vcpkg_inc)}",
@@ -277,13 +297,19 @@ def to_win_path(pt: Path):
277297
if "linux" in sys.platform:
278298
# Use ninja for linux builds
279299
cmds = [
280-
f"cmake -S . -B build -G Ninja {' '.join(options)} ",
300+
f"cmake -S . -B build -G Ninja --debug-find-pkg=Python3 {' '.join(options)} ",
281301
"cmake --build build --config Release",
282302
"cmake --install build",
283303
]
304+
elif sys.platform == "win32":
305+
cmds = [
306+
f"cmake -S . -B build --debug-find-pkg=Python3 {' '.join(options)} ",
307+
"cmake --build build --config Release -v",
308+
"cmake --install build",
309+
]
284310
else:
285311
cmds = [
286-
f"cmake -S . -B build {' '.join(options)} ",
312+
f"cmake -S . -B build --debug-find-pkg=Python3 {' '.join(options)} ",
287313
"cmake --build build --config Release",
288314
"cmake --install build",
289315
]

0 commit comments

Comments
 (0)