Giter Site home page Giter Site logo

eos-portable-archive's People

Contributors

boldie avatar daldegam avatar sgmotiongestures avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eos-portable-archive's Issues

Error loading file in boost 1.69.0

I can't find portable_binary_(i)oarchive in boost/archive.
so, I tried to copy those files in eos to boost/archive.
Then, it is different from tutorial, I can't use boost::archive::portable_binary_oarchive but eos::portable_oarchive could.

    template<class Archive>
    void Map::serialize(Archive &ar, const unsigned int version)
    {
        // don't save mutex
        ar & mspMapPoints;
        ar & mvpKeyFrameOrigins;
        ar & mspKeyFrames;
        ar & mvpReferenceMapPoints;
        ar & mnMaxKFid & mnBigChangeIdx;
        ar & mapScaleRatio;
    }
    template void Map::serialize(eos::portable_oarchive&, const unsigned int);
    template void Map::serialize(eos::portable_iarchive&, const unsigned int);

Next, when I compile code, it will show the warning:
The use of BOOST_ENDIAN and BOOST_BYTE_ORDER is deprecated. Please include <boost/predef/other/endian.h> and use BOOST_ENDIAN_BYTE instead
Finally, It saved the file but I can't load it.

Help me find where wrong, thanks.

error: no type named ‘bits’ in ‘traits’ {aka ‘struct boost::math::detail::fp_traits_native<double>’}

A little background: I'm updating boost 1.67 to 1.74. I also updated eos-portable-archive from a previous version that didn't support boost >= 1.69 to the most recent one.

So, in portable_oarchive.hpp, we have these asserts around line 393 in the save overload that saves floating point numbers:

		template <typename T>
		typename boost::enable_if<boost::is_floating_point<T> >::type
		save(const T & t, dummy<3> = 0)
		{
			typedef typename fp::detail::fp_traits<T>::type traits;

			/** <snip> **/

			typename traits::bits bits;
			BOOST_STATIC_ASSERT(sizeof(bits) == sizeof(T));
			BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_iec559);

Before updating, everything worked fine. After updating, I'm hit with an error that says the bits member of traits in the snippet above is not a member of boost::math::detail::fp_traits_native<double>:

/dependencies_directory/eos_portable_archive/eos/portable_oarchive.hpp:393:26: error: no type named ‘bits’ in ‘traits’ {aka ‘struct boost::math::detail::fp_traits_native<double>’}
    typename traits::bits bits;

Right before the asserts, there's a comment that says that, if I got to this point in the code, one of the following was likely the problem:

  1. I'm serializing a long double which is not portable (not the case)
  2. I'm serializing a double but have no 64 bit integer (not the case)
  3. My machine is using an unknown floating point format (unlikely? It's just a 64 bit CentOS 6)

These comments assume I even get to the asserts below anyway, which I don't, so I believe this is something else? Also, these checks were in place in the previous version of boost + eos, so I don't think it has anything to do with my architecture.

Anyway, I went and checked which traits struct was this and then I get this in boost/math/special_functions/detail/fp_traits.hpp:

template<class T> struct fp_traits_native
{
    typedef native_tag method;
};

It's just a tag type. For some reason, the native traits struct is being selected, but it clearly isn't expected here.

In the header section of portable_oarchive.hpp, I see this:

// endian and fpclassify
#if BOOST_VERSION < 103600
#include <boost/integer/endian.hpp>
#include <boost/math/fpclassify.hpp>
#elif BOOST_VERSION < 104800
#include <boost/spirit/home/support/detail/integer/endian.hpp>
#include <boost/spirit/home/support/detail/math/fpclassify.hpp>
#elif BOOST_VERSION >= 106900
#define BOOST_MATH_DISABLE_STD_FPCLASSIFY
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/endian/conversion.hpp>
#else
#include <boost/spirit/home/support/detail/endian/endian.hpp>
#include <boost/spirit/home/support/detail/math/fpclassify.hpp>
#endif

If I go over to fpclassify.hpp:

template<class T> struct fp_traits
{
    typedef BOOST_DEDUCED_TYPENAME size_to_precision<sizeof(T), ::boost::is_floating_point<T>::value>::type precision;
#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY)
    typedef typename select_native<T>::type type;
#else
    typedef fp_traits_non_native<T, precision> type;
#endif
    typedef fp_traits_non_native<T, precision> sign_change_type;
};

Since BOOST_MATH_DISABLE_STD_FPCLASSIFY is defined, shouldn't it choose the fp_traits_non_native traits struct? Why is it choosing the native one? I'm not sure what's going on.

And this is as far as I've got. I'm lost at what is happening here and I'm not familiar with this code.

I hope this helps you investigate.

Where is portable_binary_(i)oarchive

In your tutorial, these scripts include boost::archive::portable_binary_(i)oarchive.
However, I don't find portable_binary_(i)oarchive in boost/archive.
Should I copy scripts that in eos folder to boost/archive?
But I tried to copy them and include them, like tutorial :

#include <boost/cstdint.hpp>
#include <boost/archive/portable_oarchive.hpp>
#include <boost/archive/portable_iarchive.hpp>

then I still can't find
boost::archive::portable_binary_(i)oarchive

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.