在 Mac 上安装 Apache Pulsar C++ 客户端
Installin Apache Pulsar C++ Client on a Mac
我正在尝试按照以下说明在 Mac 上安装 Apache Pulsar C++ 客户端:
https://github.com/apache/pulsar/tree/master/pulsar-client-cpp#compile-on-mac-os-x
不幸的是,我在 运行 cmake .
步骤时收到以下响应:
12:25 AM rp:~/fp/pulsar/pulsar-client-cpp$(master)>cmake .
-- BUILD_TESTS: ON
-- BUILD_PYTHON_WRAPPER: ON
-- LINK_STATIC: OFF
-- USE_LOG4CXX: OFF
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- Found Boost: /usr/local/include (found version "1.71.0") found components: program_options regex system
-- PYTHON: 2.7.16
CMake Warning at /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FindBoost.cmake:2003 (message):
No header defined for python-mt; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:149 (find_package)
CMake Warning at /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FindBoost.cmake:2003 (message):
No header defined for python-py27; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:149 (find_package)
CMake Warning at /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FindBoost.cmake:2003 (message):
No header defined for python27-mt; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:149 (find_package)
CMake Warning at /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FindBoost.cmake:2003 (message):
No header defined for python27-mt; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:160 (find_package)
-- Found Boost: /usr/local/include (found version "1.71.0") found components: python27-mt
-- HAS_ZSTD: 1
-- HAS_SNAPPY: 0
-- Using Boost Python libs: /usr/local/opt/python@2/Frameworks/Python.framework/Versions/2.7/lib;/usr/local/lib/libboost_python27-mt.dylib;Boost_PYTHON37-MT_LIBRARY_RELEASE-NOTFOUND
CMake Error at python/CMakeLists.txt:70 (MESSAGE):
Could not find Boost Python library
-- Configuring incomplete, errors occurred!
See also "/Users/rp/fp/pulsar/pulsar-client-cpp/CMakeFiles/CMakeOutput.log".
我已经使用 brew 安装了 boost、boost-python 和 cmake,但是 cmake 似乎没有看到 python boost。
我能够通过编辑 pulsar/pulsar-client-cpp
下的主要 CMakeLists.txt
文件找到解决方法:
if (PYTHONLIBS_VERSION_STRING MATCHES "^3.+$")
MESSAGE(STATUS "DETECTED Python 3")
string(REPLACE "." ";" PYTHONLIBS_VERSION_NO_LIST ${PYTHONLIBS_VERSION_STRING})
list(GET PYTHONLIBS_VERSION_NO_LIST 0 PYTHONLIBS_VERSION_MAJOR)
list(GET PYTHONLIBS_VERSION_NO_LIST 1 PYTHONLIBS_VERSION_MINOR)
set(BOOST_PYTHON_NAME_POSTFIX ${PYTHONLIBS_VERSION_MAJOR}${PYTHONLIBS_VERSION_MINOR})
# For python3 the lib name is boost_python3
set(BOOST_PYTHON_NAME_LIST python3;python3-mt;python-py${BOOST_PYTHON_NAME_POSTFIX};python${BOOST_PYTHON_NAME_POSTFIX}-mt;python${BOOST_PYTHON_NAME_POSTFIX})
else ()
# Regular boost_python
set(BOOST_PYTHON_NAME_LIST python3;python37;python;python-mt;python-py27;python27-mt;python27)
endif ()
此解决方案确实需要使用 brew install boost-python3
。
我怀疑如果 python
与 python27
切换,它也会起作用。我的 python
安装是 2.7.
我正在尝试按照以下说明在 Mac 上安装 Apache Pulsar C++ 客户端: https://github.com/apache/pulsar/tree/master/pulsar-client-cpp#compile-on-mac-os-x
不幸的是,我在 运行 cmake .
步骤时收到以下响应:
12:25 AM rp:~/fp/pulsar/pulsar-client-cpp$(master)>cmake .
-- BUILD_TESTS: ON
-- BUILD_PYTHON_WRAPPER: ON
-- LINK_STATIC: OFF
-- USE_LOG4CXX: OFF
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- Found Boost: /usr/local/include (found version "1.71.0") found components: program_options regex system
-- PYTHON: 2.7.16
CMake Warning at /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FindBoost.cmake:2003 (message):
No header defined for python-mt; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:149 (find_package)
CMake Warning at /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FindBoost.cmake:2003 (message):
No header defined for python-py27; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:149 (find_package)
CMake Warning at /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FindBoost.cmake:2003 (message):
No header defined for python27-mt; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:149 (find_package)
CMake Warning at /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FindBoost.cmake:2003 (message):
No header defined for python27-mt; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:160 (find_package)
-- Found Boost: /usr/local/include (found version "1.71.0") found components: python27-mt
-- HAS_ZSTD: 1
-- HAS_SNAPPY: 0
-- Using Boost Python libs: /usr/local/opt/python@2/Frameworks/Python.framework/Versions/2.7/lib;/usr/local/lib/libboost_python27-mt.dylib;Boost_PYTHON37-MT_LIBRARY_RELEASE-NOTFOUND
CMake Error at python/CMakeLists.txt:70 (MESSAGE):
Could not find Boost Python library
-- Configuring incomplete, errors occurred!
See also "/Users/rp/fp/pulsar/pulsar-client-cpp/CMakeFiles/CMakeOutput.log".
我已经使用 brew 安装了 boost、boost-python 和 cmake,但是 cmake 似乎没有看到 python boost。
我能够通过编辑 pulsar/pulsar-client-cpp
下的主要 CMakeLists.txt
文件找到解决方法:
if (PYTHONLIBS_VERSION_STRING MATCHES "^3.+$")
MESSAGE(STATUS "DETECTED Python 3")
string(REPLACE "." ";" PYTHONLIBS_VERSION_NO_LIST ${PYTHONLIBS_VERSION_STRING})
list(GET PYTHONLIBS_VERSION_NO_LIST 0 PYTHONLIBS_VERSION_MAJOR)
list(GET PYTHONLIBS_VERSION_NO_LIST 1 PYTHONLIBS_VERSION_MINOR)
set(BOOST_PYTHON_NAME_POSTFIX ${PYTHONLIBS_VERSION_MAJOR}${PYTHONLIBS_VERSION_MINOR})
# For python3 the lib name is boost_python3
set(BOOST_PYTHON_NAME_LIST python3;python3-mt;python-py${BOOST_PYTHON_NAME_POSTFIX};python${BOOST_PYTHON_NAME_POSTFIX}-mt;python${BOOST_PYTHON_NAME_POSTFIX})
else ()
# Regular boost_python
set(BOOST_PYTHON_NAME_LIST python3;python37;python;python-mt;python-py27;python27-mt;python27)
endif ()
此解决方案确实需要使用 brew install boost-python3
。
我怀疑如果 python
与 python27
切换,它也会起作用。我的 python
安装是 2.7.