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)
|
### 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=705 (Fix MKL LLT return code)
|
||||||
### http://eigen.tuxfamily.org/bz/show_bug.cgi?id=716 (Improved comma initialization)
|
### 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)
|
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)
|
|
||||||
|
|
||||||
# Switch for using system Eigen or GTSAM-bundled Eigen
|
# Switch for using system Eigen or GTSAM-bundled Eigen
|
||||||
if(GTSAM_USE_SYSTEM_EIGEN)
|
if(GTSAM_USE_SYSTEM_EIGEN)
|
||||||
|
@ -206,14 +205,22 @@ if(GTSAM_USE_SYSTEM_EIGEN)
|
||||||
|
|
||||||
find_package(Eigen3 REQUIRED)
|
find_package(Eigen3 REQUIRED)
|
||||||
include_directories(AFTER "${EIGEN3_INCLUDE_DIR}")
|
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()
|
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/")
|
set(GTSAM_EIGEN_INCLUDE_PREFIX "gtsam/3rdparty/Eigen/")
|
||||||
|
|
||||||
# Clear any variables set by FindEigen3
|
# Clear any variables set by FindEigen3
|
||||||
if(EIGEN3_INCLUDE_DIR)
|
if(EIGEN3_INCLUDE_DIR)
|
||||||
set(EIGEN3_INCLUDE_DIR NOTFOUND CACHE STRING "" FORCE)
|
set(EIGEN3_INCLUDE_DIR NOTFOUND CACHE STRING "" FORCE)
|
||||||
endif()
|
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()
|
endif()
|
||||||
|
|
||||||
# Write Eigen include file with the paths for either the system Eigen or the GTSAM-bundled Eigen
|
# 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_C_FLAGS} ${CMAKE_C_FLAGS_${cmake_build_type_toupper}}")
|
||||||
message(STATUS " C++ compilation flags : ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${cmake_build_type_toupper}}")
|
message(STATUS " C++ compilation flags : ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${cmake_build_type_toupper}}")
|
||||||
endif()
|
endif()
|
||||||
|
if(GTSAM_USE_SYSTEM_EIGEN)
|
||||||
|
message(STATUS " Use System Eigen : Yes")
|
||||||
|
else()
|
||||||
|
message(STATUS " Use System Eigen : No")
|
||||||
|
endif()
|
||||||
if(GTSAM_USE_TBB)
|
if(GTSAM_USE_TBB)
|
||||||
message(STATUS " Use Intel TBB : Yes")
|
message(STATUS " Use Intel TBB : Yes")
|
||||||
elseif(TBB_FOUND)
|
elseif(TBB_FOUND)
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
#include <gtsam/base/timing.h>
|
#include <gtsam/base/timing.h>
|
||||||
#include <gtsam/base/Vector.h>
|
#include <gtsam/base/Vector.h>
|
||||||
#include <gtsam/base/FastList.h>
|
#include <gtsam/base/FastList.h>
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/SVD>
|
#include <Eigen/SVD>
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/LU>
|
#include <Eigen/LU>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
|
@ -706,6 +706,7 @@ std::string formatMatrixIndented(const std::string& label, const Matrix& matrix,
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
void inplace_QR(Matrix& A){
|
void inplace_QR(Matrix& A){
|
||||||
size_t rows = A.rows();
|
size_t rows = A.rows();
|
||||||
size_t cols = A.cols();
|
size_t cols = A.cols();
|
||||||
|
@ -716,7 +717,13 @@ void inplace_QR(Matrix& A){
|
||||||
HCoeffsType hCoeffs(size);
|
HCoeffsType hCoeffs(size);
|
||||||
RowVectorType temp(cols);
|
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());
|
Eigen::internal::householder_qr_inplace_blocked<Matrix, HCoeffsType>::run(A, hCoeffs, 48, temp.data());
|
||||||
|
#endif
|
||||||
|
|
||||||
zeroBelowDiagonal(A);
|
zeroBelowDiagonal(A);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <gtsam/base/Vector.h>
|
#include <gtsam/base/Vector.h>
|
||||||
#include <boost/math/special_functions/fpclassify.hpp>
|
#include <boost/math/special_functions/fpclassify.hpp>
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/Core>
|
#include <Eigen/Core>
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/Cholesky>
|
#include <Eigen/Cholesky>
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/LU>
|
#include <Eigen/LU>
|
||||||
#include <boost/format.hpp>
|
#include <boost/format.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/Dense>
|
#include <Eigen/Dense>
|
||||||
|
|
||||||
#ifndef OPTIONALJACOBIAN_NOBOOST
|
#ifndef OPTIONALJACOBIAN_NOBOOST
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gtsam/global_includes.h>
|
#include <gtsam/global_includes.h>
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/Core>
|
#include <Eigen/Core>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,9 @@
|
||||||
// Whether we are using TBB (if TBB was found and GTSAM_WITH_TBB is enabled in CMake)
|
// Whether we are using TBB (if TBB was found and GTSAM_WITH_TBB is enabled in CMake)
|
||||||
#cmakedefine GTSAM_USE_TBB
|
#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)
|
// Whether Eigen will use MKL (if MKL was found and GTSAM_WITH_EIGEN_MKL is enabled in CMake)
|
||||||
#cmakedefine GTSAM_USE_EIGEN_MKL
|
#cmakedefine GTSAM_USE_EIGEN_MKL
|
||||||
#cmakedefine EIGEN_USE_MKL_ALL // This is also defined in gtsam_eigen_includes.h
|
#cmakedefine EIGEN_USE_MKL_ALL // This is also defined in gtsam_eigen_includes.h
|
||||||
|
|
Loading…
Reference in New Issue