-
Notifications
You must be signed in to change notification settings - Fork 439
/
BUILD
107 lines (91 loc) · 3.06 KB
/
BUILD
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
Tera Build Manual
=================
This document is written for people who intend to build the SDK
libraries, server binaries and other utilities of Tera from the
source code.
Pre-requisite
=============
Operating System
* Linux
Build Essential
* GCC (4.8.2 or newer)
https://gcc.gnu.org/
* CMake (3.2.x or newer)
https://cmake.org/
* Python (2.7.x only)
https://www.python.org/
Dependency Overview
* sofa-pbrpc (1.1.1 or newer)
https://github.com/baidu/sofa-pbrpc/
* Protocol Buffers (2.6.1 or newer)
https://developers.google.com/protocol-buffers/
* snappy (1.1.1 or newer)
http://google.github.io/snappy/
* zookeeper (3.3.3 or newer)
https://zookeeper.apache.org/
* gflags (2.1.1 or newer)
https://github.com/gflags/gflags/
* glog (0.3.3 or newer)
https://github.com/google/glog/
* googletest (1.7.0 or newer)
https://github.com/google/googletest/
* gperftools (2.2.1 only)
https://code.google.com/p/gperftools/
* ins (0.14 or newer)
https://github.com/baidu/ins/
* boost (1.53.0 or newer)
http://www.boost.org/
On a 64-bit system, the following library is strongly recommended
by gperftools. See INSTALL document of gperftools for more details.
* libunwind (0.99 only)
http://www.nongnu.org/libunwind/
Most Linux distributions have the following libraries
pre-installed. But if they are not, install them by yourself.
* readline
https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
* ncurses
https://www.gnu.org/software/ncurses/
Basic Build
===========
1. Edit depends.mk
1.1. Open depends.mk
If there is no file named 'depends.mk' under project's root directory,
type 'cp depends.mk.template depends.mk' to create one.
1.2. Fill the right side of '=' of the following lines with the
locations of corresponding dependencies.
SOFA_PBRPC_PREFIX=
PROTOBUF_PREFIX=
SNAPPY_PREFIX=
ZOOKEEPER_PREFIX=
GFLAGS_PREFIX=
GLOG_PREFIX=
GTEST_PREFIX=
GPERFTOOLS_PREFIX=
INS_PREFIX=
Take 'SNAPPY_PREFIX=' as an example. Assume snappy is installed under
/usr/local, then modify this line to:
SNAPPY_PREFIX=/usr/local
1.3. Fill 'BOOST_INCDIR=' with the location of boost source code.
For example, if boost source code is under /usr/src/boost_1_57_0,
then this line should be modified to:
BOOST_INCDIR=/usr/src/boost_1_57_0
1.4. Normally, other variables do not need to be modified.
In general, the headers and libraries of a software should be found
under 'include' and 'lib' of its installation directory, respectively.
*_INCDIR or *_LIBDIR need to be modified only if exceptions occur.
2. Type 'make' to compile the package.
make -j4
One-command Build
=================
For convenience, we provide an one-command build script. Run the script:
sh build.sh
It will automatically download the tarballs of all the needed dependencies,
install them under 'thirdparty' directory and link their static libraries
into Tera.
Output of Build
===============
After success build, the output will be put under 'build' directory.
The structure of the directory is as below:
* include: SDK headers
* lib: SDK libraries
* bin: executable program, including servers and utilities