Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
779f32c0
Commit
779f32c0
authored
Jan 31, 2018
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
group compilation run-example run-tests together in getting_started.md
parent
f9bb6481
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
38 deletions
+42
-38
getting_started.md
docs/cn/getting_started.md
+42
-38
No files found.
docs/cn/getting_started.md
View file @
779f32c0
...
...
@@ -26,7 +26,7 @@ If you need to statically link leveldb:
$ sudo apt-get install libsnappy-dev
```
### Compile brpc
### Compile brpc
with config_brpc.sh
git clone brpc, cd into the repo and run
```
$ sh config_brpc.sh --headers=/usr/include --libs=/usr/lib
...
...
@@ -36,15 +36,7 @@ To change compiler to clang, add `--cxx=clang++ --cc=clang`.
To not link debugging symbols, add
`--nodebugsymbols`
and compiled binaries will be much smaller.
### Compile brpc with cmake
```
$ mkdir build && cd build && cmake .. && make
```
To change compiler to clang, overwrite environment variable CC and CXX to clang and clang++.
Use
`cmake -DWITH_DEBUG_SYMBOLS=ON ..`
to link debugging symbols.
### Run example
**Run example**
```
$ cd example/echo_c++
...
...
@@ -52,20 +44,13 @@ $ make
$ ./echo_server &
$ ./echo_client
```
Examples link brpc statically, if you need to link the shared version,
`make clean`
and
`LINK_SO=1 make`
To run examples with cpu/heap profilers, install
`libgoogle-perftools-dev`
and re-run
`config_brpc.sh`
before compiling.
### Run example with cmake
```
$ cd example/echo_c++
$ mkdir build && cd build && cmake .. && make
$ ./echo_server &
$ ./echo_client
```
Examples link brpc statically, if you need to link the shared version, use
`cmake -DEXAMPLE_LINK_SO=ON ..`
**Run tests**
### Run tests
Install and compile libgtest-dev (which is not compiled yet):
```
shell
...
...
@@ -76,7 +61,24 @@ The directory of gtest source code may be changed, try `/usr/src/googletest/goog
Rerun
`config_brpc.sh`
,
`make`
in test/, and
`sh run_tests.sh`
### Run tests with cmake
### Compile brpc with cmake
```
$ mkdir build && cd build && cmake .. && make
```
To change compiler to clang, overwrite environment variable CC and CXX to clang and clang++.
Use
`cmake -DWITH_DEBUG_SYMBOLS=ON ..`
to link debugging symbols.
**Run example with cmake**
```
$ cd example/echo_c++
$ mkdir build && cd build && cmake .. && make
$ ./echo_server &
$ ./echo_client
```
Examples link brpc statically, if you need to link the shared version, use
`cmake -DEXAMPLE_LINK_SO=ON ..`
**Run tests**
Install gtest like just written above.
...
...
@@ -103,7 +105,7 @@ Install [gflags](https://github.com/gflags/gflags), [protobuf](https://github.co
```
sudo yum install gflags-devel protobuf-devel protobuf-compiler leveldb-devel
```
### Compile brpc
### Compile brpc
with config_brpc.sh
git clone brpc, cd into the repo and run
...
...
@@ -115,15 +117,7 @@ To change compiler to clang, add `--cxx=clang++ --cc=clang`.
To not link debugging symbols, add
`--nodebugsymbols`
and compiled binaries will be much smaller.
### Compile brpc with cmake
```
$ mkdir build && cd build && cmake .. && make
```
To change compiler to clang, overwrite environment variable CC and CXX to clang and clang++.
Use
`cmake -DWITH_DEBUG_SYMBOLS=ON ..`
to link debugging symbols.
### Run example
**Run example**
```
$ cd example/echo_c++
...
...
@@ -131,11 +125,27 @@ $ make
$ ./echo_server &
$ ./echo_client
```
Examples link brpc statically, if you need to link the shared version,
`make clean`
and
`LINK_SO=1 make`
To run examples with cpu/heap profilers, install
`gperftools-devel`
and re-run
`config_brpc.sh`
before compiling.
### Run example with cmake
**Run tests**
Install gtest-devel.
Rerun
`config_brpc.sh`
,
`make`
in test/, and
`sh run_tests.sh`
### Compile brpc with cmake
```
$ mkdir build && cd build && cmake .. && make
```
To change compiler to clang, overwrite environment variable CC and CXX to clang and clang++.
Use
`cmake -DWITH_DEBUG_SYMBOLS=ON ..`
to link debugging symbols.
**Run example**
```
$ cd example/echo_c++
$ mkdir build && cd build && cmake .. && make
...
...
@@ -144,13 +154,7 @@ $ ./echo_client
```
Examples link brpc statically, if you need to link the shared version, use
`cmake -DEXAMPLE_LINK_SO=ON ..`
### Run tests
Install gtest-devel.
Rerun
`config_brpc.sh`
,
`make`
in test/, and
`sh run_tests.sh`
### Run tests with cmake
**Run tests**
```
$ mkdir build && cd build && cmake -DBUILD_UNIT_TESTS=ON .. && make
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment