-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
71 lines (54 loc) · 2.02 KB
/
CMakeLists.txt
File metadata and controls
71 lines (54 loc) · 2.02 KB
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
cmake_minimum_required (VERSION 3.6)
project (PyGPI)
###########################
# USER Pathes
###########################
# Adjust here!
set (GASPI_CXX_ROOT "")
option(BUILD_TFOPS "Build the Tensorflow operations for Comprex" OFF)
###########################
option(LINK_IB "Defines whether to link against Infiniband drivers [default: enabled]" OFF)
option(PROFILE "Switch for adding profiling options flags" OFF)
option(DEBUG "Switch to add debugging flags" OFF)
###########################
set(CMAKE_VERBOSE_MAKEFILE "Set makefile verbosity" FALSE)
set(CMAKE_INSTALL_RPATH $ORIGIN)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_INSTALL_DIR "${CMAKE_SOURCE_DIR}")
set(COMPREX_ROOT "${CMAKE_SOURCE_DIR}")
include(GNUInstallDirs)
include_directories(${COMPREX_ROOT}/src)
include_directories(${COMPREX_ROOT}/include)
execute_process(COMMAND which python OUTPUT_VARIABLE PYTHON)
string(STRIP ${PYTHON} PYTHON)
set (CMAKE_BUILD_TYPE Release)
set (COMPREX_SRC "${CMAKE_SOURCE_DIR}/src")
set (COMPREX_BUILD "${CMAKE_SOURCE_DIR}/build")
# Enable Profiling with gprof
if(PROFILE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg -g -fno-inline")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg -g")
endif()
# enable debugging
if(DEBUG)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif()
if(BUILD_TFOPS)
set (CONDA_ENVIRONMENT $ENV{CONDA_DEFAULT_ENV})
message ("Using Conda environment: ${CONDA_ENVIRONMENT}")
find_package(Tensorflow REQUIRED)
endif()
find_package(GPI2 REQUIRED)
# include GASPI_CXX
set(GASPI_CXX_INCLUDE_DIR ${GASPI_CXX_ROOT}/include)
set(GASPI_CXX_LINK_DIR ${GASPI_CXX_ROOT}/build/src)
include_directories ( ${GASPI_CXX_INCLUDE_DIR} )
link_directories ( ${GASPI_CXX_LINK_DIR} )
message ("GASPI_CXX include: ${GASPI_CXX_INCLUDE_DIR}")
message ("GASPI_CXX lib: ${GASPI_CXX_LINK_DIR}")
add_subdirectory (src)
add_subdirectory (examples)
add_subdirectory (test)
# create dummy nodefile
file(WRITE ${COMPREX_BUILD}/nodelist "localhost\nlocalhost\n")