Building the Python wrappers within the RealsenseID SDK
I have spent the day trying to get this to build and was hoping someone can help or point me to the right direction.
Using Ubuntu 18. Python 3.9.13 Gcc 7.5.0 cmake 3.10.2
I have created the build directory and within that directory run the command:
cmake .. -DRSID_PREVIEW=ON -DRSID_SECURE=ON -DRSID_PY=ON
Make files build ok. I then typed:
make
Most of the binaries are compiled such as rsid_cli. However I get the error below which prevents the python wrappers from being built. Can anyone help?
Does the latest SDK support building the Python wrappers? I did go back to v0.23 of the SDK and that also failed to build with the same error.
Scanning dependencies of target rsid_py
[ 96%] Building CXX object wrappers/python/CMakeFiles/rsid_py.dir/rsid_py.cc.o
[ 97%] Building CXX object wrappers/python/CMakeFiles/rsid_py.dir/face_auth_py.cc.o
In file included from /usr/include/c++/7/memory:80:0,
from /home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/detail/common.h:162,
from /home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/pytypes.h:12,
from /home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/cast.h:13,
from /home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/attr.h:13,
from /home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/pybind11.h:45,
from /home/rukshan/Desktop/RealSenseID-0.25.0/wrappers/python/rsid_py.h:6,
from /home/rukshan/Desktop/RealSenseID-0.25.0/wrappers/python/face_auth_py.cc:7:
/usr/include/c++/7/bits/unique_ptr.h: In instantiation of ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = RealSenseID::FaceAuthenticator; _Args = {}; typename std::_MakeUniq<_Tp>::_single_object = std::unique_ptr<RealSenseID::FaceAuthenticator, std::default_deleteRealSenseID::FaceAuthenticator >]’:
/home/rukshan/Desktop/RealSenseID-0.25.0/wrappers/python/face_auth_py.cc:596:58: required from here
/usr/include/c++/7/bits/unique_ptr.h:821:30: error: no matching function for call to ‘RealSenseID::FaceAuthenticator::FaceAuthenticator()’
{ return unique_ptr<Tp>(new Tp(std::forward<Args>(args)...)); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/rukshan/Desktop/RealSenseID-0.25.0/wrappers/python/face_auth_py.cc:5:0:
/home/rukshan/Desktop/RealSenseID-0.25.0/src/../include/RealSenseID/FaceAuthenticator.h:39:14: note: candidate: RealSenseID::FaceAuthenticator::FaceAuthenticator(RealSenseID::SignatureCallback*)
explicit FaceAuthenticator(SignatureCallback* callback);
^~~~~~~~~~~~~~~~~
/home/rukshan/Desktop/RealSenseID-0.25.0/src/../include/RealSenseID/FaceAuthenticator.h:39:14: note: candidate expects 1 argument, 0 provided
In file included from /home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/pybind11.h:48:0,
from /home/rukshan/Desktop/RealSenseID-0.25.0/wrappers/python/rsid_py.h:6,
from /home/rukshan/Desktop/RealSenseID-0.25.0/wrappers/python/face_auth_py.cc:7:
/home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/detail/init.h: In instantiation of ‘Class* pybind11::detail::initimpl::construct_or_initialize(Args&& ...) [with Class = RealSenseID::FaceAuthenticator; Args = {}; typename std::enable_if<(! std::is_constructible<Tp, Args>::value), int>::type = 0]’:
/home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/detail/init.h:175:66: required from ‘pybind11::detail::initimpl::constructor::execute(Class&, const Extra& ...)::<lambda(pybind11::detail::value_and_holder&, Args ...)> [with Class = pybind11::classRealSenseID::FaceAuthenticator; Extra = {}; typename std::enable_if<(! Class:: has_alias), int>::type = 0; Args = {}]’
/home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/detail/init.h:174:29: required from ‘struct pybind11::detail::initimpl::constructor::execute(Class&, const Extra& ...) [with Class = pybind11::classRealSenseID::FaceAuthenticator; Extra = {}; typename std::enable_if<(! Class:: has_alias), int>::type = 0; Args = {}]::<lambda(struct pybind11::detail::value_and_holder&)>’
/home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/detail/init.h:174:9: required from ‘static void pybind11::detail::initimpl::constructor::execute(Class&, const Extra& ...) [with Class = pybind11::classRealSenseID::FaceAuthenticator; Extra = {}; typename std::enable_if<(! Class:: has_alias), int>::type = 0; Args = {}]’
/home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/pybind11.h:1346:9: required from ‘pybind11::class<type, options>& pybind11::class<type, options>::def(const pybind11::detail::initimpl::constructor<Args ...>&, const Extra& ...) [with Args = {}; Extra = {}; type = RealSenseID::FaceAuthenticator; options = {}]’
/home/rukshan/Desktop/RealSenseID-0.25.0/wrappers/python/face_auth_py.cc:594:26: required from here
/home/rukshan/Desktop/RealSenseID-0.25.0/build/3rdparty/pybind11/include/pybind11/detail/init.h:63:64: error: no matching function for call to ‘RealSenseID::FaceAuthenticator::FaceAuthenticator()’
inline Class construct_or_initialize(Args &&...args) { return new Class{std::forward(args)...}; }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/rukshan/Desktop/RealSenseID-0.25.0/wrappers/python/face_auth_py.cc:5:0:
/home/rukshan/Desktop/RealSenseID-0.25.0/src/../include/RealSenseID/FaceAuthenticator.h:39:14: note: candidate: RealSenseID::FaceAuthenticator::FaceAuthenticator(RealSenseID::SignatureCallback)
explicit FaceAuthenticator(SignatureCallback* callback);
^~~~~~~~~~~~~~~~~
/home/rukshan/Desktop/RealSenseID-0.25.0/src/../include/RealSenseID/FaceAuthenticator.h:39:14: note: candidate expects 1 argument, 0 provided
wrappers/python/CMakeFiles/rsid_py.dir/build.make:86: recipe for target 'wrappers/python/CMakeFiles/rsid_py.dir/face_auth_py.cc.o' failed
make[2]: *** [wrappers/python/CMakeFiles/rsid_py.dir/face_auth_py.cc.o] Error 1
CMakeFiles/Makefile2:1388: recipe for target 'wrappers/python/CMakeFiles/rsid_py.dir/all' failed
make[1]: *** [wrappers/python/CMakeFiles/rsid_py.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
-
Hi Rukshan Fonseka,
I also faced the same error when building Python wrapper with the latest RealSenseID SDK. However, using RealSenseID SDK version v0.23.0 worked for me.
Sharing my steps:
sudo rm -r RealSenseID
git clone -b v0.23.0 https://github.com/IntelRealSense/RealSenseID.git
cd RealSenseID
mkdir build && cd build
cmake -DRSID_PREVIEW=ON -DRSID_SECURE=ON -DRSID_PY=ON -DRSID_SAMPLES=1 ..
make
Regards,
Yu Chern
-
I've tried your instructions but still get the same issue. Can you tell me what version of Ubuntu, gcc, g++, python etc you are using so that I can match the versions?
/home/rukshan/RealSenseID/wrappers/python/face_auth_py.cc:594:26: required from here
/home/rukshan/RealSenseID/build/3rdparty/pybind11/include/pybind11/detail/init.h:63:64: error: no matching function for call to ‘RealSenseID::FaceAuthenticator::FaceAuthenticator(<brace-enclosed initializer list>)’
inline Class *construct_or_initialize(Args &&...args) { return new Class{std::forward<Args>(args)...}; }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/rukshan/RealSenseID/wrappers/python/face_auth_py.cc:5:0:
/home/rukshan/RealSenseID/src/../include/RealSenseID/FaceAuthenticator.h:39:14: note: candidate: RealSenseID::FaceAuthenticator::FaceAuthenticator(RealSenseID::SignatureCallback*)
explicit FaceAuthenticator(SignatureCallback* callback);
^~~~~~~~~~~~~~~~~
/home/rukshan/RealSenseID/src/../include/RealSenseID/FaceAuthenticator.h:39:14: note: candidate expects 1 argument, 0 provided
wrappers/python/CMakeFiles/rsid_py.dir/build.make:86: recipe for target 'wrappers/python/CMakeFiles/rsid_py.dir/face_auth_py.cc.o' failed
make[2]: *** [wrappers/python/CMakeFiles/rsid_py.dir/face_auth_py.cc.o] Error 1
CMakeFiles/Makefile2:1388: recipe for target 'wrappers/python/CMakeFiles/rsid_py.dir/all' failed
make[1]: *** [wrappers/python/CMakeFiles/rsid_py.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Please sign in to leave a comment.
Comments
3 comments