Boost logo

Boost Users :

Subject: Re: [Boost-users] [spirit][karma] multiprecision modf
From: Daniel Brake (danielthebrake_at_[hidden])
Date: 2016-08-08 14:47:35


Thanks for the reply, John. I think for now I will simply use the .str()
method for mpfr_float, since my policies for printing numbers need the
entire number (or really, some portion of the number which is known at
runtime, but not necessarily at compile time).

Any help from the Boost.Spirit people on connecting Boost.Multiprecision
variable-precision types would be swell. I am happy to help with this. I
already use Spirit.Qi for parsing, and love it, so really want to be able
to use Karma in full, as well.

Thanks,
Daniel

>
> ---------- Forwarded message ----------
> From: John Maddock <jz.maddock_at_[hidden]>
> To: boost-users_at_[hidden]
> Cc:
> Date: Wed, 3 Aug 2016 18:14:05 +0100
> Subject: Re: [Boost-users] [spirit][karma] multiprecision modf
>
> Here's the new error message:
>>
>> In file included from test/generating/mpfr_float.cpp:27:
>> In file included from ./include/bertini2/io/generators.hpp:44:
>> In file included from /usr/local/include/boost/spiri
>> t/include/karma.hpp:16:
>> In file included from /usr/local/include/boost/spirit/home/karma.hpp:15:
>> In file included from /usr/local/include/boost/spiri
>> t/home/karma/numeric.hpp:16:
>> In file included from /usr/local/include/boost/spiri
>> t/home/karma/numeric/real.hpp:32:
>> /usr/local/include/boost/spirit/home/karma/numeric/real_policies.hpp:263:39:
>> error: incompatible operand types ('int' and 'typename
>> enable_if_c<number_category<detail::expression<function,
>> log10_funct<mpfr_float_backend<0, allocate_dynamic> >,
>> number<mpfr_float_backend<0,
>> allocate_dynamic>, boost::multiprecision::expression_template_option::et_on>,
>> void, void> >::value == number_kind_floating_point,
>> detail::expression<detail::function, detail::floor_funct<typename
>> detail::backend_type<detail::expression<function,
>> log10_funct<mpfr_float_backend<0, allocate_dynamic> >,
>> number<mpfr_float_backend<0, allocate_dynamic>,
>> boost::multiprecision::expression_template_option::et_on>, void, void>
>> >::type>, detail::expression<function, log10_funct<mpfr_float_backend<0,
>> allocate_dynamic> >, number<mpfr_float_backend<0,
>> allocate_dynamic>, boost::multiprecision::expression_template_option::et_on>,
>> void, void> >
>> >::type' (aka 'boost::multiprecision::detail
>> ::expression<boost::multiprecision::detail::function,
>> boost::multiprecision::detail::floor_funct<boost::multipreci
>> sion::backends::mpfr_float_backend<0, allocate_dynamic> >,
>> boost::multiprecision::detail::expression<boost::multiprecis
>> ion::detail::function,
>> boost::multiprecision::detail::log10_funct<boost::multipreci
>> sion::backends::mpfr_float_backend<0, allocate_dynamic> >,
>> boost::multiprecision::number<boost::multiprecision::backends::mpfr_float_backend<0,
>> allocate_dynamic>,
>> boost::multiprecision::expression_template_option::et_on>, void, void>,
>> void, void>'))
>> (traits::test_zero(n) ? 0 : floor(log10(n))) + 1;
>>
>
> I'm afraid that code is incompatible with expression templates: the two
> halves of the conditional expression have different/unrelated types which
> aren't convertible to each other. An explicit cast is needed here to make
> the code expression-template compatible. Or else use a number type with
> expression templates turned off. Suggest you contact the spirit developers
> (they have their own mailing list I believe) and see what their intent is
> here.
>
> As a last question, I am unsure about the use of the a function parameter
>> in my specialization BertiniNumPolicy<mpfr_float>, particularly the
>> precision(mpfr_float) function. In the documentation and examples I have
>> seen for specializations, this function doesn't use the argument. Is it ok
>> that it does, that it checks the actual precision of x??? See above code.
>> An alternate method for me might be to just use the str() method provided
>> by the number<...> from Multiprecision, but it seems like since this type
>> is numeric, I'd like to be able to generate using the numeric generators
>> from Karma.
>>
>
> That looks to be the intent yes. Note however, that it's a conceptual
> requirement of karma that the number have numeric_limits specialized -
> that's not true for type mpfr_float since most of the fields would have to
> vary at runtime which isn't possible for numeric_limits. Technically we
> could provide a specialization that defines the members that are constant
> and leaves the others as undefined/zero/infinity, but it's not clear what's
> the right thing to do here - numeric_limits wasn't designed for this kind
> of type it seems :(
>
> I'm changing the subject line to include spirit/karma in hopes that their
> developers will see this and chip in.... we should really find a way to
> make the libraries work better together.
>
> HTH, John.
>
>
>
> ---------- Forwarded message ----------
> From: Gavin Lambert <gavinl_at_[hidden]>
> To: boost-users_at_[hidden]
> Cc:
> Date: Thu, 4 Aug 2016 16:05:12 +1200
> Subject: Re: [Boost-users] boost::serialization::array for Orocos RTT
> On 3/08/2016 23:29, Sambeet Panigrahi wrote:
>
>> I gave the following includes
>> #include <boost/serialization/array.hpp>
>> #include <boost/array.hpp>
>>
>> I know boost::array exists,but does boost::serialization::array
>> exist?Because in the namespace serialization in the
>> boost/serialization/array.hpp, I could not find such a template.
>>
>> namespace boost { namespace serialization {
>>
> [...]
>
>> template<class T>
>> class array_wrapper :
>> public wrapper_traits<const array_wrapper< T > >
>>
>
> Looks like it's called array_wrapper instead of array in your version.
>
> Which is odd, since you claimed to be using 1.44, and these say
> differently:
>
> http://www.boost.org/doc/libs/1_44_0/boost/serialization/array.hpp
>
>
> https://github.com/boostorg/serialization/blob/1b9dc31ba/inc
> lude/boost/serialization/array.hpp
>
> If you obtained the Boost library from an SDK vendor instead of directly
> from Boost, you should probably ask them why it is different.
>
>
>
>
>
> ---------- Forwarded message ----------
> From: "deneme.true" <deneme.true_at_[hidden]>
> To: boost-users_at_[hidden]
> Cc:
> Date: Thu, 4 Aug 2016 10:40:22 +0300
> Subject: [Boost-users] Serialization error
> Hello,
>
> I got following errors on 64 bit machine when I try to compile my
> application.
>
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: __cdecl boost::archive::text_iarchive_impl<class
> boost::archive::text_iarchive>::text_iarchive_impl<class
> boost::archive::text_iarchive>(class std::basic_istream<char,struct
> std::char_traits<char> > &,unsigned int)"
> (??0?$text_iarchive_impl_at_Vtext_iarchive_at_archive@boost@@@archive_at_boost
> @@IEAA_at_AEAV?$basic_istream_at_DU?$char_traits_at_D@std@@@std@@I_at_Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: void __cdecl boost::archive::text_iarchive_impl<class
> boost::archive::text_iarchive>::load_override(struct
> boost::archive::class_name_type &)"
> (?load_override@?$text_iarchive_impl_at_Vtext_iarchive_at_archive@boost
> @@@archive_at_boost@@IEAAXAEAUclass_name_type_at_23@@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: void __cdecl boost::archive::text_iarchive_impl<class
> boost::archive::text_iarchive>::load(class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > &)"
> (?load@?$text_iarchive_impl_at_Vtext_iarchive_at_archive@boost@@@archive_at_boost
> @@IEAAXAEAV?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@@
> Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: __cdecl boost::archive::basic_text_iprimitive<class
> std::basic_istream<char,struct std::char_traits<char> >
> >::~basic_text_iprimitive<class std::basic_istream<char,struct
> std::char_traits<char> > >(void)"
> (??1?$basic_text_iprimitive_at_V?$basic_istream_at_DU?$char_traits_at_D@std@@@std@
> @@archive_at_boost@@IEAA_at_XZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: __cdecl boost::archive::basic_text_oprimitive<class
> std::basic_ostream<char,struct std::char_traits<char> >
> >::~basic_text_oprimitive<class std::basic_ostream<char,struct
> std::char_traits<char> > >(void)"
> (??1?$basic_text_oprimitive_at_V?$basic_ostream_at_DU?$char_traits_at_D@std@@@std@
> @@archive_at_boost@@IEAA_at_XZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: __cdecl boost::archive::text_oarchive_impl<class
> boost::archive::text_oarchive>::text_oarchive_impl<class
> boost::archive::text_oarchive>(class std::basic_ostream<char,struct
> std::char_traits<char> > &,unsigned int)"
> (??0?$text_oarchive_impl_at_Vtext_oarchive_at_archive@boost@@@archive_at_boost
> @@IEAA_at_AEAV?$basic_ostream_at_DU?$char_traits_at_D@std@@@std@@I_at_Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: void __cdecl boost::archive::text_oarchive_impl<class
> boost::archive::text_oarchive>::save(class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > const &)"
> (?save@?$text_oarchive_impl_at_Vtext_oarchive_at_archive@boost@@@archive_at_boost
> @@IEAAXAEBV?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@@
> Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: virtual __cdecl
> boost::archive::detail::basic_iserializer::~basic_iserializer(void)"
> (??1basic_iserializer_at_detail@archive_at_boost@@MEAA_at_XZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: __cdecl
> boost::archive::detail::basic_iserializer::basic_iserializer(class
> boost::serialization::extended_type_info const &)"
> (??0basic_iserializer_at_detail@archive_at_boost@@IEAA_at_AEBVextended_type_info@
> serialization_at_3@@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: virtual __cdecl
> boost::archive::detail::basic_oserializer::~basic_oserializer(void)"
> (??1basic_oserializer_at_detail@archive_at_boost@@MEAA_at_XZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: __cdecl
> boost::archive::detail::basic_oserializer::basic_oserializer(class
> boost::serialization::extended_type_info const &)"
> (??0basic_oserializer_at_detail@archive_at_boost@@IEAA_at_AEBVextended_type_info@
> serialization_at_3@@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: void __cdecl
> boost::archive::detail::basic_iarchive::reset_object_address(void
> const *,void const *)"
> (?reset_object_address_at_basic_iarchive_at_detail@archive_at_boost@@QEAAXPEBX0_at_Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: class boost::archive::library_version_type __cdecl
> boost::archive::detail::basic_iarchive::get_library_version(void)const
> " (?get_library_version_at_basic_iarchive_at_detail@archive_at_boost@
> @QEBA?AVlibrary_version_type_at_34@XZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: void __cdecl
> boost::archive::detail::basic_iarchive::load_object(void *,class
> boost::archive::detail::basic_iserializer const &)"
> (?load_object_at_basic_iarchive_at_detail@archive_at_boost@@QEAAXPEAXAEBVbasic_
> iserializer_at_234@@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: virtual __cdecl
> boost::archive::detail::basic_iarchive::~basic_iarchive(void)"
> (??1basic_iarchive_at_detail@archive_at_boost@@UEAA_at_XZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: void __cdecl
> boost::archive::detail::basic_oarchive::end_preamble(void)"
> (?end_preamble_at_basic_oarchive_at_detail@archive_at_boost@@QEAAXXZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: void __cdecl
> boost::archive::detail::basic_oarchive::save_object(void const *,class
> boost::archive::detail::basic_oserializer const &)"
> (?save_object_at_basic_oarchive_at_detail@archive_at_boost@@QEAAXPEBXAEBVbasic_
> oserializer_at_234@@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: virtual __cdecl
> boost::archive::detail::basic_oarchive::~basic_oarchive(void)"
> (??1basic_oarchive_at_detail@archive_at_boost@@MEAA_at_XZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: void __cdecl boost::archive::basic_text_oarchive<class
> boost::archive::text_oarchive>::newtoken(void)"
> (?newtoken@?$basic_text_oarchive_at_Vtext_oarchive_at_archive@boost
> @@@archive_at_boost@@IEAAXXZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: virtual __cdecl
> boost::archive::archive_exception::~archive_exception(void)"
> (??1archive_exception_at_archive@boost@@UEAA_at_XZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: __cdecl
> boost::archive::archive_exception::archive_exception(enum
> boost::archive::archive_exception::_exception_code,char const *,char
> const *)" (??0archive_exception_at_archive@boost@@QEAA_at_W4_exception_code@
> 012_at_PEBD1@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: __cdecl
> boost::archive::archive_exception::archive_exception(class
> boost::archive::archive_exception const &)"
> (??0archive_exception_at_archive@boost@@QEAA_at_AEBV012@@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: virtual bool __cdecl
> boost::serialization::typeid_system::extended_type_info_
> typeid_0::is_equal(class
> boost::serialization::extended_type_info const &)const "
> (?is_equal_at_extended_type_info_typeid_0_at_typeid_system_at_serialization@boost
> @@UEBA_NAEBVextended_type_info_at_34@@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "public: virtual bool __cdecl
> boost::serialization::typeid_system::extended_type_info_
> typeid_0::is_less_than(class
> boost::serialization::extended_type_info const &)const "
> (?is_less_than_at_extended_type_info_typeid_0_at_typeid_system@
> serialization_at_boost@@UEBA_NAEBVextended_type_info_at_34@@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: void __cdecl
> boost::serialization::typeid_system::extended_type_info_
> typeid_0::type_unregister(void)"
> (?type_unregister_at_extended_type_info_typeid_0_at_typeid_system_at_serialization
> @boost@@IEAAXXZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: void __cdecl
> boost::serialization::typeid_system::extended_type_info_
> typeid_0::type_register(class
> type_info const &)"
> (?type_register_at_extended_type_info_typeid_0_at_typeid_system@
> serialization_at_boost@@IEAAXAEBVtype_info@@@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: virtual __cdecl
> boost::serialization::typeid_system::extended_type_info_
> typeid_0::~extended_type_info_typeid_0(void)"
> (??1extended_type_info_typeid_0_at_typeid_system_at_serialization@boost@@MEAA_at_XZ
> )
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: __cdecl
> boost::serialization::typeid_system::extended_type_info_
> typeid_0::extended_type_info_typeid_0(char
> const *)" (??0extended_type_info_typeid_0_at_typeid_system_at_serialization@
> boost@@IEAA_at_PEBD@Z)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: void __cdecl
> boost::serialization::extended_type_info::key_register(void)const "
> (?key_register_at_extended_type_info_at_serialization@boost@@IEBAXXZ)
> 1>wxRememberme.obj : error LNK2001: unresolved external symbol
> "protected: void __cdecl
> boost::serialization::extended_type_info::key_unregister(void)const "
> (?key_unregister_at_extended_type_info_at_serialization@boost@@IEBAXXZ)
> 1>libeay32mt.lib(txt_db.obj) : error LNK2001: unresolved external
> symbol __iob_func
> 1>libeay32mt.lib(ui_openssl.obj) : error LNK2001: unresolved external
> symbol __iob_func
> 1>ssleay32mt.lib(s3_srvr.obj) : error LNK2001: unresolved external
> symbol __iob_func
> 1>ssleay32mt.lib(t1_enc.obj) : error LNK2001: unresolved external
> symbol __iob_func
> 1>ssleay32mt.lib(d1_both.obj) : error LNK2001: unresolved external
> symbol __iob_func
> 1>libeay32mt.lib(cryptlib.obj) : error LNK2001: unresolved external
> symbol __iob_func
> 1>libeay32mt.lib(pem_lib.obj) : error LNK2001: unresolved external
> symbol __iob_func
> 1>libeay32mt.lib(e_capi.obj) : error LNK2001: unresolved external
> symbol __iob_func
> 1>libeay32mt.lib(gost_eng.obj) : error LNK2001: unresolved external
> symbol __iob_func
> 1>libeay32mt.lib(cryptlib.obj) : error LNK2001: unresolved external
> symbol _vsnwprintf
>
> My boost library compile parameter is:
>
> C:\boost_1_61_0>b2 install --prefix=C:\Boost1_61_0 address-model=64
> --build-dir=
> C:\boost-build toolset=msvc-14.0 variant=debug,release link=static
> threading=mul
> ti runtime-link=static stage
>
> I am using serialization.
>
> Thanks in advance
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net