aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/CMakeLists.txt
blob: f3c15612fdeb9da179bfcea9a2c7b2289afb9202 (plain)
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

include(EigenTesting)
enable_testing()
ei_init_testing()

find_package(GSL)
if(GSL_FOUND AND GSL_VERSION_MINOR LESS 9)
  set(GSL_FOUND "")
endif(GSL_FOUND AND GSL_VERSION_MINOR LESS 9)
if(GSL_FOUND)
  add_definitions("-DHAS_GSL" ${GSL_DEFINITIONS})
  include_directories(${GSL_INCLUDE_DIR})
  ei_add_property(EIGEN_TESTED_BACKENDS "GSL, ")
else(GSL_FOUND)
  ei_add_property(EIGEN_MISSING_BACKENDS "GSL, ")
  set(GSL_LIBRARIES " ")
endif(GSL_FOUND)

set(SPARSE_LIBS "")

find_package(Taucs)
if(TAUCS_FOUND)
  add_definitions("-DEIGEN_TAUCS_SUPPORT")
  include_directories(${TAUCS_INCLUDES})
  set(SPARSE_LIBS ${SPARSE_LIBS} ${TAUCS_LIBRARIES})
  ei_add_property(EIGEN_TESTED_BACKENDS "Taucs, ")
else(TAUCS_FOUND)
  ei_add_property(EIGEN_MISSING_BACKENDS "Taucs, ")
endif(TAUCS_FOUND)

find_package(Cholmod)
if(CHOLMOD_FOUND)
  add_definitions("-DEIGEN_CHOLMOD_SUPPORT")
  include_directories(${CHOLMOD_INCLUDES})
  set(SPARSE_LIBS ${SPARSE_LIBS} ${CHOLMOD_LIBRARIES})
  ei_add_property(EIGEN_TESTED_BACKENDS "Cholmod, ")
else(CHOLMOD_FOUND)
  ei_add_property(EIGEN_MISSING_BACKENDS "Cholmod, ")
endif(CHOLMOD_FOUND)

find_package(Umfpack)
if(UMFPACK_FOUND)
  add_definitions("-DEIGEN_UMFPACK_SUPPORT")
  include_directories(${UMFPACK_INCLUDES})
  set(SPARSE_LIBS ${SPARSE_LIBS} ${UMFPACK_LIBRARIES})
  ei_add_property(EIGEN_TESTED_BACKENDS "UmfPack, ")
else(UMFPACK_FOUND)
  ei_add_property(EIGEN_MISSING_BACKENDS "UmfPack, ")
endif(UMFPACK_FOUND)

find_package(SuperLU)
if(SUPERLU_FOUND)
  add_definitions("-DEIGEN_SUPERLU_SUPPORT")
  include_directories(${SUPERLU_INCLUDES})
  set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES})
  ei_add_property(EIGEN_TESTED_BACKENDS  "SuperLU, ")
else(SUPERLU_FOUND)
  ei_add_property(EIGEN_MISSING_BACKENDS  "SuperLU, ")
endif(SUPERLU_FOUND)

find_package(GoogleHash)
if(GOOGLEHASH_FOUND)
  add_definitions("-DEIGEN_GOOGLEHASH_SUPPORT")
  include_directories(${GOOGLEHASH_INCLUDES})
  ei_add_property(EIGEN_TESTED_BACKENDS  "GoogleHash, ")
else(GOOGLEHASH_FOUND)
  ei_add_property(EIGEN_MISSING_BACKENDS  "GoogleHash, ")
endif(GOOGLEHASH_FOUND)

option(EIGEN_TEST_NOQT "Disable Qt support in unit tests" OFF)
if(NOT EIGEN_TEST_NOQT)
  find_package(Qt4)
endif(NOT EIGEN_TEST_NOQT)
if(QT4_FOUND)
  include(${QT_USE_FILE})
  ei_add_property(EIGEN_TESTED_BACKENDS  "Qt4 support, ")
else(QT4_FOUND)
  ei_add_property(EIGEN_MISSING_BACKENDS  "Qt4 support, ")
