From f9553284961d87979b83173e7ecf8fdd33e94870 Mon Sep 17 00:00:00 2001 From: Demogorgon314 Date: Wed, 12 Oct 2022 18:05:19 +0800 Subject: [PATCH 1/2] Fix Ubuntu and macOS build guide --- README.md | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index dbad7219..8d92a20f 100644 --- a/README.md +++ b/README.md @@ -92,37 +92,11 @@ Run unit tests: #### Install all dependencies: ```shell -apt-get install -y g++ cmake libssl-dev libcurl4-openssl-dev \ - libprotobuf-dev libboost-all-dev libgtest-dev google-mock \ +sudo apt-get install -y g++ cmake libssl-dev libcurl4-openssl-dev \ + libprotobuf-dev libboost-all-dev libgtest-dev libgmock-dev \ protobuf-compiler ``` -#### Compile and install Google Test: - -```shell -cd /usr/src/gtest -sudo cmake . -sudo make - -# Copy the libraries you just built to the OS library path. -sudo cp lib/*.a /usr/lib -``` - - -#### Compile and install Google Mock: - -```shell -cd /usr/src/gmock -sudo cmake . -sudo make - -# Copy the gmock headers to the OS include path. -sudo cp -r include/gmock /usr/include/ -# Copy the libraries you just built to the OS brary path. -sudo cp lib/*.a /usr/lib -``` - - #### Compile Pulsar client library: ```shell @@ -151,12 +125,17 @@ perf/perfConsumer ```shell # For openSSL brew install openssl + +# For x86_64 macOS export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/ export OPENSSL_ROOT_DIR=/usr/local/opt/openssl/ +# For arm64 (Apple Silicon) macOS +export OPENSSL_INCLUDE_DIR=/opt/homebrew/opt/openssl/include/ +export OPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl/ + # For Protobuf -brew install protobuf boost boost-python log4cxx jsoncpp -// If you are using python3, you need to install boost-python3 +brew install protobuf boost boost-python3 log4cxx jsoncpp # For GoogleTest brew install googletest From 3936ab30a09b65ce9bc0f5ff5d7dbff3ad6ca885 Mon Sep 17 00:00:00 2001 From: Matteo Merli Date: Wed, 12 Oct 2022 08:52:44 -0700 Subject: [PATCH 2/2] Fixed readme --- README.md | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 8d92a20f..c7fc3021 100644 --- a/README.md +++ b/README.md @@ -123,22 +123,7 @@ perf/perfConsumer #### Install all dependencies: ```shell -# For openSSL -brew install openssl - -# For x86_64 macOS -export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/ -export OPENSSL_ROOT_DIR=/usr/local/opt/openssl/ - -# For arm64 (Apple Silicon) macOS -export OPENSSL_INCLUDE_DIR=/opt/homebrew/opt/openssl/include/ -export OPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl/ - -# For Protobuf -brew install protobuf boost boost-python3 log4cxx jsoncpp - -# For GoogleTest -brew install googletest +brew install openssl protobuf boost boost-python3 googletest zstd snappy ``` #### Compile Pulsar client library: @@ -237,18 +222,16 @@ pulsar-client-cpp/build/examples/Release ## Tests ```shell -# Source code -pulsar-client-cpp/tests/ - # Execution # Start standalone broker -pulsar-test-service-start.sh +./pulsar-test-service-start.sh # Run the tests -pulsar-client-cpp/tests/main +cd tests +./pulsar-tests # When no longer needed, stop standalone broker -pulsar-test-service-stop.sh +./pulsar-test-service-stop.sh ``` ## Requirements for Contributors