Skip to content

Commit

Permalink
centos 6 workaround for 7.6.0
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Gardner <[email protected]>

Centos-6-workaround adding libboost-regex.so, build and import

Signed-off-by: Michael Gardner <[email protected]>
  • Loading branch information
Michael-Gardner committed Sep 18, 2019
1 parent 9407b5b commit 28b0f15
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmake_modules/FindLIBMEMCACHED.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ if((LIBMEMCACHEDCORE_LIBRARY STREQUAL "LIBMEMCACHEDCORE_LIBRARY-NOTFOUND"
DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/downloads
SOURCE_DIR ${CMAKE_BINARY_DIR}/downloads/libmemcached
CONFIGURE_COMMAND "${CMAKE_BINARY_DIR}/downloads/libmemcached/configure" --prefix=${INSTALL_DIR} LDFLAGS=-L${LIB_PATH}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} LDFLAGS=-Wl,-rpath-link,${LIB_PATH}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} CXXFLAGS='-fpermissive' LDFLAGS='-Wl,-rpath-link,${LIB_PATH}'
BINARY_DIR ${CMAKE_BINARY_DIR}/build-libmemcached
INSTALL_COMMAND "")
add_library(libmemcached SHARED IMPORTED GLOBAL)
Expand Down
32 changes: 32 additions & 0 deletions cmake_modules/buildBOOST_REGEX.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

include(ExternalProject)
ExternalProject_Add(
generate-boost-regex
URL https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.gz
URL_HASH SHA256=96b34f7468f26a141f6020efb813f1a2f3dfb9797ecf76a7d7cbd843cc95f5bd
TIMEOUT 15
DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/downloads
SOURCE_DIR ${CMAKE_BINARY_DIR}/downloads/boost_1_71_0
CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/downloads/boost_1_71_0/bootstrap.sh
BUILD_COMMAND ${CMAKE_BINARY_DIR}/downloads/boost_1_71_0/b2 --prefix=${INSTALL_DIR} --exec-prefix=${INSTALL_DIR} --with-regex --with-headers
BUILD_IN_SOURCE TRUE
INSTALL_COMMAND ""
)

add_library(boost-regex SHARED IMPORTED GLOBAL)
set_property(TARGET boost-regex
PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/downloads/boost_1_71_0/stage/lib/libboost_regex.so.1.71.0)
add_dependencies(boost-regex generate-boost-regex)

if(PLATFORM OR CLIENTTOOLS_ONLY)
install(CODE "set(ENV{LD_LIBRARY_PATH} \"\$ENV{LD_LIBRARY_PATH}:${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/downloads/boost_1_71_0/stage/lib\")")
install(PROGRAMS
${CMAKE_BINARY_DIR}/downloads/boost_1_71_0/stage/lib/libboost_regex.so.1.71.0
${CMAKE_BINARY_DIR}/downloads/boost_1_71_0/stage/lib/libboost_regex.so
DESTINATION ${LIB_DIR})
endif()

set(BOOST_REGEX_INCLUDE_DIR ${CMAKE_BINARY_DIR}/downloads/boost_1_71_0)
set(BOOST_REGEX_LIBRARIES ${CMAKE_BINARY_DIR}/downloads/boost_1_71_0/stage/lib/libboost_regex.so.1.17.0)
message(STATUS "----------------------- ${BOOST_REGEX_LIBRARIES}")
mark_as_advanced(BOOST_REGEX_LIBRARIES BOOST_REGEX_INCLUDE_DIR)
15 changes: 10 additions & 5 deletions cmake_modules/commonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
option(USE_OPENLDAP "Enable OpenLDAP support (requires OpenLDAP)" ON)
option(USE_ICU "Enable unicode support (requires ICU)" ON)
option(USE_BOOST_REGEX "Configure use of boost regex" ON)
option(CENTOS_6_BOOST "Supply regex library on CentOS 6" OFF)
# USE_C11_REGEX is only checked if USE_BOOST_REGEX is OFF
# to disable REGEX altogether turn both off
option(USE_C11_REGEX "Configure use of c++11 std::regex" ON)
Expand Down Expand Up @@ -878,12 +879,16 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
endif(USE_URIPARSER)

if(USE_BOOST_REGEX)
find_package(BOOST_REGEX)
if (BOOST_REGEX_FOUND)
message(STATUS "BOOST_REGEX enabled")
add_definitions (-D_USE_BOOST_REGEX)
if(CENTOS_6_BOOST)
include(${CMAKE_MODULE_PATH}/buildBOOST_REGEX.cmake)
else()
message(FATAL_ERROR "BOOST_REGEX requested but package not found")
find_package(BOOST_REGEX)
if (BOOST_REGEX_FOUND)
message(STATUS "BOOST_REGEX enabled")
add_definitions (-D_USE_BOOST_REGEX)
else()
message(FATAL_ERROR "BOOST_REGEX requested but package not found")
endif()
endif()
else(USE_BOOST_REGEX)
if (USE_C11_REGEX)
Expand Down
3 changes: 3 additions & 0 deletions configuration/configmgr/configmgrlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ INCLUDE_DIRECTORIES(

ADD_DEFINITIONS( -D_USRDLL -DCFGMGRLIB_EXPORTS)
HPCC_ADD_LIBRARY( configmgr SHARED ${SRCS} )
if(CENTOS_6_BOOST)
add_dependencies(configmgr generate-boost-regex)
endif()
TARGET_LINK_LIBRARIES( configmgr jlib)

INSTALL ( TARGETS configmgr RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
9 changes: 8 additions & 1 deletion rtl/eclrtl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,15 @@ if (USE_BOOST_REGEX)
endif ()

HPCC_ADD_LIBRARY( eclrtl SHARED ${SRCS} )

if(CENTOS_6_BOOST)
add_dependencies(eclrtl boost-regex)
target_link_libraries( eclrtl boost-regex)
else()
target_link_libraries( eclrtl ${BOOST_REGEX_LIBRARIES} )
endif()

target_link_libraries ( eclrtl
${BOOST_REGEX_LIBRARIES}
jlib
nbcd
roxiemem
Expand Down
1 change: 1 addition & 0 deletions system/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if (NOT JLIB_ONLY)

if (USE_AERON)
project (aeron_include)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lrt")
remove_definitions(-fvisibility=hidden)
HPCC_ADD_SUBDIRECTORY (aeron)
endif()
Expand Down

0 comments on commit 28b0f15

Please sign in to comment.