Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion interfaces/python_sdist/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Set minimum version 3.27 so that CMP0144, search for packages by upper-cased
# environment variables will use upper-cased variables. OLD behavior is to ignore
# upper-cased variables
cmake_minimum_required(VERSION 3.27...3.31)
cmake_minimum_required(VERSION 3.27...4.4)
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
Expand Down
1 change: 1 addition & 0 deletions interfaces/python_sdist/build_pyodide_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def main() -> int:
env = dict(os.environ)
env["CANTERA_PYODIDE"] = "ON"
cmake_args = env.get("CMAKE_ARGS", "").strip()
# Disable C++ module scanning to avoid incompatible compiler flags with Emscripten
pyodide_cmake_args = "-DCMAKE_CXX_SCAN_FOR_MODULES=OFF"
env["CMAKE_ARGS"] = f"{cmake_args} {pyodide_cmake_args}".strip()
if "Boost_INCLUDE_DIRS" not in env and (conda_prefix := env.get("CONDA_PREFIX")):
Expand Down
16 changes: 9 additions & 7 deletions interfaces/python_sdist/pyproject.toml.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["scikit-build-core", "cython @cython_version_spec@", "numpy>=2.0"]
requires = ["scikit-build-core>=1.0.3", "cython @cython_version_spec@", "numpy>=2.0"]
build-backend = "scikit_build_core.build"

[project]
Expand Down Expand Up @@ -64,20 +64,22 @@ lxcat2yaml = "cantera.lxcat2yaml:main"
[tool.scikit-build]
logging.level = "DEBUG"
build.verbose = true
minimum-version = "build-system.requires"

[tool.scikit-build.cmake]
version = ">=3.27,<4"

[tool.scikit-build.ninja]
version = ">=1.13"
make-fallback = false
version = "CMakeLists.txt"
Comment thread
bryanwweber marked this conversation as resolved.

[tool.scikit-build.cmake.define]
CMAKE_POSITION_INDEPENDENT_CODE = "ON"
CANTERA_PYODIDE = { env = "CANTERA_PYODIDE", default = "OFF" }
CMAKE_CXX_SCAN_FOR_MODULES = { env = "CMAKE_CXX_SCAN_FOR_MODULES", default = "OFF" }
Boost_INCLUDE_DIRS = { env = "Boost_INCLUDE_DIRS" }
HDF5_ROOT = { env = "HDF5_ROOT" }

[tool.scikit-build.ninja]
version = ">=1.13"
make-fallback = false

[tool.scikit-build.sdist]
exclude = ["pyproject.toml.in", "cantera/with_units/solution.py.in"]

Expand Down Expand Up @@ -115,7 +117,7 @@ test-command = "pytest -vv --durations=100 ${CANTERA_TEST_DIR}/test/python"

[tool.cibuildwheel.windows]
before-build = "pip install delvewheel"
repair-wheel-command = "delvewheel repair --add-path %HDF5_LIB_DIR%;%SUNDIALS_LIB_DIR% -w {dest_dir} {wheel}"
repair-wheel-command = "delvewheel repair --add-path %HDF5_LIB_DIR%;%SUNDIALS_LIB_DIR%;%YAML_CPP_LIB_DIR% -w {dest_dir} {wheel}"
Comment thread
bryanwweber marked this conversation as resolved.
test-command = "pytest -vv --durations=100 %CANTERA_TEST_DIR%\\test\\python"

[tool.cibuildwheel.macos]
Expand Down
24 changes: 15 additions & 9 deletions interfaces/python_sdist/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ else()
set(CT_USE_SYSTEM_HIGHFIVE 1)
endif()

set(EIGEN_VERSION 3.4.0)
set(EIGEN_VERSION 5.0.1)
FetchContent_Declare(
eigen
URL https://gitlab.com/libeigen/eigen/-/archive/${EIGEN_VERSION}/eigen-${EIGEN_VERSION}.tar.bz2
URL_HASH SHA256=b4c198460eba6f28d34894e3a5710998818515104d6e74e5cc331ce31e46e626
URL_HASH SHA256=e4de6b08f33fd8b8985d2f204381408c660bffa6170ac65b68ae1bd3cd575c0a
# FIND_PACKAGE_ARGS has to be the last thing in this call because it greedily takes
# everything after it to pass to `find_package()`
FIND_PACKAGE_ARGS NAMES Eigen3
# 3.4...5 means find any version between 3.4 and 5, inclusive. REQUIRED and NO_MODULE
# are suggested by the Eigen docs: https://libeigen.gitlab.io/eigen/docs-5.0/TopicCMakeGuide.html
# GLOBAL sets up eigen to be a target in sibling directories. Without GLOBAL the target
# is scoped to this directory only.
FIND_PACKAGE_ARGS NAMES Eigen3 3.4...5 REQUIRED NO_MODULE GLOBAL
)

set(YAML_CPP_VERSION 0.8.0)
Expand All @@ -30,32 +34,34 @@ FetchContent_Declare(
FIND_PACKAGE_ARGS NAMES yaml-cpp
)

