-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test simpleBuildAgainstTrilinos_by_package_build_tree_name (#11545)
This commit does a few things: * A removeInstall test is split off from the doInstall test * A new simpleBuildAgainstTrilinos/CMakeLists.by_package.cmake file is created to show how to find the packages you want from Trilinos and not actually find Trilinos. * New test simpleBuildAgainstTrilinos_by_package_build_tree_name is added which depends on removeInstall and points to the build tree. This demonstrates and protects using Trilinos packages from the build tree and how to find Trilinos by packages instead of as a big thing.
- Loading branch information
1 parent
2e6a11b
commit 0d364f8
Showing
3 changed files
with
127 additions
and
4 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
demos/simpleBuildAgainstTrilinos/CMakeLists.by_package.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters