1 2# generate split test header file 3message(STATUS ${CMAKE_CURRENT_BINARY_DIR}) 4file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h "") 5foreach(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 ) 13endforeach() 14 15# configure blas/lapack (use Eigen's ones) 16set(BLAS_FOUND TRUE) 17set(LAPACK_FOUND TRUE) 18set(BLAS_LIBRARIES eigen_blas) 19set(LAPACK_LIBRARIES eigen_lapack) 20 21set(EIGEN_TEST_MATRIX_DIR "" CACHE STRING "Enable testing of realword sparse matrices contained in the specified path") 22if(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) 29endif(EIGEN_TEST_MATRIX_DIR) 30 31set(SPARSE_LIBS " ") 32 33find_package(Cholmod) 34if(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, ") 40else() 41 ei_add_property(EIGEN_MISSING_BACKENDS "Cholmod, ") 42endif() 43 44find_package(Umfpack) 45if(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, ") 51else() 52 ei_add_property(EIGEN_MISSING_BACKENDS "UmfPack, ") 53endif() 54 55find_package(SuperLU) 56if(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, ") 62else() 63 ei_add_property(EIGEN_MISSING_BACKENDS "SuperLU, ") 64endif() 65 66 67find_package(Pastix) 68find_package(Scotch) 69find_package(Metis) 70if(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, ") 85else() 86 ei_add_property(EIGEN_MISSING_BACKENDS "PaStiX, ") 87endif() 88 89option(EIGEN_TEST_NOQT "Disable Qt support in unit tests" OFF) 90if(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() 98endif(NOT EIGEN_TEST_NOQT) 99 100if(TEST_LIB) 101 add_definitions("-DEIGEN_EXTERN_INSTANTIATIONS=1") 102endif(TEST_LIB) 103 104ei_add_test(meta) 105ei_add_test(sizeof) 106ei_add_test(dynalloc) 107ei_add_test(nomalloc) 108ei_add_test(first_aligned) 109ei_add_test(mixingtypes) 110ei_add_test(packetmath) 111ei_add_test(unalignedassert) 112ei_add_test(vectorization_logic) 113ei_add_test(basicstuff) 114ei_add_test(linearstructure) 115ei_add_test(integer_types) 116ei_add_test(cwiseop) 117ei_add_test(unalignedcount) 118ei_add_test(exceptions) 119ei_add_test(redux) 120ei_add_test(visitor) 121ei_add_test(block) 122ei_add_test(corners) 123ei_add_test(product_small) 124ei_add_test(product_large) 125ei_add_test(product_extra) 126ei_add_test(diagonalmatrices) 127ei_add_test(adjoint) 128ei_add_test(diagonal) 129ei_add_test(miscmatrices) 130ei_add_test(commainitializer) 131ei_add_test(smallvectors) 132ei_add_test(map) 133ei_add_test(mapstride) 134ei_add_test(mapstaticmethods) 135ei_add_test(array) 136ei_add_test(array_for_matrix) 137ei_add_test(array_replicate) 138ei_add_test(array_reverse) 139ei_add_test(triangular) 140ei_add_test(selfadjoint) 141ei_add_test(product_selfadjoint) 142ei_add_test(product_symm) 143ei_add_test(product_syrk) 144ei_add_test(product_trmv) 145ei_add_test(product_trmm) 146ei_add_test(product_trsolve) 147ei_add_test(product_mmtr) 148ei_add_test(product_notemporary) 149ei_add_test(stable_norm) 150ei_add_test(bandmatrix) 151ei_add_test(cholesky) 152ei_add_test(lu) 153ei_add_test(determinant) 154ei_add_test(inverse) 155ei_add_test(qr) 156ei_add_test(qr_colpivoting) 157ei_add_test(qr_fullpivoting) 158ei_add_test(upperbidiagonalization) 159ei_add_test(hessenberg) 160ei_add_test(schur_real) 161ei_add_test(schur_complex) 162ei_add_test(eigensolver_selfadjoint) 163ei_add_test(eigensolver_generic) 164ei_add_test(eigensolver_complex) 165ei_add_test(jacobi) 166ei_add_test(jacobisvd) 167ei_add_test(geo_orthomethods) 168ei_add_test(geo_homogeneous) 169ei_add_test(geo_quaternion) 170ei_add_test(geo_transformations) 171ei_add_test(geo_eulerangles) 172ei_add_test(geo_hyperplane) 173ei_add_test(geo_parametrizedline) 174ei_add_test(geo_alignedbox) 175ei_add_test(stdvector) 176ei_add_test(stdvector_overload) 177ei_add_test(stdlist) 178ei_add_test(stddeque) 179ei_add_test(resize) 180if(QT4_FOUND) 181 ei_add_test(qtvector "" "${QT_QTCORE_LIBRARY}") 182endif(QT4_FOUND) 183ei_add_test(sparse_vector) 184ei_add_test(sparse_basic) 185ei_add_test(sparse_product) 186ei_add_test(sparse_solvers) 187ei_add_test(umeyama) 188ei_add_test(householder) 189ei_add_test(swap) 190ei_add_test(conservative_resize) 191ei_add_test(permutationmatrices) 192ei_add_test(sparse_permutations) 193ei_add_test(eigen2support) 194ei_add_test(nullary) 195ei_add_test(nesting_ops "${CMAKE_CXX_FLAGS_DEBUG}") 196ei_add_test(zerosized) 197ei_add_test(dontalign) 198ei_add_test(sizeoverflow) 199ei_add_test(prec_inverse_4x4) 200ei_add_test(vectorwiseop) 201 202ei_add_test(simplicial_cholesky) 203ei_add_test(conjugate_gradient) 204ei_add_test(bicgstab) 205 206 207if(UMFPACK_FOUND) 208 ei_add_test(umfpack_support "" "${UMFPACK_ALL_LIBS}") 209endif() 210 211if(SUPERLU_FOUND) 212 ei_add_test(superlu_support "" "${SUPERLU_ALL_LIBS}") 213endif() 214 215if(CHOLMOD_FOUND) 216 ei_add_test(cholmod_support "" "${CHOLMOD_ALL_LIBS}") 217endif() 218 219if(PARDISO_FOUND) 220 ei_add_test(pardiso_support "" "${PARDISO_ALL_LIBS}") 221endif() 222 223if(PASTIX_FOUND AND (SCOTCH_FOUND OR METIS_FOUND)) 224 ei_add_test(pastix_support "" "${PASTIX_ALL_LIBS}") 225endif() 226 227string(TOLOWER "${CMAKE_CXX_COMPILER}" cmake_cxx_compiler_tolower) 228if(cmake_cxx_compiler_tolower MATCHES "qcc") 229 set(CXX_IS_QCC "ON") 230endif() 231 232ei_add_property(EIGEN_TESTING_SUMMARY "CXX: ${CMAKE_CXX_COMPILER}\n") 233if(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") 236endif() 237ei_add_property(EIGEN_TESTING_SUMMARY "CXX_FLAGS: ${CMAKE_CXX_FLAGS}\n") 238ei_add_property(EIGEN_TESTING_SUMMARY "Sparse lib flags: ${SPARSE_LIBS}\n") 239 240option(EIGEN_TEST_EIGEN2 "Run whole Eigen2 test suite against EIGEN2_SUPPORT" OFF) 241if(EIGEN_TEST_EIGEN2) 242 add_subdirectory(eigen2) 243endif() 244