Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Solved] Compiling errors when making (with the latest kaldi toolkit) #9

Open
CyanHillFox opened this issue Nov 28, 2017 · 8 comments

Comments

@CyanHillFox
Copy link

CyanHillFox commented Nov 28, 2017

--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)) );
@CyanHillFox CyanHillFox changed the title Compiling errors when making [Solved] Compiling errors when making Nov 29, 2017
@CyanHillFox CyanHillFox changed the title [Solved] Compiling errors when making [Solved] Compiling errors when making (with the latest kaldi toolkit) Nov 29, 2017
@junjunmin
Copy link

Hi Elecky, I encounter the same error. How did you solve this problem?

@CyanHillFox
Copy link
Author

@junjunmin
The problem is solved by using older kaldi toolkit (the version committed on 9/9/2017), you can give it a try.

@jfainberg
Copy link

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.

@zhange1990
Copy link

I encountered this recently.
Can this be solved by modifying the source code in 'kaldi_io_internal.cpp'?
@jfainberg

@jfainberg
Copy link

@zhange1990 Possibly, yes. I'm sorry I don't remember if I tried or what the outcome was...

@zhange1990
Copy link

zhange1990 commented Feb 24, 2020 via email

@zhange1990
Copy link

I encountered this recently.
Is it required to set the boost lib to a specific version?
@elecky @janchorowski

@ssnani
Copy link

ssnani commented Jun 19, 2022

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&)’

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants