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
Fixesapache#7
The Python client cannot be built with MSVC.
CMakeLists.txt:
1. Boost.Python cannot be found on Windows. The component of Boost
cannot be `python3`. It should be a specific version like
`python310`. Therefore, find all possible components from 3.10 to 3.7
until the first component is available.
2. For MSVC, link to `pulsarWithDeps.lib` when `LINK_STATIC` is `ON` and
set the `MSVC_RUNTIME_LIBRARY` target property to `MultiThreaded`.
3. Change the suffix from `.so` to `.pyd` because Python on Windows
recognizes `*.pyd` as the dynamic library.
4. Link to Python library with MSVC, otherwise the symbos cannot be
found when linking `boost-python`.
README: tell users how to build Python client on Windows.
Add a workflow to build Python wheels of versions 3.7 to 3.10 on Windows
and verify the build will succeed.
With this PR, Windows users still need to put the related
`boost_python*.dll` under the system path. In future, the `boost-python`
dependency will be removed. See
apache#24.
> NOTE: For Windows 32-bit library, change `x64-windows` to `x86-windows`, see [here](https://github.com/microsoft/vcpkg/tree/master/triplets) for all available triplets.
43
+
44
+
Then, build and install the Python wheel.
45
+
46
+
```PowerShell
47
+
# Assuming the Pulsar C++ client has been installed under the `PULSAR_CPP` directory.
Since the Python client links to Boost.Python dynamically, you have to copy the dll (e.g. `boost_python310-vc142-mt-x64-1_80.dll`) into the system path (the `PATH` environment variable). If the `-DLINK_STATIC=ON` option is not specified, you have to copy the `pulsar.dll` into the system path as well.
56
+
57
+
### Linux or macOS
58
+
59
+
Assuming the Pulsar C++ client and Boost.Python have been installed under the system path.
> 1. Here a separate `build` directory is created to store all CMake temporary files. However, the `setup.py` requires the `_pulsar.so` is under the project directory.
46
72
> 2. Add the `--force-reinstall` option to overwrite the existing Python wheel in case your system has already installed a wheel before.
47
73
74
+
## Running examples
75
+
48
76
You can run `python3 -c 'import pulsar'` to see whether the wheel has been installed successfully. If it failed, check whether dependencies (e.g. `libpulsar.so`) are in the system path. If not, make sure the dependencies are in `LD_LIBRARY_PATH` (on Linux) or `DYLD_LIBRARY_PATH` (on macOS).
49
77
50
78
Then you can run examples as a simple end-to-end test.
0 commit comments