forked from trilinos/Trilinos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.by_package.cmake
38 lines (31 loc) · 1.22 KB
/
CMakeLists.by_package.cmake
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
# CMAKE File for "MyApp" application building against an installed Trilinos
cmake_minimum_required(VERSION 3.0)
# Define the project and the compilers
#
# NOTE: You can't call find_package(Trilinos) for a CUDA build without first
# defining the compilers.
#
project(MyApp C CXX)
# Disable Kokkos warning about not supporting C++ extensions
set(CMAKE_CXX_EXTENSIONS OFF)
# Get just Tpetra as
find_package(Tpetra REQUIRED)
# Echo trilinos build info just for fun
message("\nFound Tpetra! Here are the details: ")
message(" Tpetra_DIR = ${Tpetra_DIR}")
# Build the APP and link to Trilinos
add_executable(MyApp ${CMAKE_CURRENT_SOURCE_DIR}/app.cpp)
target_link_libraries(MyApp Tpetra::all_libs)
# Set up a test
enable_testing()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input.xml
${CMAKE_CURRENT_BINARY_DIR}/input.xml COPYONLY)
set(NUM_MPI_PROCS 4)
add_test(MyAppTest mpiexec -np ${NUM_MPI_PROCS} "${CMAKE_CURRENT_BINARY_DIR}/MyApp")
set_tests_properties(MyAppTest PROPERTIES
PROCESSORS ${NUM_MPI_PROCS}
PASS_REGULAR_EXPRESSION "vec.norm1[(][)] = 40"
)
# NOTE: Above, mpiexec with mpich-3.2 requires you pass in the abs path to
# MyApp or mpiexec says it can't find it, even though it is running in the
# correct directory (see #10813).