From 120a69d7db2c7ecc04f6a1688df493dc43124a56 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Mon, 29 Nov 2021 16:41:13 -0500 Subject: [PATCH] add workaround for Eigen serialization issue --- gtsam/base/serialization.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gtsam/base/serialization.h b/gtsam/base/serialization.h index f589ecc5e..98112b256 100644 --- a/gtsam/base/serialization.h +++ b/gtsam/base/serialization.h @@ -40,6 +40,17 @@ #include #include +// Workaround a bug in GCC >= 7 and C++17 +// ref. https://gitlab.com/libeigen/eigen/-/issues/1676 +#ifdef __GNUC__ +#if __GNUC__ >= 7 && __cplusplus >= 201703L +namespace boost { namespace serialization { struct U; } } +namespace Eigen { namespace internal { +template<> struct traits {enum {Flags=0};}; +} } +#endif +#endif + namespace gtsam { /** @name Standard serialization