Skip to content

Commit

Permalink
Fixing issue with Eigen in Ubuntu Jammy on ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrton04 committed Aug 23, 2024
1 parent 75f83cf commit 5bf6850
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fuse_constraints/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ else()
add_compile_options(-Wall -Werror)
endif()

# On ARM, the use of Eigen 3.4 with g++11 (both the versions in Jammy) causes a warning, which in turn causes
# the build to fail. Details are here: https://gitlab.com/libeigen/eigen/-/issues/2326. We can suppress the warning
# for ARM builds here.
if(Eigen3_VERSION VERSION_EQUAL 3.4 AND
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11.0 AND
CMAKE_LIBRARY_ARCHITECTURE STREQUAL "aarch64-linux-gnu")
add_compile_options(-Wno-class-memaccess)
endif()

# fuse_constraints library
add_library(${PROJECT_NAME}
src/absolute_constraint.cpp
Expand Down
9 changes: 9 additions & 0 deletions fuse_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ catkin_package(
###########
add_compile_options(-Wall -Werror)

# On ARM, the use of Eigen 3.4 with g++11 (both the versions in Jammy) causes a warning, which in turn causes
# the build to fail. Details are here: https://gitlab.com/libeigen/eigen/-/issues/2326. We can suppress the warning
# for ARM builds here.
if(Eigen3_VERSION VERSION_EQUAL 3.4 AND
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11.0 AND
CMAKE_LIBRARY_ARCHITECTURE STREQUAL "aarch64-linux-gnu")
add_compile_options(-Wno-class-memaccess)
endif()

## fuse_core library
add_library(${PROJECT_NAME}
src/async_motion_model.cpp
Expand Down
9 changes: 9 additions & 0 deletions fuse_models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ roslint_cpp()
###########
add_compile_options(-Wall -Werror)

# On ARM, the use of Eigen 3.4 with g++11 (both the versions in Jammy) causes a warning, which in turn causes
# the build to fail. Details are here: https://gitlab.com/libeigen/eigen/-/issues/2326. We can suppress the warning
# for ARM builds here.
if(Eigen3_VERSION VERSION_EQUAL 3.4 AND
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11.0 AND
CMAKE_LIBRARY_ARCHITECTURE STREQUAL "aarch64-linux-gnu")
add_compile_options(-Wno-class-memaccess)
endif()

## Declare a C++ library
add_library(${PROJECT_NAME}
src/acceleration_2d.cpp
Expand Down
9 changes: 9 additions & 0 deletions fuse_viz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ add_definitions(-DQT_NO_KEYWORDS)
###########
add_compile_options(-Wall -Werror)

# On ARM, the use of Eigen 3.4 with g++11 (both the versions in Jammy) causes a warning, which in turn causes
# the build to fail. Details are here: https://gitlab.com/libeigen/eigen/-/issues/2326. We can suppress the warning
# for ARM builds here.
if(Eigen3_VERSION VERSION_EQUAL 3.4 AND
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11.0 AND
CMAKE_LIBRARY_ARCHITECTURE STREQUAL "aarch64-linux-gnu")
add_compile_options(-Wno-class-memaccess)
endif()

catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
Expand Down

0 comments on commit 5bf6850

Please sign in to comment.