-
Notifications
You must be signed in to change notification settings - Fork 45
Windows builds #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Actually yes. The CMakeLists.txt needs some fixes. I was working on this issue a few days ago and will continue the fix after backing to work. The core issue is about the static linking. Here is my working branch: https://github.com/BewareMyPower/pulsar/commits/bewaremypower/cpp-static-link. Please note that it doesn't work currently (I forgot to push latest commits in my Windows laptop).
|
Fixes apache#7 ### Motivation The Python client cannot be built with MSVC. ### Modifications Add `vcpkg.json` to download the Boost.Python dependency.
Fixes apache#7 ### Motivation The Python client cannot be built with MSVC. ### Modifications Add `vcpkg.json` to download the Boost.Python dependency. Then fix some CMake errors: 1. Boost.Python cannot be found on Windows. The component of Boost cannot be `python3`. It should be a specific version like `python310`. 2. Link to `pulsarWithDeps.lib` for MSVC and modify the compilation option from `/MD` to `/MT` when `LINK_STATIC` is `ON`. 3. When `LINK_STATIC` is `OFF` (by default), remove the suffix of the name because CMake will find the correct suffixes on different platforms. 4. Add the Python3 library to the target on Windows, otherwise the symbols cannot be found. Since Python on Windows can only recognize `*.pyd` suffix of a C extension, change the `CMAKE_SHARED_LIBRARY_SUFFIX` and use `_pulsar.pyd` in `setup.py` on Windows. Add README to tell users how to build Python client on Windows. ### TODO Add a GitHub Actions workflow to verify the Windows build.
Fixes apache#7 ### Motivation The Python client cannot be built with MSVC. ### Modifications Add `vcpkg.json` to download the Boost.Python dependency. Then fix some CMake errors: 1. Boost.Python cannot be found on Windows. The component of Boost cannot be `python3`. It should be a specific version like `python310`. 2. Link to `pulsarWithDeps.lib` for MSVC and modify the compilation option from `/MD` to `/MT` when `LINK_STATIC` is `ON`. 3. When `LINK_STATIC` is `OFF` (by default), remove the suffix of the name because CMake will find the correct suffixes on different platforms. 4. Add the Python3 library to the target on Windows, otherwise the symbols cannot be found. Since Python on Windows can only recognize `*.pyd` suffix of a C extension, change the `CMAKE_SHARED_LIBRARY_SUFFIX` and use `_pulsar.pyd` in `setup.py` on Windows. Add README to tell users how to build Python client on Windows. ### TODO Add a GitHub Actions workflow to verify the Windows build.
Fixes apache#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.
Fixes apache#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.
Fixes apache#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.
Any possibility of getting windows support for the Pulsar python package?
I've tried building it localy and got pretty far, but ran into issues with matching the python version between boost-python and pulsar-client-python, which I've been unable to resolve.
The C++ client itself builds fine on windows, so I don't think there should be any serious blockers for this?
The text was updated successfully, but these errors were encountered: