You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

246 lines
7.4 KiB

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