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
Fixed build problems with latest Boost library versions and workflow changes [DEX-431] [CTT-734][CTT-716] (#1322)
Fixed build problems with latest Boost library versions.
Verification pr build is
[HERE](https://github.com/hazelcast/hazelcast-cpp-client/actions/runs/18595861858).
I had to verify this PR on origin branch **new_boost_fixes** since we
also change the workflow, hence, please check this test run to see that
all tests in all environments actually passed and we can **actually
force merge** this PR.
Updated the project to use the minimum C++ standard to be the same as
the one required by the Boost library. This means if a user is using an
older Boost version we use C++11 but if newer Boost version is used we
change level to C++ 14 since the [Math library minimum requirement
became
C++14](https://github.com/boostorg/math/releases/tag/boost-1.82.0)
starting with Boost 1.82.0.
# Check Boost version and set C++ standard accordingly
# Our library can not use a lower C++ standard than the one required by
Boost.
if (Boost_VERSION VERSION_LESS 1.82.0)
set(CMAKE_CXX_STANDARD 11)
message(STATUS "Boost version ${Boost_VERSION} < 1.82.0, setting C++
standard to 11.")
else()
set(CMAKE_CXX_STANDARD 14)
message(STATUS "Boost version ${Boost_VERSION} >= 1.82.0, setting C++
standard to 14. "
"Boost.Math library requires minimum C++14 compiler.")
endif()
Changed the PR builder boost version to latest version of Boost 1.89.0.
The lazy partition assignment is causing problem with partition updates.
Hence, I had to to port the following Java PR client related parts to
the C++ client as well:
hazelcast/hazelcast#16375fixes#1253
fixes https://hazelcast.atlassian.net/browse/DEX-431
I tried to separate the workflows changes from other changes but that
attempt failed at
[here](#1334). We
bump into a problem which is due to update of the new LLVM compiler
which does more strict checking of the template class methods. This
caused a bug in boost become apparent and it is only fixed at Boost
1.88.0. When I bump the Boost version, I also have to change the
workflow since the versions are [hard coded into the workflow
build-pr](https://github.com/hazelcast/hazelcast-cpp-client/blob/db3b3d83c70491d1e6905d220d96035de8350623/.github/workflows/build-pr.yml#L27).
Hence, separation attempt fails.
**Important Note:** There is a problem with Windows NO-SSL builds,
hence, I currently enable SSL even for no-ssl builds until this problem
is solved. The windows no-ssl builds fail with many errors like:
```
5>C:\Boost\include\boost-1_89\boost\uuid\detail\chacha20.hpp(136,34): error C2059: syntax error: ')' [D:\a\hazelcast-cpp-client\hazelcast-cpp-client\build\hazelcast\test\src\client_test.vcxproj]
(compiling source file '../../../../hazelcast/test/src/ClientTest.cpp')
5>C:\Boost\include\boost-1_89\boost\uuid\detail\chacha20.hpp(136,34): error C2334: unexpected token(s) preceding ':'; skipping apparent function body [D:\a\hazelcast-cpp-client\hazelcast-cpp-client\build\hazelcast\test\src\client_test.vcxproj]
(compiling source file '../../../../hazelcast/test/src/ClientTest.cpp')
```
[This](#1328)
windows build issue needs to be resolved before we do any releases but I
do not want it block this PR since I already spent good amount of time
without a solution.
@@ -242,9 +242,22 @@ This generates the `conanbuildinfo.cmake` file to be included in your CMakeLists
242
242
### 1.1.3. Install From Source Code Using CMake
243
243
#### 1.1.3.1. Requirements
244
244
1. Linux, macOS or Windows
245
-
2. A compiler that supports C++11
245
+
2. A compiler that supports C++11 or above: The project detects the minimum C++ standard supported by the Boost library
246
+
and uses the same language level for compilation. If you are using Boost 1.82.0 or higher version, the project requires
247
+
C++14 or above since Boost.Math requires this language level as minimum starting 1.82.0 version.
248
+
For lower Boost versions, C++11 or above support is sufficient.
246
249
3.[CMake](https://cmake.org) 3.10 or above
247
-
4.[Boost](https://www.boost.org) 1.71 or above. Minimum boost version is upgraded to 1.73 for Windows due to [this](https://github.com/chriskohlhoff/asio/issues/431) bug.
##### 1.1.3.5.2. Building the hazelcast-cpp-client library with vcpkg toolchain
364
+
If you want to build the `hazelcast-cpp-client` library with vcpkg toolchain, you can use the following command
365
+
(For windows, please use `cmake.exe` instead of `cmake`):
366
+
```sh
367
+
cmake -B build -DCMAKE_TOOLCHAIN_FILE=<path to vcpkg folder>/scripts/buildsystems/vcpkg.cmake
368
+
cmake --build build --config Release
369
+
```
370
+
371
+
if you want to build the project with tests and examples enabled, then you can use the following command:
372
+
```sh
373
+
cmake -b build \
374
+
-DBUILD_TESTS=ON \
375
+
-DBUILD_EXAMPLES=ON \
376
+
-DWITH_OPENSSL=ON \
377
+
-DCMAKE_VERBOSE_MAKEFILE=ON \
378
+
-DCMAKE_TOOLCHAIN_FILE=<path to vcpkg folder>/scripts/buildsystems/vcpkg.cmake \
379
+
-DVCPKG_MANIFEST_FEATURES='build-tests' \
380
+
381
+
cmake --build build
382
+
```
383
+
384
+
350
385
## 1.2. Starting a Hazelcast Cluster
351
386
352
387
The Hazelcast C++ client requires a working Hazelcast cluster to run. This cluster handles storage and manipulation of the user data. Clients are a way to connect to the Hazelcast cluster and access such data.
@@ -3839,10 +3874,12 @@ In order to test Hazelcast C++ client locally, you will need the following:
3839
3874
* Boost
3840
3875
* thrift
3841
3876
3842
-
You need to enable the examples in the build with the cmake flag `-DBUILD_EXAMPLES=ON`. When you build, the result will
3843
-
produce the executable `client_test` on Linux/macOS and `client_test.exe` on Windows. You need to start the remote
3844
-
controller first before running this executable by executing `scripts/start-rc.sh` on Linux/macOS
3845
-
or `scripts/start-rc.bat` on Windows. Then you can run the test executable.
3877
+
When you compile with cmake, you need to use the flag `-DBUILD_TESTS=ON` to enable building the tests.
3878
+
When you build, the result will produce the executable `client_test` on Linux/macOS and `client_test.exe` on Windows.
3879
+
You need to start the remote controller first before running this executable by executing `scripts/start-rc.sh` on
3880
+
Linux/macOS or `scripts/start-rc.bat` on Windows. Then you can run the test executable.
3881
+
3882
+
If you want to build the examples, you need to use the cmake flag `-DBUILD_EXAMPLES=ON`.
0 commit comments