enewhuis / liquibook

Modern C++ order matching engine
Other
1.15k stars 380 forks source link

unable to compile liquibook on ubuntu 16.04 #21

Closed nirajrussspacetech closed 6 years ago

nirajrussspacetech commented 6 years ago

My OS is ubuntu 16.04 gcc version 6.4.0

I am trying to compile Liquibook I installed MPC, Xercesc, Boost_1_62_0, Quickfast and all other dependencies Exposed all variables : QUICKFAST_ROOT, MPC_ROOT, XERCES_ROOT, BOOST_ROOT and all related lib and include variables. env.sh did not run properly so I manually exposed LIQUIBOOK_ROOT to the folder where I extracted the zip downloaded from this git. I run following : $MPC_ROOT/mwc.pl -type make liquibook.mwc -- done $ make depend -- done $ make all -- error following:

uss1@USS:~/Work/Trade_Server/Liquidbook/liquibook-master/examples/depth_feed_publisher$ make allmake[1]: Entering directory '/home/uss1/Work/Trade_Server/Liquidbook/liquibook-master/examples/depth_feed_publisher' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/uss1/Work/Trade_Server/Liquidbook/liquibook-master/examples/depth_feed_publisher' make[1]: Entering directory '/home/uss1/Work/Trade_Server/Liquidbook/liquibook-master/examples/depth_feed_publisher' g++ -fPIC -O -D_REENTRANT -I"/usr/local/lib//include/boost-1_62_0" -I"/usr/local/lib//." -I"/home/uss1/Work/Trade_Server/Liquidbook/quickfast/quickfast-master//src" -I"/home/uss1/Work/Trade_Server/Liquidbook/liquibook-master//src" -c -o "subscriber_main.o" subscriber_main.cpp In file included from /usr/include/boost/bind.hpp:22:0, from subscriber_main.cpp:2: /usr/include/boost/bind/bind.hpp: In instantiation of ‘R boost::_bi::list3<A1, A2, A3>::operator()(boost::_bi::type, F&, A&, long int) [with R = bool; F = boost::_mfi::mf2<bool, liquibook::examples::DepthFeedSubscriber, boost::shared_ptr<boost::array<unsigned char, 128ul> >&, long unsigned int>; A = boost::_bi::list2<const boost::shared_ptr<boost::array<unsigned char, 128ul> >&, const long unsigned int&>; A1 = boost::_bi::value<liquibook::examples::DepthFeedSubscriber>; A2 = boost::arg<1>; A3 = boost::arg<2>]’: /usr/include/boost/bind/bind.hpp:917:50: required from ‘boost::_bi::bind_t<R, F, L>::result_type boost::_bi::bind_t<R, F, L>::operator()(A1&&, A2&&) [with A1 = boost::shared_ptr<boost::array<unsigned char, 128ul> >; A2 = long unsigned int; R = bool; F = boost::_mfi::mf2<bool, liquibook::examples::DepthFeedSubscriber, boost::shared_ptr<boost::array<unsigned char, 128ul> >&, long unsigned int>; L = boost::_bi::list3<boost::_bi::value<liquibook::examples::DepthFeedSubscriber>, boost::arg<1>, boost::arg<2> >; boost::_bi::bind_t<R, F, L>::result_type = bool]’ /usr/include/boost/function/function_template.hpp:138:22: required from ‘static R boost::detail::function::function_obj_invoker2<FunctionObj, R, T0, T1>::invoke(boost::detail::function::function_buffer&, T0, T1) [with FunctionObj = boost::_bi::bind_t<bool, boost::_mfi::mf2<bool, liquibook::examples::DepthFeedSubscriber, boost::shared_ptr<boost::array<unsigned char, 128ul> >&, long unsigned int>, boost::_bi::list3<boost::_bi::value<liquibook::examples::DepthFeedSubscriber>, boost::arg<1>, boost::arg<2> > >; R = bool; T0 = boost::shared_ptr<boost::array<unsigned char, 128ul> >; T1 = long unsigned int]’ /usr/include/boost/function/function_template.hpp:940:38: required from ‘void boost::function2<R, T1, T2>::assign_to(Functor) [with Functor = boost::_bi::bind_t<bool, boost::_mfi::mf2<bool, liquibook::examples::DepthFeedSubscriber, boost::shared_ptr<boost::array<unsigned char, 128ul> >&, long unsigned int>, boost::_bi::list3<boost::_bi::value<liquibook::examples::DepthFeedSubscriber>, boost::arg<1>, boost::arg<2> > >; R = bool; T0 = boost::shared_ptr<boost::array<unsigned char, 128ul> >; T1 = long unsigned int]’ /usr/include/boost/function/function_template.hpp:728:7: required from ‘boost::function2<R, T1, T2>::function2(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral::value>::value, int>::type) [with Functor = boost::_bi::bind_t<bool, boost::_mfi::mf2<bool, liquibook::examples::DepthFeedSubscriber, boost::shared_ptr<boost::array<unsigned char, 128ul> >&, long unsigned int>, boost::_bi::list3<boost::_bi::value<liquibook::examples::DepthFeedSubscriber>, boost::arg<1>, boost::arg<2> > >; R = bool; T0 = boost::shared_ptr<boost::array<unsigned char, 128ul> >; T1 = long unsigned int; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral::value>::value, int>::type = int]’ /usr/include/boost/function/function_template.hpp:1077:16: required from ‘boost::function<R(T0, T1)>::function(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral::value>::value, int>::type) [with Functor = boost::_bi::bind_t<bool, boost::_mfi::mf2<bool, liquibook::examples::DepthFeedSubscriber, boost::shared_ptr<boost::array<unsigned char, 128ul> >&, long unsigned int>, boost::_bi::list3<boost::_bi::value<liquibook::examples::DepthFeedSubscriber>, boost::arg<1>, boost::arg<2> > >; R = bool; T0 = boost::shared_ptr<boost::array<unsigned char, 128ul> >; T1 = long unsigned int; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral::value>::value, int>::type = int]’ subscriber_main.cpp:19:34: required from here /usr/include/boost/bind/bind.hpp:382:42: error: no match for call to ‘(boost::_mfi::mf2<bool, liquibook::examples::DepthFeedSubscriber, boost::shared_ptr<boost::array<unsigned char, 128ul> >&, long unsigned int>) (liquibook::examples::DepthFeedSubscriber*&, const boost::shared_ptr<boost::array<unsigned char, 128ul> >&, const long unsigned int&)’ return unwrapper::unwrap(f, 0)(a[basetype::a1], a[basetype::a2], a[basetype::a3]);


