-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
114 lines (93 loc) · 3.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
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
#
# Master Opencog CMake file.
#
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
CMAKE_POLICY(SET CMP0028 NEW)
PROJECT(benchmark)
# default build type
IF (CMAKE_BUILD_TYPE STREQUAL "")
SET(CMAKE_BUILD_TYPE Release)
ENDIF (CMAKE_BUILD_TYPE STREQUAL "")
MESSAGE(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
# add the 'lib' dir to cmake's module search path
# SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/lib/")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/lib/")
# Cogutil
FIND_PACKAGE(CogUtil)
IF (COGUTIL_FOUND)
MESSAGE(STATUS "CogUtil found.")
ADD_DEFINITIONS(-DHAVE_COGUTIL)
SET(HAVE_COGUTIL 1)
INCLUDE_DIRECTORIES(${COGUTIL_INCLUDE_DIR})
ELSE (COGUTIL_FOUND)
MESSAGE(FATAL_ERROR "CogUtil missing: it is needed for everything!")
ENDIF (COGUTIL_FOUND)
# Add the 'cmake' directory from cogutil to search path
list(APPEND CMAKE_MODULE_PATH ${COGUTIL_DATA_DIR}/cmake)
include(OpenCogGccOptions)
include(OpenCogLibOptions)
include(OpenCogInstallOptions)
include(Summary)
# ===================================================================
# Check for existance of various required, optional packages.
# AtomSpace
FIND_PACKAGE(AtomSpace 5.0.3 REQUIRED)
IF (ATOMSPACE_FOUND)
MESSAGE(STATUS "AtomSpace found.")
ADD_DEFINITIONS(-DHAVE_ATOMSPACE)
SET(HAVE_ATOMSPACE 1)
INCLUDE_DIRECTORIES(${ATOMSPACE_INCLUDE_DIR})
ELSE (ATOMSPACE_FOUND)
MESSAGE(FATAL_ERROR "AtomSpace missing: it is needed for everything!")
ENDIF (ATOMSPACE_FOUND)
## URE (optional)
#FIND_PACKAGE(URE 1.0.0 CONFIG)
#IF (URE_FOUND)
# MESSAGE(STATUS "URE found.")
# SET(HAVE_URE 1)
#ELSE (URE_FOUND)
# MESSAGE(STATUS "URE was not found. URE micro benchmarks will not be built.")
#ENDIF (URE_FOUND)
#
# ----------------------------------------------------------
## Google benchmark package (optional)
#FIND_PACKAGE(benchmark 1.3.0)
#IF (benchmark_FOUND)
# SET(BUILD_MICRO 1)
# MESSAGE(STATUS "Google Benchmark ${benchmark_VERSION} found.")
#ELSE (benchmark_FOUND)
# MESSAGE(STATUS "Google Benchmark not found. Micro benchmarks will not be built.")
#ENDIF(benchmark_FOUND)
# ----------------------------------------------------------
# Check for boost.
SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_MULTITHREADED ON)
# Only basic boost (for tuple) is required
FIND_PACKAGE(Boost 1.46 REQUIRED)
# *We* don't actually need Boost::system but some build fail with
# hard-to-debug errors: `/usr/bin/ld: cannot find -lBoost::system`
# because I guess the AtomSpace does need this!? So cave on the issue
# and just engage the foolishness.
FIND_PACKAGE(Boost ${MIN_BOOST} REQUIRED COMPONENTS system)
IF(NOT Boost_FOUND)
MESSAGE(FATAL_ERROR "Boost 1.46 or newer is needed to build benchmarks!")
ENDIF(NOT Boost_FOUND)
# ----------------------------------------------------------
# This is required for Guile, python
include(OpenCogFindGuile)
include(OpenCogFindPython)
# ===================================================================
# Add subdirectories
ADD_SUBDIRECTORY(atomspace)
IF (BUILD_MICRO)
# ADD_SUBDIRECTORY(micro)
ENDIF(BUILD_MICRO)
ADD_SUBDIRECTORY(query-trite)
# ===================================================================
# Show a summary of what we got
SUMMARY_ADD("AtomSpace bench" "Synthetic benchmarks for AtomSpace methods" HAVE_ATOMSPACE)
SUMMARY_ADD("Python bench" "Synthetic benchmarks for Python (cython) bindings" HAVE_CYTHON)
SUMMARY_ADD("Scheme bench" "Synthetic benchmarks for Scheme (guile) bindings" HAVE_GUILE)
SUMMARY_ADD("Micro bench" "Assorted microbenchmarks" BUILD_MICRO)
SUMMARY_ADD("URE Micro bench" "URE microbenchmarks" BUILD_MICRO AND HAVE_URE)
SUMMARY_SHOW()