eudoxos / minieigen

Boost::Python wrapper for parts of the Eigen c++ library
33 stars 15 forks source link

Unable to compile on recent Archlinux #18

Closed fxdupe closed 6 years ago

fxdupe commented 6 years ago

Using recent version of python (3.7.1), clang++ (7.0.0), eigen (3.3.5) and boost (1.68.0), I am unable to compile minieigen, instead I have an error related to MPL_ASSERT (see attached file bellow). Despite some research, I still don't understand where the error come from. Any ideas? minieigen.log

eudoxos commented 6 years ago

Confirming. Extracting the relevant error message part for clarity, same error is reported with gcc here; checking if this is caused by #16.

clang++ -DEIGEN_DONT_ALIGN -ansi minieigen.cpp expose-boxes.cpp expose-complex.cpp expose-converters.cpp expose-matrices.cpp expose-quaternion.cpp expose-vectors.cpp  double-conversion/bignum.cc double-conversion/bignum-dtoa.cc double-conversion/cached-powers.cc double-conversion/diy-fp.cc double-conversion/double-conversion.cc double-conversion/fast-dtoa.cc double-conversion/fixed-dtoa.cc double-conversion/strtod.cc -o minieigen.so -shared -fPIC `pkg-config python3 --cflags` -ftemplate-backtrace-limit=0 -lboost_python -I/usr/include/eigen3
In file included from expose-vectors.cpp:1:
In file included from ./visitors.hpp:2:
In file included from ./common.hpp:68:
In file included from /usr/include/boost/python.hpp:11:
In file included from /usr/include/boost/python/args.hpp:22:
In file included from /usr/include/boost/python/object_core.hpp:14:
In file included from /usr/include/boost/python/call.hpp:15:
In file included from /usr/include/boost/python/converter/arg_to_python.hpp:10:
In file included from /usr/include/boost/python/to_python_indirect.hpp:11:
In file included from /usr/include/boost/python/object/make_ptr_instance.hpp:8:
/usr/include/boost/python/object/make_instance.hpp:27:9: error: no matching function for call to 'assertion_failed'
        BOOST_MPL_ASSERT((mpl::or_<boost::python::detail::is_class<T>,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/mpl/assert.hpp:299:11: note: expanded from macro 'BOOST_MPL_ASSERT'
          boost::mpl::assertion_failed<false>( \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/mpl/assert.hpp:60:58: note: expanded from macro '\
BOOST_MPL_AUX_ASSERT_CONSTANT'
#   define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) enum { expr }
                                                         ^~~~
/usr/include/boost/python/to_python_indirect.hpp:105:59: note: in instantiation of function template specialization
      'boost::python::objects::make_instance_impl<double, boost::python::objects::pointer_holder<double *, double>,
      boost::python::objects::make_ptr_instance<double, boost::python::objects::pointer_holder<double *, double> > >::execute<double *>' requested here
          return objects::make_ptr_instance<T, holder_t>::execute(q);
                                                          ^
/usr/include/boost/python/to_python_indirect.hpp:67:28: note: in instantiation of function template specialization
      'boost::python::detail::make_reference_holder::execute<double>' requested here
        return MakeHolder::execute(p);
                           ^
/usr/include/boost/python/to_python_indirect.hpp:38:22: note: in instantiation of function template specialization
      'boost::python::to_python_indirect<double &, boost::python::detail::make_reference_holder>::execute<double>' requested here
        return this->execute(const_cast<U&>(ref), detail::is_pointer<U>());
                     ^
/usr/include/boost/python/detail/invoke.hpp:73:12: note: in instantiation of function template specialization 'boost::python::to_python_indirect<double
      &, boost::python::detail::make_reference_holder>::operator()<double>' requested here
    return rc(f( BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, ac, () BOOST_PP_INTERCEPT) ));
           ^
/usr/include/boost/python/detail/caller.hpp:216:40: note: in instantiation of function template specialization
      'boost::python::detail::invoke<boost::python::to_python_indirect<double &, boost::python::detail::make_reference_holder>, double
      &(*)(Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long), boost::python::arg_from_python<Eigen::Matrix<double, -1, 1, 0, -1, 1> &>,
      boost::python::arg_from_python<long> >' requested here
            PyObject* result = detail::invoke(
                                       ^
/usr/include/boost/python/object/py_function.hpp:38:16: note: in instantiation of member function 'boost::python::detail::caller_arity<2>::impl<double
      &(*)(Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long), boost::python::return_internal_reference<1, boost::python::default_call_policies>,
      boost::mpl::vector3<double &, Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long> >::operator()' requested here
        return m_caller(args, kw);
               ^
/usr/include/boost/python/object/py_function.hpp:32:5: note: in instantiation of member function
      'boost::python::objects::caller_py_function_impl<boost::python::detail::caller<double &(*)(Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long),
      boost::python::return_internal_reference<1, boost::python::default_call_policies>, boost::mpl::vector3<double &, Eigen::Matrix<double, -1, 1, 0,
      -1, 1> &, long> > >::operator()' requested here
    caller_py_function_impl(Caller const& caller)
    ^
/usr/include/boost/python/object/py_function.hpp:124:22: note: in instantiation of member function
      'boost::python::objects::caller_py_function_impl<boost::python::detail::caller<double &(*)(Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long),
      boost::python::return_internal_reference<1, boost::python::default_call_policies>, boost::mpl::vector3<double &, Eigen::Matrix<double, -1, 1, 0,
      -1, 1> &, long> > >::caller_py_function_impl' requested here
        : m_impl(new caller_py_function_impl<Caller>(caller))
                     ^
/usr/include/boost/python/make_function.hpp:61:11: note: in instantiation of function template specialization
      'boost::python::objects::py_function::py_function<boost::python::detail::caller<double &(*)(Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long),
      boost::python::return_internal_reference<1, boost::python::default_call_policies>, boost::mpl::vector3<double &, Eigen::Matrix<double, -1, 1, 0,
      -1, 1> &, long> > >' requested here
          detail::caller<F,CallPolicies,Sig>(f, p)
          ^
/usr/include/boost/python/make_function.hpp:140:20: note: in instantiation of function template specialization
      'boost::python::detail::make_function_aux<double &(*)(Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long), boost::python::return_internal_reference<1,
      boost::python::default_call_policies>, boost::mpl::vector3<double &, Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long>, mpl_::int_<0> >' requested
      here
    return detail::make_function_aux(
                   ^
/usr/include/boost/python/class.hpp:493:13: note: in instantiation of function template specialization 'boost::python::make_function<double
      &(*)(Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long), boost::python::return_internal_reference<1, boost::python::default_call_policies>,
      boost::python::detail::keywords<0>, boost::mpl::vector3<double &, Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long> >' requested here
          , make_function(
            ^
/usr/include/boost/python/class.hpp:562:15: note: in instantiation of function template specialization 'boost::python::class_<Eigen::Matrix<double, -1,
      1, 0, -1, 1>, boost::python::detail::not_specified, boost::python::detail::not_specified,
      boost::python::detail::not_specified>::def_impl<Eigen::Matrix<double, -1, 1, 0, -1, 1>, double &(*)(Eigen::Matrix<double, -1, 1, 0, -1, 1> &,
      long), boost::python::detail::def_helper<boost::python::return_internal_reference<1, boost::python::default_call_policies>,
      boost::python::detail::not_specified, boost::python::detail::not_specified, boost::python::detail::not_specified> >' requested here
        this->def_impl(
              ^
/usr/include/boost/python/class.hpp:240:15: note: in instantiation of function template specialization 'boost::python::class_<Eigen::Matrix<double, -1,
      1, 0, -1, 1>, boost::python::detail::not_specified, boost::python::detail::not_specified,
      boost::python::detail::not_specified>::def_maybe_overloads<double &(*)(Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long),
      boost::python::return_internal_reference<1, boost::python::default_call_policies> >' requested here
        this->def_maybe_overloads(name, a1, a2, &a2);
              ^
./visitors.hpp:148:4: note: in instantiation of function template specialization 'boost::python::class_<Eigen::Matrix<double, -1, 1, 0, -1, 1>,
      boost::python::detail::not_specified, boost::python::detail::not_specified, boost::python::detail::not_specified>::def<double
      &(*)(Eigen::Matrix<double, -1, 1, 0, -1, 1> &, long), boost::python::return_internal_reference<1, boost::python::default_call_policies> >'
      requested here
                .def("__getitem__",&VectorVisitor::get_item,py::return_internal_reference<>())
                 ^
/usr/include/boost/python/def_visitor.hpp:31:29: note: in instantiation of function template specialization 'VectorVisitor<Eigen::Matrix<double, -1, 1,
      0, -1, 1> >::visit<boost::python::class_<Eigen::Matrix<double, -1, 1, 0, -1, 1>, boost::python::detail::not_specified,
      boost::python::detail::not_specified, boost::python::detail::not_specified> >' requested here
        v.derived_visitor().visit(c);
                            ^
/usr/include/boost/python/def_visitor.hpp:67:29: note: in instantiation of function template specialization
      'boost::python::def_visitor_access::visit<boost::python::def_visitor<VectorVisitor<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >,
      boost::python::class_<Eigen::Matrix<double, -1, 1, 0, -1, 1>, boost::python::detail::not_specified, boost::python::detail::not_specified,
      boost::python::detail::not_specified> >' requested here
        def_visitor_access::visit(*this, c);
                            ^
/usr/include/boost/python/class.hpp:221:17: note: in instantiation of function template specialization
      'boost::python::def_visitor<VectorVisitor<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >::visit<boost::python::class_<Eigen::Matrix<double, -1, 1, 0,
      -1, 1>, boost::python::detail::not_specified, boost::python::detail::not_specified, boost::python::detail::not_specified> >' requested here
        visitor.visit(*this);
                ^
expose-vectors.cpp:4:4: note: in instantiation of function template specialization 'boost::python::class_<Eigen::Matrix<double, -1, 1, 0, -1, 1>,
      boost::python::detail::not_specified, boost::python::detail::not_specified,
      boost::python::detail::not_specified>::def<VectorVisitor<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >' requested here
                .def(VectorVisitor<VectorXr>())
                 ^
/usr/include/boost/mpl/assert.hpp:83:5: note: candidate function template not viable: no known conversion from 'mpl_::failed
      ************(boost::mpl::or_<boost::is_class<double>, boost::is_union<double>, mpl_::bool_<false>, mpl_::bool_<false>, mpl_::bool_<false>
      >::************)' to 'typename assert<false>::type' (aka 'mpl_::assert<false>') for 1st argument
int assertion_failed( typename assert<C>::type );
    ^
fxdupe commented 6 years ago

I revert the changes from #16 and now it compiles finely.

eudoxos commented 6 years ago

Thanks, I reverted the pull request. Compiles just fine now. Sorry for the PR which was not tested properly. Reopen if you still have issues. Cheers!