kaldi-python
kaldi-python copied to clipboard
[Solved] Compiling errors when making (with the latest kaldi toolkit)
--Updated 11/29/2017 The problem is solved by using older kaldi toolkit (the version committed on 9/9/2017).
--Original
First sorry for my poor English.
I'm trying to install kaldi-python, but I received compiling errors(see below) when making. I don't know whether it is because I'm using the wrong boost library, which I installed with sudo apt-get libboost-dev-all
.
And the GCC version I'm using is 5.4.0(on Ubuntu 16.04).
Sincerely.
The errors are like:
In file included from /home/jian/Downloads/repository/kaldi/src/util/kaldi-table.h:470:0,
from kaldi_io_internal.cpp:37:
/home/jian/Downloads/repository/kaldi/src/util/kaldi-table-inl.h: In instantiation of ‘kaldi::SequentialTableReaderBackgroundImpl<Holder>::T& kaldi::SequentialTableReaderBackgroundImpl<Holder>::Value() [with Holder = PythonToKaldiHolder<BoostPythonconverter<std::vector<std::pair<int, int> >, kaldi::BasicPairVectorHolder<int>, kaldi::BasicPairVectorHolder<int> > >; kaldi::SequentialTableReaderBackgroundImpl<Holder>::T = boost::python::api::object]’:
kaldi_io_internal.cpp:510:1: required from here
/home/jian/Downloads/repository/kaldi/src/util/kaldi-table-inl.h:782:26: error: binding ‘const T {aka const boost::python::api::object}’ to reference of type ‘kaldi::SequentialTableReaderBackgroundImpl<PythonToKaldiHolder<BoostPythonconverter<std::vector<std::pair<int, int> >, kaldi::BasicPairVectorHolder<int>, kaldi::BasicPairVectorHolder<int> > > >::T& {aka boost::python::api::object&}’ discards qualifiers
return holder_.Value();
and
/usr/include/boost/python/detail/invoke.hpp: In instantiation of ‘PyObject* boost::python::detail::invoke(boost::python::detail::invoke_tag_<false, true>, const RC&, F&, TC&) [with RC = boost::python::detail::copy_const_reference_expects_a_const_reference_return_type<boost::python::api::object&>; F = boost::python::api::object& (kaldi::SequentialTableReader<PythonToKaldiHolder<BoostPythonconverter<std::vector<std::pair<int, int> >, kaldi::BasicPairVectorHolder<int>, kaldi::BasicPairVectorHolder<int> > > >::*)(); TC = boost::python::arg_from_python<kaldi::SequentialTableReader<PythonToKaldiHolder<BoostPythonconverter<std::vector<std::pair<int, int> >, kaldi::BasicPairVectorHolder<int>, kaldi::BasicPairVectorHolder<int> > > >&>; PyObject = _object]’:
/usr/include/boost/python/detail/caller.hpp:218:46: required from ‘PyObject* boost::python::detail::caller_arity<1u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = boost::python::api::object& (kaldi::SequentialTableReader<PythonToKaldiHolder<BoostPythonconverter<std::vector<std::pair<int, int> >, kaldi::BasicPairVectorHolder<int>, kaldi::BasicPairVectorHolder<int> > > >::*)(); Policies = boost::python::return_value_policy<boost::python::copy_const_reference>; Sig = boost::mpl::vector2<boost::python::api::object&, kaldi::SequentialTableReader<PythonToKaldiHolder<BoostPythonconverter<std::vector<std::pair<int, int> >, kaldi::BasicPairVectorHolder<int>, kaldi::BasicPairVectorHolder<int> > > >&>; PyObject = _object]’
/usr/include/boost/python/object/py_function.hpp:38:33: required from ‘PyObject* boost::python::objects::caller_py_function_impl<Caller>::operator()(PyObject*, PyObject*) [with Caller = boost::python::detail::caller<boost::python::api::object& (kaldi::SequentialTableReader<PythonToKaldiHolder<BoostPythonconverter<std::vector<std::pair<int, int> >, kaldi::BasicPairVectorHolder<int>, kaldi::BasicPairVectorHolder<int> > > >::*)(), boost::python::return_value_policy<boost::python::copy_const_reference>, boost::mpl::vector2<boost::python::api::object&, kaldi::SequentialTableReader<PythonToKaldiHolder<BoostPythonconverter<std::vector<std::pair<int, int> >, kaldi::BasicPairVectorHolder<int>, kaldi::BasicPairVectorHolder<int> > > >&> >; PyObject = _object]’
kaldi_io_internal.cpp:510:1: required from here
/usr/include/boost/python/detail/invoke.hpp:88:14: error: no match for call to ‘(const boost::python::detail::copy_const_reference_expects_a_const_reference_return_type<boost::python::api::object&>) (boost::python::api::object&)’
return rc( (tc().*f)(BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, ac, () BOOST_PP_INTERCEPT)) );
Hi Elecky, I encounter the same error. How did you solve this problem?
@junjunmin The problem is solved by using older kaldi toolkit (the version committed on 9/9/2017), you can give it a try.
FYI it looks like the cause of the error is this line changing in kaldi-table.h: const T &Value();
to T &Value();
which now doesn't match with const T &Value() const {return t_;}
in kaldi_io_internal.cpp.
I encountered this recently. Can this be solved by modifying the source code in 'kaldi_io_internal.cpp'? @jfainberg
@zhange1990 Possibly, yes. I'm sorry I don't remember if I tried or what the outcome was...
Thank you all the same~ Best wishes~ 841412407 邮箱[email protected] 签名由 网易邮箱大师 定制 On 02/24/2020 23:37, Joachim Fainberg wrote: @zhange1990 Possibly, yes. I'm sorry I don't remember if I tried or what the outcome was... — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
I encountered this recently. Is it required to set the boost lib to a specific version? @Elecky @janchorowski
I have encountered this problem.. Tried with older version of kaldi(5.2) but still facing the error.. error: no match for call to ‘(const boost::python::detail::copy_const_reference_expects_a_const_reference_return_typeboost::python::api::object&) (boost::python::api::object&)’