You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cn/getting_started.md
+21-9Lines changed: 21 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# BUILD
2
2
3
3
brpc prefers static linking if possible, so that deps don't have to be installed on every
4
-
machine running the code.
4
+
machine running the code.
5
5
6
6
brpc depends on following packages:
7
7
@@ -23,7 +23,7 @@ $ make
23
23
```
24
24
to change compiler to clang, add `--cxx=clang++ --cc=clang`.
25
25
26
-
### run example
26
+
### Run example
27
27
28
28
```
29
29
$ cd example/echo_c++
@@ -33,12 +33,18 @@ $ ./echo_client
33
33
```
34
34
Examples link brpc statically, if you need to link the shared version, `make clean` and `LINK_SO=1 make`
35
35
36
-
To run examples with cpu/heap profilers, install `libgoogle-perftools-dev` and re-run `config_brpc.sh` before compiling
36
+
To run examples with cpu/heap profilers, install `libgoogle-perftools-dev` and re-run `config_brpc.sh` before compiling.
37
37
38
-
### compile tests
39
-
Install libgtest-dev
38
+
### Run tests
39
+
Install libgtest-dev (which is not compiled yet) and run:
40
40
41
-
Rerun config_brpc.sh and run make in test/
41
+
```shell
42
+
cd /usr/src/gtest && sudo cmake .&& sudo make && sudo mv libgtest* /usr/lib/
43
+
```
44
+
45
+
The directory of gtest source code may be changed, try `/usr/src/googletest/googletest` if `/usr/src/gtest` is not there.
46
+
47
+
Rerun `config_brpc.sh`, `make` in test/, and `sh run_tests.sh`
42
48
43
49
## Fedora/CentOS
44
50
@@ -58,7 +64,7 @@ $ make
58
64
```
59
65
to change compiler to clang, add `--cxx=clang++ --cc=clang`.
60
66
61
-
### run example
67
+
### Run example
62
68
63
69
```
64
70
$ cd example/echo_c++
@@ -68,7 +74,13 @@ $ ./echo_client
68
74
```
69
75
Examples link brpc statically, if you need to link the shared version, `make clean` and `LINK_SO=1 make`
70
76
71
-
To run examples with cpu/heap profilers, install `gperftools-devel` and re-run `config_brpc.sh` before compiling
77
+
To run examples with cpu/heap profilers, install `gperftools-devel` and re-run `config_brpc.sh` before compiling.
78
+
79
+
### Run tests
80
+
81
+
Install gtest-devel.
82
+
83
+
Rerun `config_brpc.sh`, `make` in test/, and `sh run_tests.sh`
72
84
73
85
## Linux with self-built deps
74
86
@@ -125,7 +137,7 @@ no known issues.
125
137
126
138
## protobuf: 2.4-3.2
127
139
128
-
Be compatible with pb 3.0 and pb 2.x with the same file:
140
+
Be compatible with pb 3.0 and pb 2.x with the same file:
129
141
Don't use new types in proto3 and start the proto file with `syntax="proto2";`
130
142
[tools/add_syntax_equal_proto2_to_all.sh](https://github.com/brpc/brpc/blob/master/tools/add_syntax_equal_proto2_to_all.sh)can add `syntax="proto2"` to all proto files without it.
0 commit comments