[onert] Suggestion to modify unnecessary code according to pybind11 update
jaemaning opened this issue · comments
Background
Recently, I discovered that a long-standing bug in pybind11 has been fixed. This fix eliminates the need to directly import Python development components (libs, headers) from various Linux environments.
Reference to the current implementation:
ONE/runtime/onert/api/python/CMakeLists.txt
Lines 5 to 26 in 30d45e8
Proposed Change
Given this fix, I suggest updating the code to the following:
# Install pybind11
nnfw_find_package(Pybind11 REQUIRED)
if(NOT Pybind11_FOUND)
message(STATUS "Build onert/python: FAILED (Pybind11 is missing)")
return()
endif()
Opinion
I would like to know your thoughts on this proposed change.
Reference
For more details on the bug fix, please see: pybind/pybind11#4805
Thanks your suggestion. Then we need to use more latest pybind11 version, right? (not currently using v2.11.1)
I understand that ONE is currently using pybind v2.11.1.
ONE/infra/cmake/packages/Pybind11SourceConfig.cmake
Lines 10 to 11 in 0d7274f
And the above application requires the use of pybind 2.12.0 releasing version.
Pybind11 Version 2.12.0 - bug fixes List
If it is okay to use the currently released version of pybind11 v2.12.0, I will test it.
Reference
Based on release note, this feature works on cmake 3.18+.
Since we are using cmake 3.16.3 (ubuntu 20.04's default cmake version), we cannot use this feature.
oh, I didn't check the cmake version
Thanks for checking this
@jaemaning Thank you for inform us about this. When we ready to upgrade cmake version, we can use this feature.