1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-3624 Move jemalloc to an LD_PRELOAD

Linking will become an issue for the unified build and it is an issue
for jemalloc 5.x. Instead we will LD_PRELOAD on the forked ColumnStore
specific processes.
This commit is contained in:
Andrew Hutchings
2019-11-25 11:51:04 +00:00
parent b3c22c8f9a
commit efe829784d
7 changed files with 11 additions and 66 deletions

View File

@ -153,17 +153,6 @@ if (NOT SNAPPY_FOUND)
MESSAGE(FATAL_ERROR "Snappy not found please install snappy-devel for CentOS/RedHat or libsnappy-dev for Ubuntu/Debian") MESSAGE(FATAL_ERROR "Snappy not found please install snappy-devel for CentOS/RedHat or libsnappy-dev for Ubuntu/Debian")
endif() endif()
# Jemalloc has issues with SLES 12, so disable for now
IF (EXISTS "/etc/SuSE-release")
SET(JEMALLOC_LIBRARIES "")
ELSE ()
INCLUDE (FindJeMalloc)
if (NOT JEMALLOC_FOUND)
message(FATAL_ERROR "jemalloc not found!")
SET(JEMALLOC_LIBRARIES "")
endif()
ENDIF ()
FIND_PROGRAM(AWK_EXECUTABLE awk DOC "path to the awk executable") FIND_PROGRAM(AWK_EXECUTABLE awk DOC "path to the awk executable")
if(NOT AWK_EXECUTABLE) if(NOT AWK_EXECUTABLE)
message(FATAL_ERROR "awk not found!") message(FATAL_ERROR "awk not found!")
@ -199,7 +188,7 @@ ENDIF()
SET (ENGINE_LDFLAGS "-Wl,--no-as-needed -Wl,--add-needed") SET (ENGINE_LDFLAGS "-Wl,--no-as-needed -Wl,--add-needed")
SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt libmysql_client ${JEMALLOC_LIBRARIES}) SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt libmysql_client)
SET (ENGINE_OAM_LIBS oamcpp alarmmanager) SET (ENGINE_OAM_LIBS oamcpp alarmmanager)
SET (ENGINE_BRM_LIBS brm idbdatafile cacheutils rwlock ${ENGINE_OAM_LIBS} ${ENGINE_COMMON_LIBS}) SET (ENGINE_BRM_LIBS brm idbdatafile cacheutils rwlock ${ENGINE_OAM_LIBS} ${ENGINE_COMMON_LIBS})
SET (ENGINE_EXEC_LIBS joblist execplan windowfunction joiner rowgroup funcexp udfsdk regr dataconvert common compress querystats querytele thrift threadpool ${ENGINE_BRM_LIBS}) SET (ENGINE_EXEC_LIBS joblist execplan windowfunction joiner rowgroup funcexp udfsdk regr dataconvert common compress querystats querytele thrift threadpool ${ENGINE_BRM_LIBS})

View File

@ -1,44 +0,0 @@
# - Try to find jemalloc headers and libraries.
#
# Usage of this module as follows:
#
# find_package(JeMalloc)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# JEMALLOC_ROOT_DIR Set this variable to the root installation of
# jemalloc if the module has problems finding
# the proper installation path.
#
# Variables defined by this module:
#
# JEMALLOC_FOUND System has jemalloc libs/headers
# JEMALLOC_LIBRARIES The jemalloc library/libraries
# JEMALLOC_INCLUDE_DIR The location of jemalloc headers
find_path(JEMALLOC_ROOT_DIR
NAMES include/jemalloc/jemalloc.h
)
find_library(JEMALLOC_LIBRARIES
NAMES jemalloc
HINTS ${JEMALLOC_ROOT_DIR}/lib
)
find_path(JEMALLOC_INCLUDE_DIR
NAMES jemalloc/jemalloc.h
HINTS ${JEMALLOC_ROOT_DIR}/include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JeMalloc DEFAULT_MSG
JEMALLOC_LIBRARIES
JEMALLOC_INCLUDE_DIR
)
mark_as_advanced(
JEMALLOC_ROOT_DIR
JEMALLOC_LIBRARIES
JEMALLOC_INCLUDE_DIR
)

View File

