Skip to content

Instantly share code, notes, and snippets.

@matlabbe
Last active November 20, 2020 19:08
Show Gist options
  • Save matlabbe/9c5be02afa1b5e65583facb69a41e44c to your computer and use it in GitHub Desktop.
Save matlabbe/9c5be02afa1b5e65583facb69a41e44c to your computer and use it in GitHub Desktop.
Making AliceVision's eigen compatible with default g2o/gtsam eigen flags
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7348387a4..2ac399239 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -354,7 +354,7 @@ find_package(Eigen3 3.3 REQUIRED)
if(Eigen3_FOUND OR EIGEN3_FOUND)
# message(STATUS "EIGEN_INCLUDE_DIR: ${EIGEN_INCLUDE_DIR}")
# See https://eigen.tuxfamily.org/dox/group__TopicUnalignedArrayAssert.html
- set(AV_EIGEN_DEFINITIONS -DEIGEN_MAX_ALIGN_BYTES=0 -DEIGEN_MAX_STATIC_ALIGN_BYTES=0)
+ #set(AV_EIGEN_DEFINITIONS -DEIGEN_MAX_ALIGN_BYTES=0 -DEIGEN_MAX_STATIC_ALIGN_BYTES=0)
else()
message(FATAL_ERROR " EIGEN NOT FOUND. EIGEN_INCLUDE_DIR: ${EIGEN_INCLUDE_DIR}")
endif()
diff --git a/src/aliceVision/numeric/numeric.hpp b/src/aliceVision/numeric/numeric.hpp
index 214805ad8..f043e2e0a 100644
--- a/src/aliceVision/numeric/numeric.hpp
+++ b/src/aliceVision/numeric/numeric.hpp
@@ -11,15 +11,15 @@
// AliceVision does not support Eigen with alignment,
// So ensure Eigen is used with the correct flags.
#ifndef EIGEN_MAX_ALIGN_BYTES
-#error "EIGEN_MAX_ALIGN_BYTES is not defined"
+//#error "EIGEN_MAX_ALIGN_BYTES is not defined"
#elif EIGEN_MAX_ALIGN_BYTES != 0
-#error "EIGEN_MAX_ALIGN_BYTES is defined but not 0"
+//#error "EIGEN_MAX_ALIGN_BYTES is defined but not 0"
#endif
#ifndef EIGEN_MAX_STATIC_ALIGN_BYTES
-#error "EIGEN_MAX_STATIC_ALIGN_BYTES is not defined"
+//#error "EIGEN_MAX_STATIC_ALIGN_BYTES is not defined"
#elif EIGEN_MAX_STATIC_ALIGN_BYTES != 0
-#error "EIGEN_MAX_STATIC_ALIGN_BYTES is defined but not 0"
+//#error "EIGEN_MAX_STATIC_ALIGN_BYTES is defined but not 0"
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment