1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
@@ -34,6 +34,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") #set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") endif() +add_definitions("-DBOOST_ALL_NO_LIB=1") LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules) @@ -46,13 +47,15 @@ if(NOT OpenCV_FOUND) endif() MESSAGE(STATUS "OpenCV VERSION: ${OpenCV_VERSION}") -find_package(Eigen3 3.1.0 REQUIRED) +# find_package(Eigen3 REQUIRED) +set(EIGEN3_INCLUDE_DIR "F:/BASE_ENV/forOpenMVS/eigen") +MESSAGE("eigen & boost inlcude dir is: @@@@@@" ${EIGEN3_INCLUDE_DIRS}) find_package(Pangolin REQUIRED) find_package(realsense2) find_package(Boost REQUIRED COMPONENTS serialization) -MESSAGE(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}") +MESSAGE(STATUS "cxy@@@@@@@@@@ Boost_INCLUDE_DIRS & Boost_LIBRARIES: ${Boost_INCLUDE_DIRS} ${Boost_LIBRARIES}") set(OPENSSL_USE_STATIC_LIBS TRUE) find_package(OpenSSL REQUIRED) # for crypto library @@ -65,6 +68,7 @@ include_directories( ${EIGEN3_INCLUDE_DIR} ${Pangolin_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} ) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
@@ -51,10 +51,16 @@ if(NOT OpenCV_FOUND) endif() endif() MESSAGE(STATUS "OpenCV VERSION: ${OpenCV_VERSION}") -include_directories(${OpenCV_INCLUDE_DIRS}) -target_link_libraries(DBoW2 ${OpenCV_LIBS}) # add Boost -find_package(Boost REQUIRED COMPONENTS serialization) -message(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}") -target_link_libraries(DBoW2 ${Boost_LIBRARIES}) +set(Boost_USE_STATIC_LIBS ON) +add_definitions("-DBOOST_ALL_NO_LIB=1") +find_package(Boost REQUIRED COMPONENTS + serialization) +message(STATUS "cxy@@@@@@@@ Boost_INCLUDE_DIRS & libs: ${Boost_INCLUDE_DIRS} >>>> ${Boost_LIBRARIES}") + +include_directories(${OpenCV_INCLUDE_DIRS} ${BOOST_INCLUDEDIR}) +target_link_libraries(DBoW2 + ${OpenCV_LIBS} + ${Boost_LIBRARIES} +)
@@ -24,6 +24,13 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// add these marcos to fix: +// 1>f:\prjs\orb_slam3\thirdparty\g2o\g2o\core\sparse_block_matrix.hpp(277): fatal error C1001: 编译器中发生内部错误。 + +#define _AXPY(MatrixType,A,x,xoff,y,yoff)y.segment<MatrixType::RowsAtCompileTime>(yoff) += (A) * (x).segment<MatrixType::ColsAtCompileTime>(xoff) +#define _ATXPY(MatrixType,A,x,xoff,y,yoff)y.segment<MatrixType::ColsAtCompileTime>(yoff) += (A).transpose() * (x).segment<MatrixType::RowsAtCompileTime>(xoff) + + namespace g2o { using namespace Eigen; @@ -249,7 +256,8 @@ namespace g2o { const typename SparseBlockMatrix<MatrixType>::SparseMatrixBlock* a=it->second; int destOffset = it->first ? _rowBlockIndices[it->first - 1] : 0; // destVec += *a * srcVec (according to the sub-vector parts) - internal::axpy(*a, srcVec, srcOffset, destVec, destOffset); + // internal::axpy(*a, srcVec, srcOffset, destVec, destOffset); + _AXPY(MatrixType, *a, srcVec, srcOffset, destVec, destOffset); } } } @@ -274,9 +282,12 @@ namespace g2o { if (destOffset > srcOffset) // only upper triangle break; // destVec += *a * srcVec (according to the sub-vector parts) - internal::axpy(*a, srcVec, srcOffset, destVec, destOffset); - if (destOffset < srcOffset) - internal::atxpy(*a, srcVec, destOffset, destVec, srcOffset); + // internal::axpy(*a, srcVec, srcOffset, destVec, destOffset); + _AXPY(MatrixType, *a, srcVec, srcOffset, destVec, destOffset); + if (destOffset < srcOffset) { + // internal::atxpy(*a, srcVec, destOffset, destVec, srcOffset); + _ATXPY(MatrixType, *a, srcVec, destOffset, destVec, srcOffset); + } } } } @@ -305,7 +316,8 @@ namespace g2o { const typename SparseBlockMatrix<MatrixType>::SparseMatrixBlock* a=it->second; int srcOffset = rowBaseOfBlock(it->first); // destVec += *a.transpose() * srcVec (according to the sub-vector parts) - internal::atxpy(*a, srcVec, srcOffset, destVec, destOffset); + // internal::atxpy(*a, srcVec, srcOffset, destVec, destOffset); + _ATXPY(MatrixType, *a, srcVec, srcOffset, destVec, destOffset); } }
@@ -24,6 +24,9 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#define _AXPY(MatrixType,A,x,xoff,y,yoff)y.segment<MatrixType::RowsAtCompileTime>(yoff) += (A) * (x).segment<MatrixType::ColsAtCompileTime>(xoff) +#define _ATXPY(MatrixType,A,x,xoff,y,yoff)y.segment<MatrixType::ColsAtCompileTime>(yoff) += (A).transpose() * (x).segment<MatrixType::RowsAtCompileTime>(xoff) + #ifndef G2O_SPARSE_BLOCK_MATRIX_CCS_H #define G2O_SPARSE_BLOCK_MATRIX_CCS_H @@ -122,7 +125,8 @@ namespace g2o { const SparseMatrixBlock* a = it->block; int srcOffset = rowBaseOfBlock(it->row); // destVec += *a.transpose() * srcVec (according to the sub-vector parts) - internal::atxpy(*a, srcVec, srcOffset, destVec, destOffset); + // internal::atxpy(*a, srcVec, srcOffset, destVec, destOffset); + _ATXPY(MatrixType, *a, srcVec, srcOffset, destVec, destOffset); } } }
@@ -24,6 +24,9 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#define _AXPY(MatrixType,A,x,xoff,y,yoff)y.segment<MatrixType::RowsAtCompileTime>(yoff) += (A) * (x).segment<MatrixType::ColsAtCompileTime>(xoff) +#define _ATXPY(MatrixType,A,x,xoff,y,yoff)y.segment<MatrixType::ColsAtCompileTime>(yoff) += (A).transpose() * (x).segment<MatrixType::RowsAtCompileTime>(xoff) + #ifndef G2O_SPARSE_BLOCK_MATRIX_DIAGONAL_H #define G2O_SPARSE_BLOCK_MATRIX_DIAGONAL_H @@ -94,7 +97,8 @@ namespace g2o { int srcOffset = destOffset; const SparseMatrixBlock& A = _diagonal[i]; // destVec += *A.transpose() * srcVec (according to the sub-vector parts) - internal::axpy(A, srcVec, srcOffset, destVec, destOffset); + // internal::axpy(A, srcVec, srcOffset, destVec, destOffset); + _AXPY(MatrixType, A, srcVec, srcOffset, destVec, destOffset); } }
|