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.

284 lines
8.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. if(METIS_FOUND)
  80. add_definitions("-DEIGEN_METIS_SUPPORT")
  81. include_directories(${METIS_INCLUDES})
  82. ei_add_property(EIGEN_TESTED_BACKENDS "METIS, ")
  83. else()
  84. ei_add_property(EIGEN_MISSING_BACKENDS "METIS, ")
  85. endif()
  86. find_package(SPQR)
  87. if(SPQR_FOUND AND BLAS_FOUND AND LAPACK_FOUND)
  88. if(CHOLMOD_FOUND)
  89. add_definitions("-DEIGEN_SPQR_SUPPORT")
  90. include_directories(${SPQR_INCLUDES})
  91. set(SPQR_ALL_LIBS ${SPQR_LIBRARIES} ${CHOLMOD_LIBRARIES} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
  92. set(SPARSE_LIBS ${SPARSE_LIBS} ${SPQR_ALL_LIBS})
  93. ei_add_property(EIGEN_TESTED_BACKENDS "SPQR, ")
  94. else(CHOLMOD_FOUND)
  95. ei_add_property(EIGEN_MISSING_BACKENDS "SPQR, ")
  96. endif(CHOLMOD_FOUND)
  97. endif()
  98. option(EIGEN_TEST_NOQT "Disable Qt support in unit tests" OFF)
  99. if(NOT EIGEN_TEST_NOQT)
  100. find_package(Qt4)
  101. if(QT4_FOUND)
  102. include(${QT_USE_FILE})
  103. ei_add_property(EIGEN_TESTED_BACKENDS "Qt4 support, ")
  104. else()
  105. ei_add_property(EIGEN_MISSING_BACKENDS "Qt4 support, ")
  106. endif()
  107. endif(NOT EIGEN_TEST_NOQT)
  108. if(TEST_LIB)
  109. add_definitions("-DEIGEN_EXTERN_INSTANTIATIONS=1")
  110. endif(TEST_LIB)
  111. set_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT "Official")
  112. add_custom_target(BuildOfficial)
  113. ei_add_test(meta)
  114. ei_add_test(sizeof)
  115. ei_add_test(dynalloc)
  116. ei_add_test(nomalloc)
  117. ei_add_test(first_aligned)
  118. ei_add_test(mixingtypes)
  119. ei_add_test(packetmath)
  120. ei_add_test(unalignedassert)
  121. ei_add_test(vectorization_logic)
  122. ei_add_test(basicstuff)
  123. ei_add_test(linearstructure)
  124. ei_add_test(integer_types)
  125. ei_add_test(cwiseop)
  126. ei_add_test(unalignedcount)
  127. ei_add_test(exceptions)
  128. ei_add_test(redux)
  129. ei_add_test(visitor)
  130. ei_add_test(block)
  131. ei_add_test(corners)
  132. ei_add_test(product_small)
  133. ei_add_test(product_large)
  134. ei_add_test(product_extra)
  135. ei_add_test(diagonalmatrices)
  136. ei_add_test(adjoint)
  137. ei_add_test(diagonal)
  138. ei_add_test(miscmatrices)
  139. ei_add_test(commainitializer)
  140. ei_add_test(smallvectors)
  141. ei_add_test(mapped_matrix)
  142. ei_add_test(mapstride)
  143. ei_add_test(mapstaticmethods)
  144. ei_add_test(array)
  145. ei_add_test(array_for_matrix)
  146. ei_add_test(array_replicate)
  147. ei_add_test(array_reverse)
  148. ei_add_test(ref)
  149. ei_add_test(triangular)
  150. ei_add_test(selfadjoint)
  151. ei_add_test(product_selfadjoint)
  152. ei_add_test(product_symm)
  153. ei_add_test(product_syrk)
  154. ei_add_test(product_trmv)
  155. ei_add_test(product_trmm)
  156. ei_add_test(product_trsolve)
  157. ei_add_test(product_mmtr)
  158. ei_add_test(product_notemporary)
  159. ei_add_test(stable_norm)
  160. ei_add_test(bandmatrix)
  161. ei_add_test(cholesky)
  162. ei_add_test(lu)
  163. ei_add_test(determinant)
  164. ei_add_test(inverse)
  165. ei_add_test(qr)
  166. ei_add_test(qr_colpivoting)
  167. ei_add_test(qr_fullpivoting)
  168. ei_add_test(upperbidiagonalization)
  169. ei_add_test(hessenberg)
  170. ei_add_test(schur_real)
  171. ei_add_test(schur_complex)
  172. ei_add_test(eigensolver_selfadjoint)
  173. ei_add_test(eigensolver_generic)
  174. ei_add_test(eigensolver_complex)
  175. ei_add_test(real_qz)
  176. ei_add_test(eigensolver_generalized_real)
  177. ei_add_test(jacobi)
  178. ei_add_test(jacobisvd)
  179. ei_add_test(geo_orthomethods)
  180. ei_add_test(geo_homogeneous)
  181. ei_add_test(geo_quaternion)
  182. ei_add_test(geo_transformations)
  183. ei_add_test(geo_eulerangles)
  184. ei_add_test(geo_hyperplane)
  185. ei_add_test(geo_parametrizedline)
  186. ei_add_test(geo_alignedbox)
  187. ei_add_test(stdvector)
  188. ei_add_test(stdvector_overload)
  189. ei_add_test(stdlist)
  190. ei_add_test(stddeque)
  191. ei_add_test(resize)
  192. ei_add_test(sparse_vector)
  193. ei_add_test(sparse_basic)
  194. ei_add_test(sparse_product)
  195. ei_add_test(sparse_solvers)
  196. ei_add_test(umeyama)
  197. ei_add_test(householder)
  198. ei_add_test(swap)
  199. ei_add_test(conservative_resize)
  200. ei_add_test(permutationmatrices)
  201. ei_add_test(sparse_permutations)
  202. ei_add_test(nullary)
  203. ei_add_test(nesting_ops "${CMAKE_CXX_FLAGS_DEBUG}")
  204. ei_add_test(zerosized)
  205. ei_add_test(dontalign)
  206. ei_add_test(sizeoverflow)
  207. ei_add_test(prec_inverse_4x4)
  208. ei_add_test(vectorwiseop)
  209. ei_add_test(special_numbers)
  210. ei_add_test(simplicial_cholesky)
  211. ei_add_test(conjugate_gradient)
  212. ei_add_test(bicgstab)
  213. ei_add_test(sparselu)
  214. ei_add_test(sparseqr)
  215. # ei_add_test(denseLM)
  216. if(QT4_FOUND)
  217. ei_add_test(qtvector "" "${QT_QTCORE_LIBRARY}")
  218. endif(QT4_FOUND)
  219. ei_add_test(eigen2support)
  220. if(UMFPACK_FOUND)
  221. ei_add_test(umfpack_support "" "${UMFPACK_ALL_LIBS}")
  222. endif()
  223. if(SUPERLU_FOUND)
  224. ei_add_test(superlu_support "" "${SUPERLU_ALL_LIBS}")
  225. endif()
  226. if(CHOLMOD_FOUND)
  227. ei_add_test(cholmod_support "" "${CHOLMOD_ALL_LIBS}")
  228. endif()
  229. if(PARDISO_FOUND)
  230. ei_add_test(pardiso_support "" "${PARDISO_ALL_LIBS}")
  231. endif()
  232. if(PASTIX_FOUND AND (SCOTCH_FOUND OR METIS_FOUND))
  233. ei_add_test(pastix_support "" "${PASTIX_ALL_LIBS}")
  234. endif()
  235. if(SPQR_FOUND AND CHOLMOD_FOUND)
  236. ei_add_test(spqr_support "" "${SPQR_ALL_LIBS}")
  237. endif()
  238. if(METIS_FOUND)
  239. ei_add_test(metis_support "" "${METIS_LIBRARIES}")
  240. endif()
  241. string(TOLOWER "${CMAKE_CXX_COMPILER}" cmake_cxx_compiler_tolower)
  242. if(cmake_cxx_compiler_tolower MATCHES "qcc")
  243. set(CXX_IS_QCC "ON")
  244. endif()
  245. ei_add_property(EIGEN_TESTING_SUMMARY "CXX: ${CMAKE_CXX_COMPILER}\n")
  246. if(CMAKE_COMPILER_IS_GNUCXX AND NOT CXX_IS_QCC)
  247. execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version COMMAND head -n 1 OUTPUT_VARIABLE EIGEN_CXX_VERSION_STRING OUTPUT_STRIP_TRAILING_WHITESPACE)
  248. ei_add_property(EIGEN_TESTING_SUMMARY "CXX_VERSION: ${EIGEN_CXX_VERSION_STRING}\n")
  249. endif()
  250. ei_add_property(EIGEN_TESTING_SUMMARY "CXX_FLAGS: ${CMAKE_CXX_FLAGS}\n")
  251. ei_add_property(EIGEN_TESTING_SUMMARY "Sparse lib flags: ${SPARSE_LIBS}\n")
  252. option(EIGEN_TEST_EIGEN2 "Run whole Eigen2 test suite against EIGEN2_SUPPORT" OFF)
  253. if(EIGEN_TEST_EIGEN2)
  254. add_subdirectory(eigen2)
  255. endif()