-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
67 lines (54 loc) · 2.3 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8)
#These next few lines are ripped from the trilinos demo almost exactly
set(Trilinos_PREFIX
"/usr/people/research/zathorson/trilinos_builds/trilinos_openMP/build")
set(CMAKE_PREFIX_PATH ${Trilinos_PREFIX} ${CMAKE_PREFIX_PATH})
message("Trilinos prefix: ${Trilinos_PREFIX}")
find_package(Trilinos REQUIRED)
#Use same compilers and flags as Trilinos
set(CMAKE_CXX_COMPILER ${Trilinos_CXX_COMPILER})
message("Compiler: ${CMAKE_CXX_COMPILER}")
set(CMAKE_C_COMPILER ${Trilinos_C_COMPILER})
set(CMAKE_Fortran_COMPILER ${Trilinos_Fortran_COMPILER})
project(KokkosHPCG)
set(CMAKE_CXX_FLAGS "${Trilinos_CXX_COMPILER_FLAGS} -pg")
set(CMAKE_C_FLAGS "${Trilinos_C_COMPILER_FLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_Fortran_FLAGS "${Trilinos_Fortran_COMPILER_FLAGS} ${CMAKE_Fortran_FLAGS}")
# MPI check
MESSAGE("-- Checking if MPI is enabled in Trilinos:")
LIST(FIND Trilinos_TPL_LIST MPI MPI_List_ID)
IF (MPI_List_ID GREATER -1)
MESSAGE("-- Checking if MPI is enabled in Trilinos: MPI ENABLED")
SET(HPCG_NO_MPI OFF)
ELSE()
MESSAGE("-- Checking if MPI is enabled in Trilinos: MPI NOT ENABLED")
SET(HPCG_NO_MPI ON)
ADD_DEFINITIONS(-DHPCG_NO_MPI)
ENDIF()
set(HPCG_NOOPENMP OFF)
ADD_DEFINITIONS(-DHPCG_NO_MPI)
# KokkosCore check will exit if Kokkos is not found
message("--Looking for Kokkos:")
list(FIND Trilinos_PACKAGE_LIST Kokkos Kokkos_List_ID)
IF (Kokkos_List_ID GREATER -1)
message("--Looking for Kokkos: -- found. Proceeding...")
ELSE()
message(FATAL_ERROR "Kokkos not found... CMake exiting")
ENDIF()
# Change this definition to specify where to execute the code.
# -DHPCG_Kokkos_OpenMP
# -DHPCG_Kokkos_Cuda
# -DHPCG_Kokkos_Serial (Default)
ADD_DEFINITIONS(-DHPCG_Kokkos_OpenMP)
ADD_DEFINITIONS(-DKOKKOS_TEAM)
# Change this definition to specify which Gauss Seidel to use
# -DSYMGS_COLOR Solve using graph Colouring. (Doesn't Produce valid results)
# -DSYMGS_LEVEL Level solve.
# -DSYMGS_INEXACT Jacobi Trisolve. (Only works if you use enough iterations
# for your problem size.)
# Default is serial Gauss Seidel used in Vanilla HPCG
# If nothing is specified the defualt serial Gauss Seidel will be used.
ADD_DEFINITIONS(-DSYMGS_LEVEL)
include_directories("${Trilinos_PREFIX}/include")
#This will run the cmakelists in the src directory. This is where I want things to compile.
add_subdirectory(src)