Merged in remove_hardcoded_internal_eigen_paths (pull request #131)
Get rid of hardcoded path to the internal version of eigen inside gtsamrelease/4.3a0
commit
f95acf4971
|
@ -196,8 +196,7 @@ endif()
|
|||
### See: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=704 (Householder QR MKL selection)
|
||||
### http://eigen.tuxfamily.org/bz/show_bug.cgi?id=705 (Fix MKL LLT return code)
|
||||
### http://eigen.tuxfamily.org/bz/show_bug.cgi?id=716 (Improved comma initialization)
|
||||
# option(GTSAM_USE_SYSTEM_EIGEN "Find and use system-installed Eigen. If 'off', use the one bundled with GTSAM" OFF)
|
||||
set(GTSAM_USE_SYSTEM_EIGEN OFF)
|
||||
option(GTSAM_USE_SYSTEM_EIGEN "Find and use system-installed Eigen. If 'off', use the one bundled with GTSAM" OFF)
|
||||
|
||||
# Switch for using system Eigen or GTSAM-bundled Eigen
|
||||
if(GTSAM_USE_SYSTEM_EIGEN)
|
||||
|
@ -206,14 +205,22 @@ if(GTSAM_USE_SYSTEM_EIGEN)
|
|||
|
||||
find_package(Eigen3 REQUIRED)
|
||||
include_directories(AFTER "${EIGEN3_INCLUDE_DIR}")
|
||||
|
||||
# check if MKL is also enabled - can have one or the other, but not both!
|
||||
if(EIGEN_USE_MKL_ALL)
|
||||
message(FATAL_ERROR "MKL cannot be used together with system-installed Eigen, as MKL support relies on patches which are not yet in the system-installed Eigen. Disable either GTSAM_USE_SYSTEM_EIGEN or GTSAM_WITH_EIGEN_MKL")
|
||||
endif()
|
||||
else()
|
||||
# Use bundled Eigen include paths e.g. <gtsam/3rdparty/Eigen/Eigen/Core>
|
||||
# Use bundled Eigen include path.
|
||||
set(GTSAM_EIGEN_INCLUDE_PREFIX "gtsam/3rdparty/Eigen/")
|
||||
|
||||
# Clear any variables set by FindEigen3
|
||||
if(EIGEN3_INCLUDE_DIR)
|
||||
set(EIGEN3_INCLUDE_DIR NOTFOUND CACHE STRING "" FORCE)
|
||||
endif()
|
||||
# Add the bundled version of eigen to the include path so that it can still be included
|
||||
# with #include <Eigen/Core>
|
||||
include_directories(BEFORE ${GTSAM_EIGEN_INCLUDE_PREFIX})
|
||||
endif()
|
||||
|
||||
# Write Eigen include file with the paths for either the system Eigen or the GTSAM-bundled Eigen
|
||||
|
@ -389,6 +396,11 @@ if(NOT MSVC AND NOT XCODE_VERSION)
|
|||
message(STATUS " C compilation flags : ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${cmake_build_type_toupper}}")
|
||||
message(STATUS " C++ compilation flags : ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${cmake_build_type_toupper}}")
|
||||
endif()
|
||||
if(GTSAM_USE_SYSTEM_EIGEN)
|
||||
message(STATUS " Use System Eigen : Yes")
|
||||
else()
|
||||
message(STATUS " Use System Eigen : No")
|
||||
endif()
|
||||
if(GTSAM_USE_TBB)
|
||||
message(STATUS " Use Intel TBB : Yes")
|
||||
elseif(TBB_FOUND)
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
#include <gtsam/base/timing.h>
|
||||
#include <gtsam/base/Vector.h>
|
||||
#include <gtsam/base/FastList.h>
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/SVD>
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/LU>
|
||||
#include <Eigen/SVD>
|
||||
#include <Eigen/LU>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
@ -706,6 +706,7 @@ std::string formatMatrixIndented(const std::string& label, const Matrix& matrix,
|
|||
return ss.str();
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
void inplace_QR(Matrix& A){
|
||||
size_t rows = A.rows();
|
||||
size_t cols = A.cols();
|
||||
|
@ -716,7 +717,13 @@ void inplace_QR(Matrix& A){
|
|||
HCoeffsType hCoeffs(size);
|
||||
RowVectorType temp(cols);
|
||||
|
||||
#ifdef GTSAM_USE_SYSTEM_EIGEN
|
||||
// System-Eigen is used, and MKL is off
|
||||
Eigen::internal::householder_qr_inplace_blocked<Matrix, HCoeffsType>(A, hCoeffs, 48, temp.data());
|
||||
#else
|
||||
// Patched Eigen is used, and MKL is either on or off
|
||||
Eigen::internal::householder_qr_inplace_blocked<Matrix, HCoeffsType>::run(A, hCoeffs, 48, temp.data());
|
||||
#endif
|
||||
|
||||
zeroBelowDiagonal(A);
|
||||
}
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#pragma once
|
||||
#include <gtsam/base/Vector.h>
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/Core>
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/Cholesky>
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/LU>
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/Cholesky>
|
||||
#include <Eigen/LU>
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/Dense>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
#ifndef OPTIONALJACOBIAN_NOBOOST
|
||||
#include <boost/optional.hpp>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#endif
|
||||
|
||||
#include <gtsam/global_includes.h>
|
||||
#include <gtsam/3rdparty/Eigen/Eigen/Core>
|
||||
#include <Eigen/Core>
|
||||
#include <iosfwd>
|
||||
#include <list>
|
||||
|
||||
|
|
|
@ -42,6 +42,9 @@
|
|||
// Whether we are using TBB (if TBB was found and GTSAM_WITH_TBB is enabled in CMake)
|
||||
#cmakedefine GTSAM_USE_TBB
|
||||
|
||||
// Whether we are using system-Eigen or our own patched version
|
||||
#cmakedefine GTSAM_USE_SYSTEM_EIGEN
|
||||
|
||||
// Whether Eigen will use MKL (if MKL was found and GTSAM_WITH_EIGEN_MKL is enabled in CMake)
|
||||
#cmakedefine GTSAM_USE_EIGEN_MKL
|
||||
#cmakedefine EIGEN_USE_MKL_ALL // This is also defined in gtsam_eigen_includes.h
|
||||
|
|
Loading…
Reference in New Issue