robotlearn / raisimpy

Raisimpy: Python wrappers for RaiSim
MIT License
40 stars 11 forks source link

Compiling and installing on ubuntu 18.04 #3

Closed kekeblom closed 5 years ago

kekeblom commented 5 years ago

Tried to install the package but the install fails while compiling.

I'm running pybind11 version 2.3.0, python 3, Ubuntu 18.04.

I can successfully compile and install raisimLib, raisimOgre and pybind11. The raisimOgre examples run just fine on my system.

The error when running make install is:

In file included from /usr/include/c++/7/bits/stl_iterator_base_types.h:67:0,                                                                                                                                      
                 from /usr/include/c++/7/bits/forward_list.h:36,                                                                                                                                                   
                 from /usr/include/c++/7/forward_list:38,                                                                                                                                                          
                 from $LOCAL_BUILD/include/pybind11/detail/common.h:140,                                                                                                                             
                 from $LOCAL_BUILD/include/pybind11/pytypes.h:12,                                                                                                                                    
                 from $LOCAL_BUILD/include/pybind11/cast.h:13,                                                                                                                                       
                 from $LOCAL_BUILD/include/pybind11/attr.h:13,                                                                                                                                       
                 from $LOCAL_BUILD/include/pybind11/pybind11.h:49,                                                                                                                                   
                 from raisimpy/src/articulated_system.cpp:25:
/usr/include/c++/7/type_traits: In instantiation of ‘struct std::is_base_of<Eigen::MapBase<dxTriMeshData, 0>, dxTriMeshData>’:                                                                                     
$LOCAL_BUILD/include/pybind11/stl.h:183:5:   recursively required by substitution of ‘template<class Type> struct pybind11::detail::type_caster<Type, typename std::enable_if<std::is_same<pybind11::
detail::bools<decltype (pybind11::detail::is_template_base_of_impl<Eigen::EigenBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, pybind11::detail::negation<pybind11::detail::n
egation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_same<pybind11::detail::bools<decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::deta
il::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value, true>, pybind11::detail::bools<true, decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>
::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value> > >::value, pybind11::detail::negation<std::is_same<pybind11::detail::bools
<pybind11::detail::negation<std::is_same<pybind11::detail::bools<decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::va
lue, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value, true>, pybind11::detail::bools<true, decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsi
c_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value> > >::value, decltype (pybind11::detail::is_template_base_of_impl<Eigen::PlainObjectBase>::check((typename pybind11::det
ail::intrinsic_type<T>::type*)(nullptr)))::value, true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_same<pybind11::detail::bools<decltype (pybind11::detail::is_template_base_of_impl<Eigen::
DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value, true>, pybind11::detail::bools<true, decltype (pybind11::detail::
is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value> > >::value, decltype (pybind11::d
etail::is_template_base_of_impl<Eigen::PlainObjectBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value> > >::value, pybind11::detail::negation<decltype (pybind11::detail::is_templ
ate_base_of_impl<Eigen::SparseMatrixBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))>::value, true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_same<pybind11::d
etail::bools<decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>:
:value, true>, pybind11::detail::bools<true, decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of
<Eigen::MapBase<Derived, 0>, T>::value> > >::value, pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_same<pybind11::detail::bools<decltype (pybind11::detail::is_
template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value, true>, pybind11::detail::bools<true,
 decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value> > >:
:value, decltype (pybind11::detail::is_template_base_of_impl<Eigen::PlainObjectBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, true>, pybind11::detail::bools<true, pybind11:
:detail::negation<std::is_same<pybind11::detail::bools<decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::
is_base_of<Eigen::MapBase<Derived, 0>, T>::value, true>, pybind11::detail::bools<true, decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>:
:type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value> > >::value, decltype (pybind11::detail::is_template_base_of_impl<Eigen::PlainObjectBase>::check((typename pybind11::detail::intri
nsic_type<T>::type*)(nullptr)))::value> > >::value, pybind11::detail::negation<decltype (pybind11::detail::is_template_base_of_impl<Eigen::SparseMatrixBase>::check((typename pybind11::detail::intrinsic_type<T>::
type*)(nullptr)))>::value> > > >::value, true>, pybind11::detail::bools<true, decltype (pybind11::detail::is_template_base_of_impl<Eigen::EigenBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(n
ullptr)))::value, pybind11::detail::negation<pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_same<pybind11::detail::bools<decltype (pybind11::detail::is_templat
e_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value, true>, pybind11::detail::bools<true, declty
pe (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value> > >::value,
 pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std::is_same<pybind11::detail::bools<decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typ
ename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value, true>, pybind11::detail::bools<true, decltype (pybind11::detail::is_template_base_of_im
pl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value> > >::value, decltype (pybind11::detail::is_template_bas
e_of_impl<Eigen::PlainObjectBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_same<pybind11::detail::bo
ols<decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value, t
rue>, pybind11::detail::bools<true, decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::M
apBase<Derived, 0>, T>::value> > >::value, decltype (pybind11::detail::is_template_base_of_impl<Eigen::PlainObjectBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value> > >::value,
 pybind11::detail::negation<decltype (pybind11::detail::is_template_base_of_impl<Eigen::SparseMatrixBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))>::value, true>, pybind11::detail:
:bools<true, pybind11::detail::negation<std::is_same<pybind11::detail::bools<decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nu
llptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value, true>, pybind11::detail::bools<true, decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::deta
il::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value> > >::value, pybind11::detail::negation<std::is_same<pybind11::detail::bools<pybind11::detail::negation<std:
:is_same<pybind11::detail::bools<decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapB
ase<Derived, 0>, T>::value, true>, pybind11::detail::bools<true, decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::va
lue, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value> > >::value, decltype (pybind11::detail::is_template_base_of_impl<Eigen::PlainObjectBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(n
ullptr)))::value, true>, pybind11::detail::bools<true, pybind11::detail::negation<std::is_same<pybind11::detail::bools<decltype (pybind11::detail::is_template_base_of_impl<Eigen::DenseBase>::check((typename pybi
nd11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value, true>, pybind11::detail::bools<true, decltype (pybind11::detail::is_template_base_of_impl<Eigen::
DenseBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value, std::is_base_of<Eigen::MapBase<Derived, 0>, T>::value> > >::value, decltype (pybind11::detail::is_template_base_of_impl<
Eigen::PlainObjectBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))::value> > >::value, pybind11::detail::negation<decltype (pybind11::detail::is_template_base_of_impl<Eigen::SparseMa
trixBase>::check((typename pybind11::detail::intrinsic_type<T>::type*)(nullptr)))>::value> > > >::value> >::value, void>::type> [with Type = dxTriMeshData]’
$LOCAL_BUILD/include/pybind11/stl.h:183:5:   required from ‘constexpr const auto pybind11::detail::list_caster<std::vector<dxTriMeshData*>, dxTriMeshData*>::name’

$WORKSPACE/raisimpy/src/articulated_system.cpp:699:125:   required from here
/usr/include/c++/7/type_traits:1512:12: error: invalid use of incomplete type ‘struct dxTriMeshData’
     struct is_base_of

It seems pybind11 is not able to deal with the dxTriMeshData struct.

jhwangbo commented 5 years ago

Confirmed the issue. The current version only works with raisimLib v0.3.0. I am working on updating raisimpy

jhwangbo commented 5 years ago

Sent a PR #4. This should work. and this PR fixes a major bug in raisimpy so don't use an old version

bdelhaisse commented 5 years ago

Yep, this bug is due to the following recent commit in raisimLib "experimental mesh collision body added": https://github.com/leggedrobotics/raisimLib/commit/0fe98b2479595412fdc2f70c01b052ce8391142b The signature of init_collision_bodies (initCollisionBodies in C++) has changed in that version of raisim (v0.4.0), where the dxTriMeshData structure is now being used. Pybind11 is complaining because it has no idea of what type it is. I just merged the PR sent by @jhwangbo where the init_collision_bodies function has been removed from raisimpy, so it shouldn't raise that error anymore. The other solution would have been to wrap dxTriMeshData, include the file containing its definition in the src/articulated_system.cpp, and change the signature of init_collision_bodies, but I suppose @jhwangbo deleted that method because it is used internally by raisimLib, and was not needed to be exposed in Python.

@kekeblom Let us know how the installation goes.

kekeblom commented 5 years ago

Now it installs fine. Thank you for the fast response.