In file included from /usr/include/boost/bind/mem_fn.hpp:215:0,
                 from /usr/include/boost/mem_fn.hpp:22,
                 from /usr/include/boost/bind/bind.hpp:26,
                 from /usr/include/boost/bind.hpp:22,
                 from subscriber_main.cpp:2:
/usr/include/boost/bind/mem_fn_template.hpp:278:7: note: candidate: R boost::_mfi::mf2<R, T, A1, A2>::operator()(T*, A1, A2) const [with R = bool; T = liquibook::examples::DepthFeedSubscriber; A1 = boost::shared_ptr<boost::array<unsigned char, 128ul> >&; A2 = long unsigned int] <near match>
     R operator()(T * p, A1 a1, A2 a2) const
       ^~~~~~~~
/usr/include/boost/bind/mem_fn_template.hpp:278:7: note:   conversion of argument 2 would be ill-formed:
In file included from /usr/include/boost/bind.hpp:22:0,
                 from subscriber_main.cpp:2:
/usr/include/boost/bind/bind.hpp:382:42: error: binding ‘const boost::shared_ptr<boost::array<unsigned char, 128ul> >’ to reference of type ‘boost::shared_ptr<boost::array<unsigned char, 128ul> >&’ discards qualifiers
         return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/bind/mem_fn.hpp:215:0,
                 from /usr/include/boost/mem_fn.hpp:22,
                 from /usr/include/boost/bind/bind.hpp:26,
                 from /usr/include/boost/bind.hpp:22,
                 from subscriber_main.cpp:2:
