scikit-build-core build failing due to find_package in project's submodule #972
-
I'm trying to learn/use scikit-build-core in my project here -> https://github.com/ltsaprounis/python-cpp-experiments The project is relatively simple but it has one submodule that is a git-submodule of the carma library. It all works fine with editable/non-editable installs if I remove the submodule and any code that uses it (check the no-carma branch in the repo). However with the carma submodule, scikit-build doesn't work. And to make things even more confusing, If I just build it using cmake and bypass scikit-build-core it all works fine. Looking at the error logs I spotted that the problem lies in lines 157-166 in the carma project's CMakeLitsts.txt file: find_package(
Python3
COMPONENTS Development NumPy
QUIET)
if(NOT Python3_FOUND)
find_package(
Python3
COMPONENTS Development.Module NumPy
REQUIRED)
endif() When I use cmake the first call to Below is the error logs I get from the failed installation:
I tried to set the variables for the python executable, include dir and library dir in the CMakeLists.txt file as suggested in #506 but didn't have much luck with that. I think it has to do with the python path that is passed along to carma's cmake from the scikit-build-core process, but I don't know how to debug this further. Any help/tips will be very appreciated! 🙏 Additional information:the project's pyproject.toml file: [build-system]
requires = ["scikit-build-core>=0.3.3", "pybind11"]
build-backend = "scikit_build_core.build"
[project]
name = "pycpp_experiments"
version = "0.0.1"
description = "A project for experimenting with python C++ bindings"
readme = "README.md"
requires-python=">=3.8,<3.11"
dependencies=[
"pybind11[global]>=2.6.0",
"numpy>=1.14",
]
# [tool.setuptools.packages]
# find = {}
[project.optional-dependencies]
dev = [
"flake8",
"black",
"pytest",
"pydocstyle",
"pre-commit",
"ipykernel",
]
[tool.pytest.ini_options]
addopts= "--ignore=pycpp/cpp/carma"
[tool.scikit-build]
# wheel.expand-macos-universal-tags = true
build-dir = "build"
logging.level = "INFO"
ninja.make-fallback = true
# This activates verbose builds
cmake.verbose = true
ninja.minimum-version = "1.5"
cmake.minimum-version = "3.25"
# cmake.args = ["-DPYTHON_EXECUTABLE=$(python3 -c 'import sys; print(sys.executable)')", "-DCMAKE_INSTALL_PREFIX:PATH=.."] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You are missing NumPy. You should probably add “numpy” (or, more likely “oldest-supported-numpy”) to your (traveling currently, can explain more later) |
Beta Was this translation helpful? Give feedback.
-
That was fast 🚀 I added "numpy" in If you add some more details when you have some more time, for the other people that stumble upon this discussion (and me of course) that would be great! |
Beta Was this translation helpful? Give feedback.
You are missing NumPy. You should probably add “numpy” (or, more likely “oldest-supported-numpy”) to your
build-system.requires
list.(traveling currently, can explain more later)