-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
67 lines (49 loc) · 1.59 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
66
67
cmake_minimum_required(VERSION 3.10)
project(ipuma-lib LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
include(AddGPLibrary)
include(CMakeDefinitions.txt)
set(POPLIBS_ENABLED_IPU_ARCH_NAMES "cpu;ipu2")
# if(NOT DEFINED POPLIBS_ENABLED_IPU_ARCH_NAMES)
# set(POPLIBS_ENABLED_IPU_ARCH_NAMES "cpu;ipu1;ipu2" CACHE STRING
# "The architectures to build the poplibs library objects for")
# endif()
message("Enabled architectures: ${POPLIBS_ENABLED_IPU_ARCH_NAMES}")
set(DEFAULT_TEST_VARIANTS "cpu;IpuModel2;")
set(POPC_EXECUTABLE "popc")
# Set up popc flags.
set(POPC_FLAGS -I ${CMAKE_SOURCE_DIR}/include)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
list(APPEND POPC_FLAGS -g)
elseif(CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
list(APPEND POPC_FLAGS -O3 -g)
else()
list(APPEND POPC_FLAGS -O3)
endif()
# If requested, optimise the debug builds too.
if (OPTIMISE_IPU_DEBUG AND CMAKE_BUILD_TYPE STREQUAL Debug)
list(APPEND POPC_FLAGS -O3)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
include_directories("plog/include")
add_subdirectory("extern/include/ssw")
add_subdirectory(src)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(PACKAGE_TESTS ON)
set(PACKAGE_MAIN ON)
set(PACKAGE_CPU ON)
endif()
set(IPUMA_BIN_INCLUDES "${PROJECT_SOURCE_DIR}/src" "${PROJECT_SOURCE_DIR}/extern/cxxopts/include" "${PROJECT_SOURCE_DIR}/extern/include")
if(PACKAGE_MAIN)
add_subdirectory(ipusw)
endif()
if(PACKAGE_CPU)
add_subdirectory(cpusw)
endif()
if(PACKAGE_TESTS)
enable_testing()
add_subdirectory(test)
endif()
# - POPC_EXECUTABLE
# - POPC_FLAGS