endif(QT4_FOUND)

if(TEST_LIB)
  add_definitions("-DEIGEN_EXTERN_INSTANTIATIONS=1")
endif(TEST_LIB)

ei_add_test(meta)
ei_add_test(sizeof)
ei_add_test(dynalloc)
ei_add_test(nomalloc)
ei_add_test(mixingtypes)
ei_add_test(packetmath)
ei_add_test(unalignedassert)
ei_add_test(vectorization_logic)
ei_add_test(basicstuff)
ei_add_test(linearstructure)
ei_add_test(cwiseop)
ei_add_test(redux)
ei_add_test(visitor)
ei_add_test(product_small)
ei_add_test(product_large ${EI_OFLAG})
ei_add_test(product_extra ${EI_OFLAG})
ei_add_test(diagonalmatrices)
ei_add_test(adjoint)
ei_add_test(submatrices)
ei_add_test(miscmatrices)
ei_add_test(commainitializer)
ei_add_test(smallvectors)
ei_add_test(map)
ei_add_test(array)
ei_add_test(array_replicate)
ei_add_test(array_reverse)
ei_add_test(triangular)
ei_add_test(product_selfadjoint ${EI_OFLAG})
ei_add_test(product_symm ${EI_OFLAG})
ei_add_test(product_syrk ${EI_OFLAG})
ei_add_test(product_trmv ${EI_OFLAG})
ei_add_test(product_trmm ${EI_OFLAG})
ei_add_test(product_trsm ${EI_OFLAG})
ei_add_test(product_notemporary ${EI_OFLAG})
ei_add_test(stable_norm)
ei_add_test(bandmatrix)
ei_add_test(cholesky " " "${GSL_LIBRARIES}")
ei_add_test(lu ${EI_OFLAG})
ei_add_test(determinant)
ei_add_test(inverse ${EI_OFLAG})
ei_add_test(qr)
ei_add_test(qr_colpivoting)
ei_add_test(qr_fullpivoting)
ei_add_test(eigensolver_selfadjoint " " "${GSL_LIBRARIES}")
ei_add_test(eigensolver_generic " " "${GSL_LIBRARIES}")
ei_add_test(eigensolver_complex)
ei_add_test(svd)
ei_add_test(jacobisvd ${EI_OFLAG})
ei_add_test(geo_orthomethods)
ei_add_test(geo_homogeneous)
ei_add_test(geo_quaternion)
ei_add_test(geo_transformations)
ei_add_test(geo_eulerangles)
ei_add_test(geo_hyperplane)
ei_add_test(geo_parametrizedline)
ei_add_test(geo_alignedbox)
ei_add_test(regression)
ei_add_test(stdvector)
ei_add_test(resize)
if(QT4_FOUND)
  ei_add_test(qtvector " " "${QT_QTCORE_LIBRARY}")
endif(QT4_FOUND)
ei_add_test(sparse_vector)
ei_add_test(sparse_basic)
ei_add_test(sparse_product)
ei_add_test(sparse_solvers " " "${SPARSE_LIBS}")
ei_add_test(umeyama)
ei_add_test(householder)
ei_add_test(swap)
ei_add_test(conservative_resize)

ei_add_property(EIGEN_TESTING_SUMMARY "CXX:               ${CMAKE_CXX_COMPILER}\n")
if(CMAKE_COMPILER_IS_GNUCXX)
  execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version COMMAND head -n 1 OUTPUT_VARIABLE EIGEN_CXX_VERSION_STRING OUTPUT_STRIP_TRAILING_WHITESPACE)
  ei_add_property(EIGEN_TESTING_SUMMARY "CXX_VERSION:       ${EIGEN_CXX_VERSION_STRING}\n")
endif(CMAKE_COMPILER_IS_GNUCXX)
ei_add_property(EIGEN_TESTING_SUMMARY "CXX_FLAGS:         ${CMAKE_CXX_FLAGS}\n")
ei_add_property(EIGEN_TESTING_SUMMARY "Sparse lib flags:  ${SPARSE_LIBS}\n")