From f66d5566a47e56dc06c597b56c683a1b10a41470 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Thu, 13 Jun 2024 18:16:48 +0000 Subject: [PATCH] Add in workaround for compiling on aarch64. Ideally this would be in the ecl_core repository, but since we don't have write access there for now we just do it here where we need. Signed-off-by: Chris Lalancette --- include/kobuki_core/dock_drive.hpp | 14 ++++++++++++++ include/kobuki_core/kobuki.hpp | 14 ++++++++++++++ include/kobuki_core/modules/diff_drive.hpp | 14 ++++++++++++++ src/demos/simple_loop.cpp | 14 ++++++++++++++ src/driver/kobuki.cpp | 15 ++++++++++++++- src/tools/simple_keyop.cpp | 14 ++++++++++++++ 6 files changed, 84 insertions(+), 1 deletion(-) diff --git a/include/kobuki_core/dock_drive.hpp b/include/kobuki_core/dock_drive.hpp index 895b0897..8c93e5e9 100644 --- a/include/kobuki_core/dock_drive.hpp +++ b/include/kobuki_core/dock_drive.hpp @@ -22,7 +22,21 @@ #include #include #include +// Version 3.4.0 of Eigen in Ubuntu 22.04 has a bug that causes -Wclass-memaccess warnings on +// aarch64. Upstream Eigen has already fixed this in +// https://gitlab.com/libeigen/eigen/-/merge_requests/645 . The Debian fix for this is in +// https://salsa.debian.org/science-team/eigen3/-/merge_requests/1 . +// However, it is not clear that that fix is going to make it into Ubuntu 22.04 before it +// freezes, so disable the warning here. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #include +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #include /***************************************************************************** diff --git a/include/kobuki_core/kobuki.hpp b/include/kobuki_core/kobuki.hpp index 3c288eab..df82fdca 100644 --- a/include/kobuki_core/kobuki.hpp +++ b/include/kobuki_core/kobuki.hpp @@ -24,7 +24,21 @@ #include #include #include +// Version 3.4.0 of Eigen in Ubuntu 22.04 has a bug that causes -Wclass-memaccess warnings on +// aarch64. Upstream Eigen has already fixed this in +// https://gitlab.com/libeigen/eigen/-/merge_requests/645 . The Debian fix for this is in +// https://salsa.debian.org/science-team/eigen3/-/merge_requests/1 . +// However, it is not clear that that fix is going to make it into Ubuntu 22.04 before it +// freezes, so disable the warning here. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #include +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #include "version_info.hpp" #include "logging.hpp" diff --git a/include/kobuki_core/modules/diff_drive.hpp b/include/kobuki_core/modules/diff_drive.hpp index 1eaf3cfc..b1c01753 100644 --- a/include/kobuki_core/modules/diff_drive.hpp +++ b/include/kobuki_core/modules/diff_drive.hpp @@ -20,7 +20,21 @@ #include #include #include +// Version 3.4.0 of Eigen in Ubuntu 22.04 has a bug that causes -Wclass-memaccess warnings on +// aarch64. Upstream Eigen has already fixed this in +// https://gitlab.com/libeigen/eigen/-/merge_requests/645 . The Debian fix for this is in +// https://salsa.debian.org/science-team/eigen3/-/merge_requests/1 . +// However, it is not clear that that fix is going to make it into Ubuntu 22.04 before it +// freezes, so disable the warning here. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #include +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #include #include #include "../macros.hpp" diff --git a/src/demos/simple_loop.cpp b/src/demos/simple_loop.cpp index 66caf490..603aedf4 100644 --- a/src/demos/simple_loop.cpp +++ b/src/demos/simple_loop.cpp @@ -17,7 +17,21 @@ #include #include +// Version 3.4.0 of Eigen in Ubuntu 22.04 has a bug that causes -Wclass-memaccess warnings on +// aarch64. Upstream Eigen has already fixed this in +// https://gitlab.com/libeigen/eigen/-/merge_requests/645 . The Debian fix for this is in +// https://salsa.debian.org/science-team/eigen3/-/merge_requests/1 . +// However, it is not clear that that fix is going to make it into Ubuntu 22.04 before it +// freezes, so disable the warning here. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #include +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #include #include #include diff --git a/src/driver/kobuki.cpp b/src/driver/kobuki.cpp index a7fa6bb4..ad66b334 100644 --- a/src/driver/kobuki.cpp +++ b/src/driver/kobuki.cpp @@ -14,11 +14,24 @@ #include #include +// Version 3.4.0 of Eigen in Ubuntu 22.04 has a bug that causes -Wclass-memaccess warnings on +// aarch64. Upstream Eigen has already fixed this in +// https://gitlab.com/libeigen/eigen/-/merge_requests/645 . The Debian fix for this is in +// https://salsa.debian.org/science-team/eigen3/-/merge_requests/1 . +// However, it is not clear that that fix is going to make it into Ubuntu 22.04 before it +// freezes, so disable the warning here. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #include +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #include #include #include -#include #include #include "../../include/kobuki_core/kobuki.hpp" diff --git a/src/tools/simple_keyop.cpp b/src/tools/simple_keyop.cpp index 949bb11c..0add0b44 100644 --- a/src/tools/simple_keyop.cpp +++ b/src/tools/simple_keyop.cpp @@ -17,7 +17,21 @@ #include #include +// Version 3.4.0 of Eigen in Ubuntu 22.04 has a bug that causes -Wclass-memaccess warnings on +// aarch64. Upstream Eigen has already fixed this in +// https://gitlab.com/libeigen/eigen/-/merge_requests/645 . The Debian fix for this is in +// https://salsa.debian.org/science-team/eigen3/-/merge_requests/1 . +// However, it is not clear that that fix is going to make it into Ubuntu 22.04 before it +// freezes, so disable the warning here. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif #include +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #include #include #include