/usr/include/boost/bind/mem_fn_template.hpp:283:25: note: candidate: template<class U> R boost::_mfi::mf2<R, T, A1, A2>::operator()(U&, A1, A2) const [with U = U; R = bool; T = liquibook::examples::DepthFeedSubscriber; A1 = boost::shared_ptr<boost::array<unsigned char, 128ul> >&; A2 = long unsigned int]
     template<class U> R operator()(U & u, A1 a1, A2 a2) const
                         ^~~~~~~~
/usr/include/boost/bind/mem_fn_template.hpp:283:25: note:   template argument deduction/substitution failed:
In file included from /usr/include/boost/bind.hpp:22:0,
                 from subscriber_main.cpp:2:
/usr/include/boost/bind/bind.hpp:382:42: note:   cannot convert ‘(& a)->boost::_bi::list2<A1, A2>::operator[]<const boost::shared_ptr<boost::array<unsigned char, 128ul> >&, const long unsigned int&>(boost::_bi::storage2<A1, boost::arg<I> >::a2_<boost::_bi::value<liquibook::examples::DepthFeedSubscriber*>, 1>)’ (type ‘const boost::shared_ptr<boost::array<unsigned char, 128ul> >’) to type ‘boost::shared_ptr<boost::array<unsigned char, 128ul> >&’
         return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/bind/mem_fn.hpp:215:0,
                 from /usr/include/boost/mem_fn.hpp:22,
                 from /usr/include/boost/bind/bind.hpp:26,
                 from /usr/include/boost/bind.hpp:22,
                 from subscriber_main.cpp:2:
/usr/include/boost/bind/mem_fn_template.hpp:291:25: note: candidate: template<class U> R boost::_mfi::mf2<R, T, A1, A2>::operator()(const U&, A1, A2) const [with U = U; R = bool; T = liquibook::examples::DepthFeedSubscriber; A1 = boost::shared_ptr<boost::array<unsigned char, 128ul> >&; A2 = long unsigned int]
     template<class U> R operator()(U const & u, A1 a1, A2 a2) const
                         ^~~~~~~~
/usr/include/boost/bind/mem_fn_template.hpp:291:25: note:   template argument deduction/substitution failed:
In file included from /usr/include/boost/bind.hpp:22:0,
                 from subscriber_main.cpp:2:
/usr/include/boost/bind/bind.hpp:382:42: note:   cannot convert ‘(& a)->boost::_bi::list2<A1, A2>::operator[]<const boost::shared_ptr<boost::array<unsigned char, 128ul> >&, const long unsigned int&>(boost::_bi::storage2<A1, boost::arg<I> >::a2_<boost::_bi::value<liquibook::examples::DepthFeedSubscriber*>, 1>)’ (type ‘const boost::shared_ptr<boost::array<unsigned char, 128ul> >’) to type ‘boost::shared_ptr<boost::array<unsigned char, 128ul> >&’
         return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/bind/mem_fn.hpp:215:0,
                 from /usr/include/boost/mem_fn.hpp:22,
                 from /usr/include/boost/bind/bind.hpp:26,
                 from /usr/include/boost/bind.hpp:22,
                 from subscriber_main.cpp:2:
/usr/include/boost/bind/mem_fn_template.hpp:299:7: note: candidate: R boost::_mfi::mf2<R, T, A1, A2>::operator()(T&, A1, A2) const [with R = bool; T = liquibook::examples::DepthFeedSubscriber; A1 = boost::shared_ptr<boost::array<unsigned char, 128ul> >&; A2 = long unsigned int]
     R operator()(T & t, A1 a1, A2 a2) const
       ^~~~~~~~
/usr/include/boost/bind/mem_fn_template.hpp:299:7: note:   no known conversion for argument 1 from ‘liquibook::examples::DepthFeedSubscriber*’ to ‘liquibook::examples::DepthFeedSubscriber&’
Makefile.depth_feed_subscriber:95: recipe for target 'subscriber_main.o' failed
make[1]: *** [subscriber_main.o] Error 1
make[1]: Leaving directory '/home/uss1/Work/Trade_Server/Liquidbook/liquibook-master/examples/depth_feed_publisher'
Makefile:33: recipe for target 'depth_feed_subscriber' failed
make: *** [depth_feed_subscriber] Error 2
nirajrussspacetech commented 6 years ago

https://github.com/ibrahimkarahan/liquibook

This solved my problems. It compiled fine under ubuntu 16.04