1 2 # generate split test header file 3 message(STATUS ${CMAKE_CURRENT_BINARY_DIR}) 4 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h "") 5 foreach(i RANGE 1 999) 6 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h 7 "#ifdef EIGEN_TEST_PART_${i}\n" 8 "#define CALL_SUBTEST_${i}(FUNC) CALL_SUBTEST(FUNC)\n" 9 "#else\n" 10 "#define CALL_SUBTEST_${i}(FUNC)\n" 11 "#endif\n\n" 12 ) 13 endforeach() 14 15 # configure blas/lapack (use Eigen's ones) 16 set(BLAS_FOUND TRUE) 17 set(LAPACK_FOUND TRUE) 18 set(BLAS_LIBRARIES eigen_blas) 19 set(LAPACK_LIBRARIES eigen_lapack) 20 21 set(EIGEN_TEST_MATRIX_DIR "" CACHE STRING "Enable testing of realword sparse matrices contained in the specified path") 22 if(EIGEN_TEST_MATRIX_DIR) 23 if(NOT WIN32) 24 message(STATUS "Test realworld sparse matrices: ${EIGEN_TEST_MATRIX_DIR}") 25 add_definitions( -DTEST_REAL_CASES="${EIGEN_TEST_MATRIX_DIR}" ) 26 else(NOT WIN32) 27 message(STATUS "REAL CASES CAN NOT BE CURRENTLY TESTED ON WIN32") 28 endif(NOT WIN32) 29 endif(EIGEN_TEST_MATRIX_DIR) 30 31 set(SPARSE_LIBS " ") 32 33 find_package(Cholmod) 34 if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND) 35 add_definitions("-DEIGEN_CHOLMOD_SUPPORT") 36 include_directories(${CHOLMOD_INCLUDES}) 37 set(SPARSE_LIBS ${SPARSE_LIBS} ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) 38 set(CHOLMOD_ALL_LIBS ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) 39 ei_add_property(EIGEN_TESTED_BACKENDS "Cholmod, ") 40 else() 41 ei_add_property(EIGEN_MISSING_BACKENDS "Cholmod, ") 42 endif() 43 44 find_package(Umfpack) 45 if(UMFPACK_FOUND AND BLAS_FOUND) 46 add_definitions("-DEIGEN_UMFPACK_SUPPORT") 47 include_directories(${UMFPACK_INCLUDES}) 48 set(SPARSE_LIBS ${SPARSE_LIBS} ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES}) 49 set(UMFPACK_ALL_LIBS ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES}) 50 ei_add_property(EIGEN_TESTED_BACKENDS "UmfPack, ") 51 else() 52 ei_add_property(EIGEN_MISSING_BACKENDS "UmfPack, ") 53 endif() 54 55 find_package(SuperLU) 56 if(SUPERLU_FOUND AND BLAS_FOUND) 57 add_definitions("-DEIGEN_SUPERLU_SUPPORT") 58 include_directories(${SUPERLU_INCLUDES}) 59 set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) 60 set(SUPERLU_ALL_LIBS ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) 61 ei_add_property(EIGEN_TESTED_BACKENDS "SuperLU, ") 62 else() 63 ei_add_property(EIGEN_MISSING_BACKENDS "SuperLU, ") 64 endif() 65 66 67 find_package(Pastix) 68 find_package(Scotch) 69 find_package(Metis) 70 if(PASTIX_FOUND AND BLAS_FOUND) 71 add_definitions("-DEIGEN_PASTIX_SUPPORT") 72 include_directories(${PASTIX_INCLUDES}) 73 if(SCOTCH_FOUND) 74 include_directories(${SCOTCH_INCLUDES}) 75 set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${SCOTCH_LIBRARIES}) 76 elseif(METIS_FOUND) 77 include_directories(${METIS_INCLUDES}) 78 set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${METIS_LIBRARIES}) 79 else(SCOTCH_FOUND) 80 ei_add_property(EIGEN_MISSING_BACKENDS "PaStiX, ") 81 endif(SCOTCH_FOUND) 82 set(SPARSE_LIBS ${SPARSE_LIBS} ${PASTIX_LIBRARIES} ${ORDERING_LIBRARIES} ${BLAS_LIBRARIES}) 83 set(PASTIX_ALL_LIBS ${PASTIX_LIBRARIES} ${BLAS_LIBRARIES}) 84 ei_add_property(EIGEN_TESTED_BACKENDS "PaStiX, ") 85 else() 86 ei_add_property(EIGEN_MISSING_BACKENDS "PaStiX, ") 87 endif() 88 89 option(EIGEN_TEST_NOQT "Disable Qt support in unit tests" OFF) 90 if(NOT EIGEN_TEST_NOQT) 91 find_package(Qt4) 92 if(QT4_FOUND) 93 include(${QT_USE_FILE}) 94 ei_add_property(EIGEN_TESTED_BACKENDS "Qt4 support, ") 95 else() 96 ei_add_property(EIGEN_MISSING_BACKENDS "Qt4 support, ") 97 endif() 98 endif(NOT EIGEN_TEST_NOQT) 99 100 if(TEST_LIB) 101 add_definitions("-DEIGEN_EXTERN_INSTANTIATIONS=1") 102 endif(TEST_LIB) 103 104 ei_add_test(meta) 105 ei_add_test(sizeof) 106 ei_add_test(dynalloc) 107 ei_add_test(nomalloc) 108 ei_add_test(first_aligned) 109 ei_add_test(mixingtypes) 110 ei_add_test(packetmath) 111 ei_add_test(unalignedassert) 112 ei_add_test(vectorization_logic) 113 ei_add_test(basicstuff) 114 ei_add_test(linearstructure) 115 ei_add_test(integer_types) 116 ei_add_test(cwiseop) 117 ei_add_test(unalignedcount) 118 ei_add_test(exceptions) 119 ei_add_test(redux) 120 ei_add_test(visitor) 121 ei_add_test(block) 122 ei_add_test(corners) 123 ei_add_test(product_small) 124 ei_add_test(product_large) 125 ei_add_test(product_extra) 126 ei_add_test(diagonalmatrices) 127 ei_add_test(adjoint) 128 ei_add_test(diagonal) 129 ei_add_test(miscmatrices) 130 ei_add_test(commainitializer) 131 ei_add_test(smallvectors) 132 ei_add_test(map) 133 ei_add_test(mapstride) 134 ei_add_test(mapstaticmethods) 135 ei_add_test(array) 136 ei_add_test(array_for_matrix) 137 ei_add_test(array_replicate) 138 ei_add_test(array_reverse) 139 ei_add_test(triangular) 140 ei_add_test(selfadjoint) 141 ei_add_test(product_selfadjoint) 142 ei_add_test(product_symm) 143 ei_add_test(product_syrk) 144 ei_add_test(product_trmv) 145 ei_add_test(product_trmm) 146 ei_add_test(product_trsolve) 147 ei_add_test(product_mmtr) 148 ei_add_test(product_notemporary) 149 ei_add_test(stable_norm) 150 ei_add_test(bandmatrix) 151 ei_add_test(cholesky) 152 ei_add_test(lu) 153 ei_add_test(determinant) 154 ei_add_test(inverse) 155 ei_add_test(qr) 156 ei_add_test(qr_colpivoting) 157 ei_add_test(qr_fullpivoting) 158 ei_add_test(upperbidiagonalization) 159 ei_add_test(hessenberg) 160 ei_add_test(schur_real) 161 ei_add_test(schur_complex) 162 ei_add_test(eigensolver_selfadjoint) 163 ei_add_test(eigensolver_generic) 164 ei_add_test(eigensolver_complex) 165 ei_add_test(jacobi) 166 ei_add_test(jacobisvd) 167 ei_add_test(geo_orthomethods) 168 ei_add_test(geo_homogeneous) 169 ei_add_test(geo_quaternion) 170 ei_add_test(geo_transformations) 171 ei_add_test(geo_eulerangles) 172 ei_add_test(geo_hyperplane) 173 ei_add_test(geo_parametrizedline) 174 ei_add_test(geo_alignedbox) 175 ei_add_test(stdvector) 176 ei_add_test(stdvector_overload) 177 ei_add_test(stdlist) 178 ei_add_test(stddeque) 179 ei_add_test(resize) 180 if(QT4_FOUND) 181 ei_add_test(qtvector "" "${QT_QTCORE_LIBRARY}") 182 endif(QT4_FOUND) 183 ei_add_test(sparse_vector) 184 ei_add_test(sparse_basic) 185 ei_add_test(sparse_product) 186 ei_add_test(sparse_solvers) 187 ei_add_test(umeyama) 188 ei_add_test(householder) 189 ei_add_test(swap) 190 ei_add_test(conservative_resize) 191 ei_add_test(permutationmatrices) 192 ei_add_test(sparse_permutations) 193 ei_add_test(eigen2support) 194 ei_add_test(nullary) 195 ei_add_test(nesting_ops "${CMAKE_CXX_FLAGS_DEBUG}") 196 ei_add_test(zerosized) 197 ei_add_test(dontalign) 198 ei_add_test(sizeoverflow) 199 ei_add_test(prec_inverse_4x4) 200 ei_add_test(vectorwiseop) 201 202 ei_add_test(simplicial_cholesky) 203 ei_add_test(conjugate_gradient) 204 ei_add_test(bicgstab) 205 206 207 if(UMFPACK_FOUND) 208 ei_add_test(umfpack_support "" "${UMFPACK_ALL_LIBS}") 209 endif() 210 211 if(SUPERLU_FOUND) 212 ei_add_test(superlu_support "" "${SUPERLU_ALL_LIBS}") 213 endif() 214 215 if(CHOLMOD_FOUND) 216 ei_add_test(cholmod_support "" "${CHOLMOD_ALL_LIBS}") 217 endif() 218 219 if(PARDISO_FOUND) 220 ei_add_test(pardiso_support "" "${PARDISO_ALL_LIBS}") 221 endif() 222 223 if(PASTIX_FOUND AND (SCOTCH_FOUND OR METIS_FOUND)) 224 ei_add_test(pastix_support "" "${PASTIX_ALL_LIBS}") 225 endif() 226 227 string(TOLOWER "${CMAKE_CXX_COMPILER}" cmake_cxx_compiler_tolower) 228 if(cmake_cxx_compiler_tolower MATCHES "qcc") 229 set(CXX_IS_QCC "ON") 230 endif() 231 232 ei_add_property(EIGEN_TESTING_SUMMARY "CXX: ${CMAKE_CXX_COMPILER}\n") 233 if(CMAKE_COMPILER_IS_GNUCXX AND NOT CXX_IS_QCC) 234 execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version COMMAND head -n 1 OUTPUT_VARIABLE EIGEN_CXX_VERSION_STRING OUTPUT_STRIP_TRAILING_WHITESPACE) 235 ei_add_property(EIGEN_TESTING_SUMMARY "CXX_VERSION: ${EIGEN_CXX_VERSION_STRING}\n") 236 endif() 237 ei_add_property(EIGEN_TESTING_SUMMARY "CXX_FLAGS: ${CMAKE_CXX_FLAGS}\n") 238 ei_add_property(EIGEN_TESTING_SUMMARY "Sparse lib flags: ${SPARSE_LIBS}\n") 239 240 option(EIGEN_TEST_EIGEN2 "Run whole Eigen2 test suite against EIGEN2_SUPPORT" OFF) 241 if(EIGEN_TEST_EIGEN2) 242 add_subdirectory(eigen2) 243 endif() 244