Skip to content

Commit ec9271d

Browse files
authored
[fix][doc] explicitly instruct clone the repo (apache#69)
1 parent 7ec2ce7 commit ec9271d

File tree

1 file changed

+46
-41
lines changed

1 file changed

+46
-41
lines changed

README.md

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,30 @@
2020
-->
2121

2222
# Pulsar C++ client library
23-
<!-- TOC depthFrom:2 depthTo:3 withLinks:1 updateOnSave:1 orderedList:0 -->
2423

25-
- [Requirements](#requirements)
26-
- [Platforms](#platforms)
27-
- [Compilation](#compilation)
28-
- [Compile on Ubuntu Server 20.04](#compile-on-ubuntu-server-2004)
29-
- [Compile on Mac OS X](#compile-on-mac-os-x)
30-
- [Compile on Windows (Visual Studio)](#compile-on-windows)
31-
- [Tests](#tests)
32-
- [Requirements for Contributors](#requirements-for-contributors)
33-
34-
<!-- /TOC -->
35-
Examples for using the API to publish and consume messages can be found on
36-
https://github.com/apache/pulsar/tree/master/pulsar-client-cpp/examples
24+
Examples for using the API to publish and consume messages can be found under the [examples](examples) folder.
3725

3826
## Requirements
3927

40-
* A C++ compiler that supports C++11, like GCC >= 4.8
41-
* CMake >= 3.4
42-
* [Boost](http://www.boost.org/)
43-
* [Protocol Buffer](https://developers.google.com/protocol-buffers/) >= 3
44-
* [libcurl](https://curl.se/libcurl/)
45-
* [openssl](https://github.com/openssl/openssl)
28+
* A C++ compiler that supports C++11, like GCC >= 4.8
29+
* CMake >= 3.4
30+
* [Boost](http://www.boost.org/)
31+
* [Protocol Buffer](https://developers.google.com/protocol-buffers/) >= 3
32+
* [libcurl](https://curl.se/libcurl/)
33+
* [openssl](https://github.com/openssl/openssl)
4634

4735
It's recommended to use Protocol Buffer 2.6 because it's verified by CI, but 3.x also works.
4836

4937
The default supported [compression types](include/pulsar/CompressionType.h) are:
5038

51-
- `CompressionNone`
52-
- `CompressionLZ4`
39+
* `CompressionNone`
40+
* `CompressionLZ4`
5341

5442
If you want to enable other compression types, you need to install:
5543

56-
- `CompressionZLib`: [zlib](https://zlib.net/)
57-
- `CompressionZSTD`: [zstd](https://github.com/facebook/zstd)
58-
- `CompressionSNAPPY`: [snappy](https://github.com/google/snappy)
44+
* `CompressionZLib`: [zlib](https://zlib.net/)
45+
* `CompressionZSTD`: [zstd](https://github.com/facebook/zstd)
46+
* `CompressionSNAPPY`: [snappy](https://github.com/google/snappy)
5947

6048
If you want to build and run the tests, you need to install [GTest](https://github.com/google/googletest). Otherwise, you need to add CMake option `-DBUILD_TESTS=OFF`.
6149

@@ -73,6 +61,15 @@ Pulsar C++ Client Library has been tested on:
7361

7462
## Compilation
7563

64+
### Clone
65+
66+
First of all, clone the source code:
67+
68+
```shell
69+
git clone https://github.com/apache/pulsar-client-cpp
70+
cd pulsar-client-cpp
71+
```
72+
7673
### Compile on Ubuntu
7774

7875
#### Install all dependencies:
@@ -86,19 +83,20 @@ sudo apt-get install -y g++ cmake libssl-dev libcurl4-openssl-dev \
8683
#### Compile Pulsar client library:
8784

8885
```shell
89-
cd pulsar-client-cpp
9086
cmake .
9187
make
9288
```
9389

9490
#### Checks
95-
##### Client library will be placed in
91+
92+
Client library will be placed in:
93+
9694
```
9795
lib/libpulsar.so
9896
lib/libpulsar.a
9997
```
10098

101-
##### Tools will be placed in
99+
Tools will be placed in:
102100

103101
```
104102
perf/perfProducer
@@ -108,25 +106,28 @@ perf/perfConsumer
108106
### Compile on Mac OS X
109107

110108
#### Install all dependencies:
109+
111110
```shell
112111
brew install openssl protobuf boost boost-python3 googletest zstd snappy
113112
```
114113

115114
#### Compile Pulsar client library:
115+
116116
```shell
117-
cd pulsar-client-cpp/
118117
cmake .
119118
make
120119
```
121120

122121
#### Checks
123-
##### Client library will be placed in
122+
123+
Client library will be placed in:
124+
124125
```
125126
lib/libpulsar.dylib
126127
lib/libpulsar.a
127128
```
128129

129-
##### Tools will be placed in:
130+
Tools will be placed in:
130131

131132
```
132133
perf/perfProducer
@@ -164,7 +165,7 @@ cmake --build ./build --config Release
164165

165166
Then all artifacts will be built into `build` subdirectory.
166167

167-
> **NOTE**
168+
> **NOTE**:
168169
>
169170
> 1. For Windows 32-bit, you need to use `-A Win32` and `-DVCPKG_TRIPLET=x86-windows`.
170171
> 2. For MSVC Debug mode, you need to replace `Release` with `Debug` for both `CMAKE_BUILD_TYPE` variable and `--config` option.
@@ -177,36 +178,40 @@ If you installed the dependencies manually, you need to run
177178

178179
```shell
179180
#If all dependencies are in your path, all that is necessary is
180-
pulsar-client-cpp/cmake .
181+
cmake .
181182

182183
#if all dependencies are not in your path, then passing in a PROTOC_PATH and CMAKE_PREFIX_PATH is necessary
183-
pulsar-client-cpp/cmake -DPROTOC_PATH=C:/protobuf/bin/protoc -DCMAKE_PREFIX_PATH="C:/boost;C:/openssl;C:/zlib;C:/curl;C:/protobuf;C:/googletest;C:/dlfcn-win32" .
184+
cmake -DPROTOC_PATH=C:/protobuf/bin/protoc -DCMAKE_PREFIX_PATH="C:/boost;C:/openssl;C:/zlib;C:/curl;C:/protobuf;C:/googletest;C:/dlfcn-win32" .
184185

185186
#This will generate pulsar-cpp.sln. Open this in Visual Studio and build the desired configurations.
186187
```
187188

188189
#### Checks
189190

190-
##### Client libraries are available in the following places.
191+
Client library will be placed in:
192+
191193
```
192-
pulsar-client-cpp/build/lib/Release/pulsar.lib
193-
pulsar-client-cpp/build/lib/Release/pulsar.dll
194+
build/lib/Release/pulsar.lib
195+
build/lib/Release/pulsar.dll
194196
```
195197

196198
#### Examples
197199

198-
##### Add windows environment paths.
200+
Add windows environment paths:
201+
199202
```
200-
pulsar-client-cpp/build/lib/Release
201-
pulsar-client-cpp/vcpkg_installed
203+
build/lib/Release
204+
vcpkg_installed
202205
```
203206

204-
##### Examples are available in.
207+
Examples will be available in:
208+
205209
```
206-
pulsar-client-cpp/build/examples/Release
210+
build/examples/Release
207211
```
208212

209213
## Tests
214+
210215
```shell
211216
# Execution
212217
# Start standalone broker

0 commit comments

Comments
 (0)