Skip to content
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

pulsar-client-cpp fails to build on mac #198

Closed
jai1 opened this issue Feb 9, 2017 · 2 comments
Closed

pulsar-client-cpp fails to build on mac #198

jai1 opened this issue Feb 9, 2017 · 2 comments
Assignees
Milestone

Comments

@jai1
Copy link
Contributor

jai1 commented Feb 9, 2017

Expected behavior

On mac machine

./pulsar-client-cpp 
cmake .

should be successful

Actual behavior

cmake fail instead since

  • ./pulsar-client-cpp/lib/CMakeLists.txt assumes that grep and sed are kept in /bin and grep can support -Po option
  • ./pulsar-client-cpp/CMakeLists.txt doesn't contain GTEST_INCLUDE_PATH

Steps to reproduce

Mentioned in Expected behavior section

System configuration

Pulsar version: x.y

Work around

replace the file ./pulsar-client-cpp/lib/CMakeLists.txt contents with

file(GLOB PULSAR_SOURCES *.cc lz4/*.c checksum/*.cc)

set (CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -msse4.2 -mpclmul")

add_library(pulsarStatic STATIC ${PULSAR_SOURCES})
add_library(pulsarShared SHARED ${PULSAR_SOURCES})

set_target_properties(pulsarStatic PROPERTIES OUTPUT_NAME pulsar)
set_target_properties(pulsarShared PROPERTIES OUTPUT_NAME pulsar)

target_link_libraries(pulsarStatic ${COMMON_LIBS})
target_link_libraries(pulsarShared ${COMMON_LIBS})

add_subdirectory(auth)

replace the file ./pulsar-client-cpp/CMakeLists.txt contents with

cmake_minimum_required(VERSION 2.8)
project (pulsar-cpp)

set(Boost_NO_BOOST_CMAKE ON)

set (CMAKE_CXX_FLAGS "-Wno-deprecated-declarations ${CMAKE_CXX_FLAGS}")

find_package(Boost REQUIRED COMPONENTS program_options filesystem regex thread system)
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
find_package(ProtoBuf QUIET)
if(NOT ProtoBuf_FOUND)
  find_library(PROTOBUF_LIBRARIES protobuf)
endif()
find_library(LOG4CXX_LIBRARY_PATH log4cxx)
find_library(CURL_LIBRARY_PATH curl)

find_path(LOG4CXX_INCLUDE_PATH log4cxx/logger.h)
find_path(GTEST_INCLUDE_PATH gtest/gtest.h)


include_directories(
  ${CMAKE_SOURCE_DIR}
  ${CMAKE_SOURCE_DIR}/include
  ${Boost_INCLUDE_DIR}
  ${OPENSSL_INCLUDE_DIR}
  ${ZLIB_INCLUDE_DIR}
  ${PROTOBUF_INCLUDE_DIR}
  ${LOG4CXX_INCLUDE_PATH}
  ${GTEST_INCLUDE_PATH}
)

set(COMMON_LIBS
  ${COMMON_LIBS}
  ${Boost_LIBRARIES}
  ${OPENSSL_LIBRARIES}
  ${ZLIB_LIBRARIES}
  ${PROTOBUF_LIBRARIES}
  ${LOG4CXX_LIBRARY_PATH}
  ${CURL_LIBRARY_PATH}
)

link_directories(${CMAKE_BINARY_DIR}/lib)

set(CLIENT_LIBS
  ${COMMON_LIBS}
  pulsar
)

add_subdirectory(lib)
add_subdirectory(perf)
add_subdirectory(examples)
add_subdirectory(tests)
@merlimat merlimat added the c++ label Feb 9, 2017
@merlimat merlimat added this to the 1.17 milestone Feb 9, 2017
@merlimat
Copy link
Contributor

merlimat commented Feb 9, 2017

@jai1 Can you also add instructions on how to install dependencies on Mac in the c++ readme page?

@saandrews
Copy link
Contributor

saandrews commented Feb 9, 2017 via email

hrsakai pushed a commit to hrsakai/pulsar that referenced this issue Dec 10, 2020
* Fix pprof typo

Signed-off-by: xiaolong.ran <rxl@apache.org>

* View the status of pprof in the web

Signed-off-by: xiaolong.ran <rxl@apache.org>

* fix comments

Signed-off-by: xiaolong.ran <rxl@apache.org>

* fix comments

Signed-off-by: xiaolong.ran <rxl@apache.org>

* fix ci error

Signed-off-by: xiaolong.ran <rxl@apache.org>

* fix comments

Signed-off-by: xiaolong.ran <rxl@apache.org>

* fix comments

Signed-off-by: xiaolong.ran <rxl@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants