-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
44 lines (34 loc) · 1.54 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
# run cmake with " cmake -S [source dir of targerts] -B [build dir for makefile] "
# e.g. could run cmake with these compiler options:
# cmake -S ./ -B ./build -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON
# set cmake version
cmake_minimum_required(VERSION 3.18.0)
# cmake_minimum_required(VERSION 3.21.1) ### if using Kokkos with nvc++ compiler on Levante
project(CLEO
LANGUAGES CXX
DESCRIPTION "CLEO by Clara Bayley and other developers"
VERSION 0.1.0
)
message("CLEO_SOURCE_DIR: ${CLEO_SOURCE_DIR}")
message("CLEO_BINARY_DIR: ${CLEO_BINARY_DIR}")
# ensure C++ compiler uses certain settings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_CXX_STANDARD "20")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CXX_EXTENSIONS ON)
# install Kokkos for project
set(kokkospath ${CLEO_SOURCE_DIR}/extern/kokkos)
message(STATUS "Using Kokkos installation from: ${kokkospath}")
add_subdirectory(${kokkospath} ${CLEO_BINARY_DIR}/kokkos)
# install yaml-cpp for project
set(yamlcpppath ${CLEO_SOURCE_DIR}/extern/yaml-cpp)
message(STATUS "Using yaml-cpp installation from: ${yamlcpppath}")
add_subdirectory(${yamlcpppath} ${CLEO_BINARY_DIR}/yaml-cpp)
# print default compiler flags
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
# add directories of CLEO libray and main program
add_subdirectory(libs)
# add directories for specific examples of CLEO
add_subdirectory(examples EXCLUDE_FROM_ALL)
# add directory for roughpaper / quick tests
add_subdirectory(roughpaper EXCLUDE_FROM_ALL)