set(SUNDIALS_VERSION 7.4.0)
set(SUNDIALS_VERSION 7.8.0)
FetchContent_Declare(
sundials
URL https://github.com/LLNL/sundials/releases/download/v${SUNDIALS_VERSION}/sundials-${SUNDIALS_VERSION}.tar.gz
URL_HASH SHA256=679ddacdd77610110e613164e8297d6d0cd35bae8e9c3afc8e8ff6f99a1c2a7b
URL_HASH SHA256=69ec92653e998e4841b59d363b3abf21299251991390f52917402737164ca574
# FIND_PACKAGE_ARGS has to be the last thing in this call because it greedily takes
# everything after it to pass to `find_package()`
FIND_PACKAGE_ARGS NAMES SUNDIALS
)

set(FMT_VERSION 11.2.0)
set(FMT_VERSION 12.2.0)
FetchContent_Declare(
fmt
URL https://github.com/fmtlib/fmt/releases/download/${FMT_VERSION}/fmt-${FMT_VERSION}.zip
URL_HASH SHA256=203eb4e8aa0d746c62d8f903df58e0419e3751591bb53ff971096eaa0ebd4ec3
URL_HASH SHA256=a2f4a8d51178f954e4c339007f77edd76ba0cb2e36f87a48e5a5403d9be5878f
# FIND_PACKAGE_ARGS has to be the last thing in this call because it greedily takes
# everything after it to pass to `find_package()`
# GLOBAL sets up fmt to be a target in sibling directories. Without GLOBAL the target
# is scoped to this directory only.
FIND_PACKAGE_ARGS NAMES fmt GLOBAL
)

if(CT_USE_HDF5)
set(HIGHFIVE_VERSION .3.1.1)
set(HIGHFIVE_VERSION 3.3.0)
FetchContent_Declare(
HighFive
URL https://github.com/highfive-devs/HighFive/archive/refs/tags/v${HIGHFIVE_VERSION}.tar.gz
URL_HASH SHA256=c0bc76b01868a133bf4550a07321923c5582fe3967edc102864b082e40799914
URL_HASH SHA256=325cfbcf0c0296a6dd26f3b088801b7ebb8d6f109c0565c11d2d8c4af3253bff
# FIND_PACKAGE_ARGS has to be the last thing in this call because it greedily takes
# everything after it to pass to `find_package()`
FIND_PACKAGE_ARGS NAMES HighFive
Expand Down
18 changes: 12 additions & 6 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ boost-cpp = ">=1.85.0,<2"
hdf5 = ">=1.14.6,<2"
highfive = ">=3.2.0,<4"
sundials = ">=7.6.0,<8"
eigen = ">=3.4.0,<6"
fmt = ">=12.1.0,<13"
yaml-cpp = ">=0.8.0,<0.9"
cython = ">=3.2.4,<4"
numpy = ">=2.4.2,<3"
python-build = ">=1.5.0,<2"
pip = ">=26.0.1,<27"
wheel = ">=0.46.3,<0.47"
setuptools = ">=82.0.0,<83"
Expand Down Expand Up @@ -92,6 +94,7 @@ python = "3.13.*"
scons = ">=4.10.1,<5"
boost-cpp = ">=1.85.0,<2"
cython = ">=3.2.4,<4"
eigen = ">=3.4,<6"
numpy = ">=2.4.2,<3"
"ruamel.yaml" = ">=0.19.1,<0.20"
pip = ">=26.0.1,<27"
Expand All @@ -104,22 +107,22 @@ nodejs = ">=25.2.1,<25.8"
make = ">=4.3,<5"

[feature.pyodide.pypi-dependencies]
build = ">=1.2.2.post1, <2"
scikit-build-core = ">=0.12.1, <0.13"
pyodide-build = ">=0.33.0, <0.34"
build = ">=1.2.2.post1,<2"
scikit-build-core = ">=1.0.3,<2"
pyodide-build = ">=0.33.0,<0.34"

# Native (non-Pyodide) build of the scikit-build-core/CMake sdist wheel. Layers the
# CMake toolchain onto the `core` dependencies so the sdist build route can be exercised
# on the platforms (Windows, macOS) that the Linux dev box can't. On Windows this must be
# run from a shell where the MSVC toolchain is activated (e.g. via vcvars64.bat), since
# cmake's Ninja generator needs `cl`/`link` on PATH.
[feature.wheel.dependencies]
cmake = ">=3.27,<4"
cmake = ">=3.27,<5"
ninja = ">=1.13.2,<2"
scikit-build-core = ">=1.0.3,<2"

[feature.wheel.pypi-dependencies]
build = ">=1.2.2.post1, <2"
scikit-build-core = ">=0.12.1, <0.13"
build = ">=1.5.0,<2"

[environments]
default = { features = ["core", "devtools", "docs", "samples"], no-default-feature = true }
Expand All @@ -131,3 +134,6 @@ wheel = { features = ["core", "wheel"], no-default-feature = true }

[feature.docs.tasks]
docs = "scons sphinx doxygen"

[feature.wheel.tasks]
sdist = "scons sdist"
Loading