@ -8,7 +8,7 @@
# to be set before calling find_package: # to be set before calling find_package:
# #
# SNAPPY_ROOT_DIR Set this variable to the root installation of # SNAPPY_ROOT_DIR Set this variable to the root installation of
# jemalloc if the module has problems finding # snappy if the module has problems finding
# the proper installation path. # the proper installation path.
# #
# Variables defined by this module: # Variables defined by this module:
@ -28,7 +28,7 @@ find_library(SNAPPY_LIBRARIES
find_path(SNAPPY_INCLUDE_DIR find_path(SNAPPY_INCLUDE_DIR
NAMES snappy.h NAMES snappy.h
HINTS ${JEMALLOC_ROOT_DIR}/include HINTS ${SNAPPY_ROOT_DIR}/include
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)

View File

@ -65,11 +65,11 @@ if (EXISTS "/etc/debian_version")
set(DEBIAN_VERSION_NUMBER "${CMAKE_MATCH_1}") set(DEBIAN_VERSION_NUMBER "${CMAKE_MATCH_1}")
endif () endif ()
if ("${DEBIAN_VERSION_NUMBER}" EQUAL "8") if ("${DEBIAN_VERSION_NUMBER}" EQUAL "8")
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1, libjemalloc1") SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1, libjemalloc1 net-tools")
elseif ("${DEBIAN_VERSION_NUMBER}" EQUAL "9") elseif ("${DEBIAN_VERSION_NUMBER}" EQUAL "9")
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1v5, libreadline5, libjemalloc1") SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1v5, libreadline5, libjemalloc1 net-tools")
else() else()
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools, libjemalloc1") SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools, libjemalloc1 net-tools")
endif () endif ()
SET(CPACK_DEBIAN_STORAGE-ENGINE_PACKAGE_DEPENDS "mariadb-columnstore-libs") SET(CPACK_DEBIAN_STORAGE-ENGINE_PACKAGE_DEPENDS "mariadb-columnstore-libs")

View File

@ -87,13 +87,13 @@ IF (EXISTS "/etc/SuSE-release")
set(SUSE_VERSION_NUMBER "${CMAKE_MATCH_1}") set(SUSE_VERSION_NUMBER "${CMAKE_MATCH_1}")
ENDIF () ENDIF ()
if (${REDHAT_VERSION_NUMBER} EQUAL 6) if (${REDHAT_VERSION_NUMBER} EQUAL 6)
SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "mariadb-columnstore-libs" "mariadb-columnstore-shared" "snappy") SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "mariadb-columnstore-libs" "mariadb-columnstore-shared" "snappy" "net-tools")
# Disable auto require as this will also try to pull Boost via RPM # Disable auto require as this will also try to pull Boost via RPM
SET(CPACK_RPM_PACKAGE_AUTOREQPROV " no") SET(CPACK_RPM_PACKAGE_AUTOREQPROV " no")
elseif (${SUSE_VERSION_NUMBER} EQUAL 12) elseif (${SUSE_VERSION_NUMBER} EQUAL 12)
SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "boost-devel >= 1.54.0" "mariadb-columnstore-libs" "libsnappy1" "jemalloc") SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "boost-devel >= 1.54.0" "mariadb-columnstore-libs" "libsnappy1" "jemalloc" "net-tools")
else () else ()
SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "boost >= 1.53.0" "mariadb-columnstore-libs" "snappy" "jemalloc") SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "boost >= 1.53.0" "mariadb-columnstore-libs" "snappy" "jemalloc" "net-tools")
endif() endif()
SETA(CPACK_RPM_storage-engine_PACKAGE_REQUIRES "mariadb-columnstore-libs") SETA(CPACK_RPM_storage-engine_PACKAGE_REQUIRES "mariadb-columnstore-libs")

View File

@ -49,7 +49,7 @@ if [ $vflg -gt 0 ]; then
fi fi
while [ $keep_going -ne 0 ]; do while [ $keep_going -ne 0 ]; do
$exename $args LD_PRELOAD=libjemalloc.so $exename $args
if [ -e ${lopt}/StopColumnstore ]; then if [ -e ${lopt}/StopColumnstore ]; then
exit 0 exit 0
fi fi

View File

@ -60,7 +60,7 @@ set(CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/../lib)
add_library(storagemanager SHARED ${storagemanager_SRCS}) add_library(storagemanager SHARED ${storagemanager_SRCS})
add_dependencies(storagemanager marias3) add_dependencies(storagemanager marias3)
target_compile_definitions(storagemanager PUBLIC BOOST_NO_CXX11_SCOPED_ENUMS) target_compile_definitions(storagemanager PUBLIC BOOST_NO_CXX11_SCOPED_ENUMS)
target_link_libraries(storagemanager boost_system boost_thread boost_filesystem boost_regex pthread ${S3API_DEPS} ${JEMALLOC_LIBRARIES}) target_link_libraries(storagemanager boost_system boost_thread boost_filesystem boost_regex pthread ${S3API_DEPS})
set_property(TARGET storagemanager PROPERTY CXX_STANDARD 11) set_property(TARGET storagemanager PROPERTY CXX_STANDARD 11)
add_executable(StorageManager src/main.cpp) add_executable(StorageManager src/main.cpp)