IntelRealSense / RealSenseID

Intel® RealSense™ ID SDK
https://intelrealsense.com/facial-authentication/
Apache License 2.0
98 stars 56 forks source link

Building the python wrappers in Ubuntu 18 #147

Open rukshanfonseka opened 2 years ago

rukshanfonseka commented 2 years ago

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?

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_delete >]’: /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_andholder&, Args ...)> [with Class = pybind11::class; Extra = {}; typename std::enable_if<(! Class:: hasalias), 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::class; Extra = {}; typename std::enable_if<(! Class:: has_alias), int>::type = 0; Args = {}]::<lambda(struct pybind11::detail::value_andholder&)>’ /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::class; Extra = {}; typename std::enable_if<(! Class:: hasalias), 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