From 3df4fa53095a1ff0ae40584afcc769287f2b90e7 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Mon, 29 Jan 2024 22:33:54 +0100 Subject: [PATCH] Upgraded to pybind11 >2.6 --- CMakeLists.txt | 11 ++++++++--- environment-dev.yml | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1bd077..312ccd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,13 +45,18 @@ else() find_package(xtensor ${xtensor_REQUIRED_VERSION} REQUIRED) message(STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS}/xtensor") endif() - -# Currently no required version for pybind11 + +# Running find_package(PythonInterp) to retrieve the Python version +# which is not exported by Pybind11's cmake. +# Cf. https://github.com/pybind/pybind11/issues/2268 +find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} REQUIRED) + +set(pybind11_REQUIRED_VERSION 2.6.1) if(TARGET pybind11 OR TARGET pybind11::headers) # pybind11 has a variable that indicates its version already, so use that message(STATUS "Found pybind11 v${pybind11_VERSION}") else() - find_package(pybind11 REQUIRED) + find_package(pybind11 ${pybind11_REQUIRED_VERSION} REQUIRED) message(STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS}/pybind11") endif() diff --git a/environment-dev.yml b/environment-dev.yml index d9fbd45..9eca6e7 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -6,9 +6,9 @@ dependencies: - cmake - ninja # Host dependencies - - xtensor=0.24.0 + - xtensor>=0.24,<0.25 - numpy - - pybind11=2.4.3 + - pybind11>=2.6.1,<3 # Test dependencies - pytest