diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ec965f521..18fd7487d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: cxx_compiler: clang++ cxx_std: 17 openexr_ver: v3.1.13 - pybind11_ver: v2.6.2 + pybind11_ver: v2.7.0 python_ver: 3.7 simd: "avx2,f16c" fmt_ver: 8.1.1 @@ -147,9 +147,10 @@ jobs: python_ver: "3.11" simd: "avx2,f16c" fmt_ver: 10.1.1 - pybind11_ver: v2.10.0 - - desc: oldest gcc9.3/C++17 py3.7 exr-3.1 - # Oldest versions of the dependencies that we support. + pybind11_ver: v2.12.0 + - desc: oldest/hobbled gcc9.3/C++17 py3.7 exr-3.1 no-sse no-ocio + # Oldest versions of the dependencies that we can muster, and various + # things disabled (no SSE, OCIO, or OpenCV, don't embed plugins). nametag: linux-oldest runner: ubuntu-latest container: aswf/ci-osl:2021 @@ -157,7 +158,7 @@ jobs: cxx_std: 17 fmt_ver: 7.0.1 openexr_ver: v3.1.0 - pybind11_ver: v2.4.2 + pybind11_ver: v2.7.0 python_ver: 3.7 setenvs: export CMAKE_VERSION=3.15.5 PTEX_VERSION=v2.3.2 @@ -174,7 +175,7 @@ jobs: cxx_std: 17 fmt_ver: 7.0.1 openexr_ver: v3.1.0 - pybind11_ver: v2.4.2 + pybind11_ver: v2.7.0 python_ver: 3.7 simd: 0 setenvs: export EMBEDPLUGINS=0 @@ -304,7 +305,7 @@ jobs: cxx_std: 17 fmt_ver: 10.1.1 openexr_ver: v3.2.4 - pybind11_ver: v2.11.1 + pybind11_ver: v2.12.0 python_ver: "3.10" simd: avx2,f16c setenvs: export LIBJPEGTURBO_VERSION=3.0.1 @@ -373,7 +374,7 @@ jobs: cxx_std: 20 fmt_ver: 10.1.1 openexr_ver: v3.1.13 - pybind11_ver: v2.9.2 + pybind11_ver: v2.12.0 python_ver: 3.8 simd: avx2,f16c setenvs: export LLVM_VERSION=14.0.0 @@ -388,7 +389,7 @@ jobs: python_ver: 3.8 simd: sse4.2 openexr_ver: v3.1.13 - pybind11_ver: v2.6.2 + pybind11_ver: v2.7.0 setenvs: export CMAKE_BUILD_TYPE=Debug PUGIXML_VERSION=v1.9 CTEST_TEST_TIMEOUT=1200 @@ -399,7 +400,7 @@ jobs: cxx_std: 17 openexr_ver: v3.1.13 python_ver: 3.8 - pybind11_ver: v2.6.2 + pybind11_ver: v2.7.0 setenvs: export BUILD_SHARED_LIBS=OFF depcmds: | sudo rm -rf /usr/local/include/OpenEXR diff --git a/INSTALL.md b/INSTALL.md index 12d96bbd89..dd990924d5 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -36,8 +36,7 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**. * OpenGL * If you are building the Python bindings or running the testsuite: * **Python >= 3.7** (tested through 3.12) - * pybind11 >= 2.4.2 (Tested through 2.12. Note that pybind11 v2.10+ does - not support Python < 3.6.) + * **pybind11 >= 2.7** (tested through 2.12) * NumPy * If you want support for camera "RAW" formats: * **LibRaw >= 0.20** (tested though 0.21.2) diff --git a/src/build-scripts/build_pybind11.bash b/src/build-scripts/build_pybind11.bash index 178f944517..7a0dc20563 100755 --- a/src/build-scripts/build_pybind11.bash +++ b/src/build-scripts/build_pybind11.bash @@ -11,7 +11,7 @@ set -ex # Repo and branch/tag/commit of pybind11 to download if we don't have it yet PYBIND11_REPO=${PYBIND11_REPO:=https://github.com/pybind/pybind11.git} -PYBIND11_VERSION=${PYBIND11_VERSION:=v2.8.1} +PYBIND11_VERSION=${PYBIND11_VERSION:=v2.12.0} # Where to put pybind11 repo source (default to the ext area) PYBIND11_SRC_DIR=${PYBIND11_SRC_DIR:=${PWD}/ext/pybind11} diff --git a/src/cmake/build_pybind11.cmake b/src/cmake/build_pybind11.cmake new file mode 100644 index 0000000000..a80c1acd2c --- /dev/null +++ b/src/cmake/build_pybind11.cmake @@ -0,0 +1,36 @@ +# Copyright Contributors to the OpenImageIO project. +# SPDX-License-Identifier: Apache-2.0 +# https://github.com/AcademySoftwareFoundation/OpenImageIO + +###################################################################### +# pybind11 by hand! +###################################################################### + +set_cache (pybind11_BUILD_VERSION 2.12.0 "pybind11 version for local builds") +set (pybind11_GIT_REPOSITORY "https://github.com/pybind/pybind11") +set (pybind11_GIT_TAG "v${pybind11_BUILD_VERSION}") +set_cache (pybind11_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT} + DOC "Should a local pybind11 build, if necessary, build shared libraries" ADVANCED) + +string (MAKE_C_IDENTIFIER ${pybind11_BUILD_VERSION} pybind11_VERSION_IDENT) + +build_dependency_with_cmake(pybind11 + VERSION ${pybind11_BUILD_VERSION} + GIT_REPOSITORY ${pybind11_GIT_REPOSITORY} + GIT_TAG ${pybind11_GIT_TAG} + CMAKE_ARGS + -D PYBIND11_PYTHON_VERSION=${PYTHON3_VERSION} + # Don't built unnecessary parts of Pybind11 + -D BUILD_TESTING=OFF + -D PYBIND11_TEST=OFF + ) + + +# Signal to caller that we need to find again at the installed location +set (pybind11_REFIND TRUE) +set (pybind11_REFIND_ARGS CONFIG) +set (pybind11_REFIND_VERSION ${pybind11_BUILD_VERSION}) + +if (pybind11_BUILD_SHARED_LIBS) + install_local_dependency_libs (pybind11 pybind11) +endif () diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake index d6b8a53294..698fcb1b29 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake @@ -106,7 +106,7 @@ endif() # From pythonutils.cmake find_python() if (USE_PYTHON) - checked_find_package (pybind11 REQUIRED VERSION_MIN 2.4.2) + checked_find_package (pybind11 REQUIRED VERSION_MIN 2.7) endif ()