-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExaGeoStatCPPConfig.cmake.in
142 lines (113 loc) · 3.96 KB
/
ExaGeoStatCPPConfig.cmake.in
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Copyright (c) 2017-2024 King Abdullah University of Science and Technology,
# All rights reserved.
# ExaGeoStat is a software package, provided by King Abdullah University of Science and Technology (KAUST).
# @file ExaGeoStatCPPConfig.cmake.in
# @version 1.1.0
# @author Mahmoud ElKarargy
# @date 2023-01-30
# relocatable package
@PACKAGE_INIT@
# defined since 2.8.3
if (CMAKE_VERSION VERSION_LESS 2.8.3)
get_filename_component(CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
endif ()
include("${CMAKE_CURRENT_LIST_DIR}/lib/cmake/ExaGeoStatCPPCoreConfig.cmake")
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
if (_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif ()
# Cmake Module Paths
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH};${CMAKE_CURRENT_LIST_DIR}/Modules/cmake)
set(ENV{PKG_CONFIG_PATH} "${_IMPORT_PREFIX}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
include_directories(${_IMPORT_PREFIX}/include)
link_directories(${_IMPORT_PREFIX}/lib)
set(BLA_PREFER_PKGCONFIG "ON")
set(EXAGEOSTATCPP_LIBRARIES ExaGeoStatCPP)
set(EXAGEOSTATCPP_LIBRARY_DIRS "${_IMPORT_PREFIX}/lib")
set(EXAGEOSTATCPP_INCLUDE_DIRS "${_IMPORT_PREFIX}/include")
set(USE_CUDA "@USE_CUDA@")
# Select toolchain based on whether CUDA is enabled or not
if (USE_CUDA)
# Enable CUDA and include CudaToolchain
add_definitions(-DUSE_CUDA=TRUE)
enable_language(CUDA)
include(toolchains/CudaToolchain)
# Set BLA_VENDOR to NVHPC for CUDA-enabled builds
set(BLA_VENDOR NVHPC)
list(APPEND STARPU_COMPONENT_LIST "CUDA")
else ()
message("-- Build x86 Support")
# Include GccToolchain for non-CUDA builds - Gcc
include(toolchains/GccToolchain)
endif ()
add_definitions(
-DLOG_PATH="${PROJECT_SOURCE_DIR}/synthetic_ds/"
-DKERNELS_PATH="${PROJECT_SOURCE_DIR}/inst/include/kernels/concrete/"
)
# EXAGEOSTAT depends on a MPI
# -------------------------------
if (USE_MPI)
# Enable MPI and include MPI
add_definitions(-DUSE_MPI=TRUE)
message(STATUS "Trying to find MPI")
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
list(APPEND LIBS ${MPI_LIBRARIES})
list(APPEND STARPU_COMPONENT_LIST "MPI")
endif ()
# EXAGEOSTAT depends on LAPACKE
#-----------------------------
find_package(LAPACKE)
list(APPEND LIBS ${LAPACKE_LIBRARIES})
link_directories(${LAPACKE_LIBRARY_DIRS_DEP})
include_directories(${LAPACKE_INCLUDE_DIRS})
# EXAGEOSTAT depends on a Hwloc
# -------------------------------
include(ImportHwloc)
list(APPEND STARPU_COMPONENT_LIST "HWLOC")
string(REPLACE ";" " " STARPU_COMPONENT_STRING "${STARPU_COMPONENT_LIST}")
# EXAGEOSTAT depends on a runtime
# -------------------------------
include(ImportStarPu)
# EXAGEOSTAT depends on a GSL
# -------------------------------
include(ImportGSL)
# EXAGEOSTAT depends on a NLOPT
# -------------------------------
include(ImportNLOPT)
# EXAGEOSTAT depends on HiCMA
# -------------------------------
if (USE_HICMA)
add_definitions(-DUSE_HICMA=TRUE)
message(STATUS "Add Hcore, Dependency needed for HiCMA")
include(ImportHCore)
message(STATUS "Add StarsH, Dependency needed for HiCMA")
include(ImportStarsH)
include(ImportHiCMA)
endif ()
# EXAGEOSTAT depends on CHAMELEON
# -------------------------------
include(ImportChameleon)
# EXAGEOSTAT depends on a LAPACK/BLASPP
# -------------------------------
include(ImportBLASPP)
include(ImportLapack)
# Add all dependencies for ExaGeoStatCPP
if (USE_CUDA)
message("-- Build CUDA Support")
else ()
message("-- Build x86 Support")
set(gpu_backend CACHE STRING "none" FORCE)
unset(BLA_VENDOR)
endif ()
find_package_handle_standard_args(ExaGeoStatCPP
NAME_MISMATCHED
REQUIRED_VARS EXAGEOSTATCPP_INCLUDE_DIRS EXAGEOSTATCPP_LIBRARY_DIRS EXAGEOSTATCPP_LIBRARIES
VERSION_VAR EXAGEOSTATCPP_VERSION
)
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
if (CMAKE_VERSION VERSION_LESS 2.8.3)
set(CMAKE_CURRENT_LIST_DIR)
endif ()