From 5b275d8381667ff2bf23f5cddc84a6da41778431 Mon Sep 17 00:00:00 2001 From: Lukas Platz Date: Thu, 27 May 2021 20:59:42 +0200 Subject: [PATCH] fix docs python bindings The documentation on the python bindings was deprecated: - enoki requires a C++17 capable compiler to build. The given CMakeLists.txt file only tested for C++14 compatibility - the `vectorize_wrapper` function was moved to the `dynamic.h` header file in 7b566930, so this header has to be imported by the example, too. --- docs/python.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/python.rst b/docs/python.rst index 2409c144..d372e387 100644 --- a/docs/python.rst +++ b/docs/python.rst @@ -26,6 +26,7 @@ Extension module .. code-block:: cpp #include + #include /* Import pybind11 and Enoki namespaces */ namespace py = pybind11; @@ -198,13 +199,13 @@ various platforms. "MinSizeRel" "RelWithDebInfo") endif() - # Enable C++14 support + # Enable C++17 support if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|Intel") - CHECK_CXX_COMPILER_FLAG("-std=c++14" HAS_CPP14_FLAG) - if (HAS_CPP14_FLAG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") + CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CPP17_FLAG) + if (HAS_CPP17_FLAG) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") else() - message(FATAL_ERROR "Unsupported compiler -- C++14 support is needed!") + message(FATAL_ERROR "Unsupported compiler -- C++17 support is needed!") endif() endif() @@ -228,8 +229,8 @@ Reference Please refer to pybind11's extensive `documentation `_. for details on -using it in general. The :file:`enoki/python.h` API only provides one public -function: +using it in general. The import of :file:`enoki/dynamic.h` is needed for +the automatic dynamic array compatibility: .. cpp:function:: template auto vectorize_wrapper(Func func)