@@ -10,9 +10,9 @@ if (NOT TARGET distclean)
10
10
INCLUDE (../cmake/Modules/TargetDistclean.cmake OPTIONAL )
11
11
endif (NOT TARGET distclean)
12
12
13
+ find_package (Matar REQUIRED)
13
14
set (LINKING_LIBRARIES matar)
14
15
15
- find_package (Matar REQUIRED)
16
16
if (MPI)
17
17
find_package (MPI REQUIRED)
18
18
add_definitions (-DHAVE_MPI=1)
@@ -36,9 +36,43 @@ if (NOT KOKKOS)
36
36
endif ()
37
37
38
38
if (KOKKOS)
39
- find_package (Kokkos REQUIRED) #new
39
+ if (Matar_ENABLE_TRILINOS)
40
+ find_package (Trilinos REQUIRED) #new
41
+ # Assume if the CXX compiler exists, the rest do too.
42
+ if (EXISTS ${Trilinos_CXX_COMPILER} )
43
+ set (CMAKE_CXX_COMPILER ${Trilinos_CXX_COMPILER} )
44
+ set (CMAKE_C_COMPILER ${Trilinos_C_COMPILER} )
45
+ set (CMAKE_Fortran_COMPILER ${Trilinos_Fortran_COMPILER} )
46
+ endif ()
47
+ if (NOT DISTRIBUTION)
48
+ # Make sure to use same compilers and flags as Trilinos
49
+ set (CMAKE_CXX_FLAGS "${Trilinos_CXX_COMPILER_FLAGS} ${CMAKE_CXX_FLAGS} " )
50
+ set (CMAKE_C_FLAGS "${Trilinos_C_COMPILER_FLAGS} ${CMAKE_C_FLAGS} " )
51
+ set (CMAKE_Fortran_FLAGS "${Trilinos_Fortran_COMPILER_FLAGS} ${CMAKE_Fortran_FLAGS} " )
52
+ endif ()
53
+
54
+ message ("\n Found Trilinos! Here are the details: " )
55
+ message (" Trilinos_DIR = ${Trilinos_DIR} " )
56
+ message (" Trilinos_VERSION = ${Trilinos_VERSION} " )
57
+ message (" Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST} " )
58
+ message (" Trilinos_LIBRARIES = ${Trilinos_LIBRARIES} " )
59
+ message (" Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS} " )
60
+ message (" Trilinos_LIBRARY_DIRS = ${Trilinos_LIBRARY_DIRS} " )
61
+ message (" Trilinos_TPL_LIST = ${Trilinos_TPL_LIST} " )
62
+ message (" Trilinos_TPL_INCLUDE_DIRS = ${Trilinos_TPL_INCLUDE_DIRS} " )
63
+ message (" Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES} " )
64
+ message (" Trilinos_TPL_LIBRARY_DIRS = ${Trilinos_TPL_LIBRARY_DIRS} " )
65
+ message (" Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS} " )
66
+ message ("End of Trilinos details\n " )
67
+
68
+ include_directories (${Trilinos_INCLUDE_DIRS} ${Trilinos_TPL_INCLUDE_DIRS} )
69
+ list (APPEND LINKING_LIBRARIES Trilinos::all_selected_libs)
70
+ add_definitions (-DTRILINOS_INTERFACE=1)
71
+ else ()
72
+ find_package (Kokkos REQUIRED) #new
73
+ list (APPEND LINKING_LIBRARIES Kokkos::kokkos)
74
+ endif ()
40
75
41
- list (APPEND LINKING_LIBRARIES Kokkos::kokkos)
42
76
43
77
add_definitions (-DHAVE_KOKKOS=1)
44
78
@@ -76,11 +110,36 @@ if (KOKKOS)
76
110
add_executable (annkokkos ann_kokkos.cpp)
77
111
target_link_libraries (annkokkos ${LINKING_LIBRARIES} )
78
112
113
+ add_executable (annkokkos_compare ann_kokkos_compare.cpp)
114
+ target_link_libraries (annkokkos_compare ${LINKING_LIBRARIES} )
115
+
116
+ if (Matar_ENABLE_TRILINOS)
117
+ add_executable (anndistributed ann_distributed.cpp)
118
+ target_link_libraries (anndistributed ${LINKING_LIBRARIES} )
119
+
120
+ add_executable (anndistributed_crs ann_distributed_crs.cpp)
121
+ target_link_libraries (anndistributed_crs ${LINKING_LIBRARIES} )
122
+
123
+ add_executable (test_tpetra_farray test_tpetra_farray.cpp)
124
+ target_link_libraries (test_tpetra_farray ${LINKING_LIBRARIES} )
125
+
126
+ add_executable (test_tpetra_carray test_tpetra_carray.cpp)
127
+ target_link_libraries (test_tpetra_carray ${LINKING_LIBRARIES} )
128
+
129
+ add_executable (test_tpetra_mesh test_tpetra_mesh.cpp)
130
+ target_link_libraries (test_tpetra_mesh ${LINKING_LIBRARIES} )
131
+ endif ()
132
+
79
133
if (OPENMP)
80
134
add_executable (parallel_hello_world parallel_hello_world.cpp)
81
135
target_link_libraries (parallel_hello_world ${LINKING_LIBRARIES} )
82
136
endif ()
83
137
138
+ if (MPI)
139
+ include_directories (laplaceMPI)
140
+ add_subdirectory (laplaceMPI)
141
+ endif ()
142
+
84
143
endif ()
85
144
86
145
### HIP Linking error, will add back in after fixed
@@ -114,11 +173,6 @@ add_subdirectory(sparsetests)
114
173
include_directories (test_rocm)
115
174
add_subdirectory (test_rocm)
116
175
117
- if (MPI)
118
- include_directories (laplaceMPI)
119
- add_subdirectory (laplaceMPI)
120
- endif ()
121
-
122
176
#include_directories(phaseField/srcKokkosVerbose)
123
177
#add_subdirectory(phaseField/srcKokkosVerbose)
124
178
0 commit comments