1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-09-02 12:41:17 +03:00

MCOL-294 Use OS jemalloc

Use the OS jemalloc if found, standard malloc if not
This commit is contained in:
Andrew Hutchings
2016-09-23 11:11:00 -05:00
parent 399d680375
commit 9915ed31f9
13 changed files with 50 additions and 61 deletions

View File

@@ -75,6 +75,11 @@ if (NOT NETSNMP_FOUND)
MESSAGE(FATAL_ERROR "Could not find net-snmp!") MESSAGE(FATAL_ERROR "Could not find net-snmp!")
endif() endif()
INCLUDE (FindJeMalloc)
if (NOT JEMALLOC_FOUND)
message(WARNING "jemalloc not found! Compiling with standard malloc")
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!")
@@ -107,7 +112,7 @@ SET (ENGINE_MYSQLDIR "${INSTALL_ENGINE}/mysql")
SET (ENGINE_MIBDIR "${INSTALL_ENGINE}/share/snmp/mibs") SET (ENGINE_MIBDIR "${INSTALL_ENGINE}/share/snmp/mibs")
SET (ENGINE_TOOLSDIR "${INSTALL_ENGINE}/tools") SET (ENGINE_TOOLSDIR "${INSTALL_ENGINE}/tools")
SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt) SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt ${JEMALLOC_LIBRARIES})
SET (ENGINE_OAM_LIBS oamcpp snmpmanager) SET (ENGINE_OAM_LIBS oamcpp snmpmanager)
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 dataconvert common compress mysqlcl_idb querystats querytele thrift threadpool ${ENGINE_BRM_LIBS}) SET (ENGINE_EXEC_LIBS joblist execplan windowfunction joiner rowgroup funcexp udfsdk dataconvert common compress mysqlcl_idb querystats querytele thrift threadpool ${ENGINE_BRM_LIBS})
@@ -204,6 +209,4 @@ ADD_SUBDIRECTORY(writeengine/server)
ADD_SUBDIRECTORY(writeengine/bulk) ADD_SUBDIRECTORY(writeengine/bulk)
ADD_SUBDIRECTORY(writeengine/splitter) ADD_SUBDIRECTORY(writeengine/splitter)
INSTALL(PROGRAMS utils/jemalloc/libjemalloc.so.3.3.0 DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
INCLUDE(cpackEngineRPM.cmake) INCLUDE(cpackEngineRPM.cmake)

44
FindJeMalloc.cmake Normal file
View File

@@ -0,0 +1,44 @@
# - 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

@@ -284,12 +284,9 @@ rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/%{name}-%{version}.%{release}
/usr/local/mariadb/columnstore/lib/libmysqlcl_idb.so.1.0.0 /usr/local/mariadb/columnstore/lib/libmysqlcl_idb.so.1.0.0
/usr/local/mariadb/columnstore/lib/libquerystats.so.1.0.0 /usr/local/mariadb/columnstore/lib/libquerystats.so.1.0.0
/usr/local/mariadb/columnstore/lib/libwriteengineredistribute.so.1.0.0 /usr/local/mariadb/columnstore/lib/libwriteengineredistribute.so.1.0.0
/usr/local/mariadb/columnstore/lib/libjemalloc.so.3.3.0
/usr/local/mariadb/columnstore/lib/libidbdatafile.so.1.0.0 /usr/local/mariadb/columnstore/lib/libidbdatafile.so.1.0.0
#/usr/local/mariadb/columnstore/lib/hdfs-20.so #/usr/local/mariadb/columnstore/lib/hdfs-20.so
#/usr/local/mariadb/columnstore/lib/hdfs-12.so #/usr/local/mariadb/columnstore/lib/hdfs-12.so
#/usr/local/mariadb/columnstore/lib/libgcc_s.so.1
#/usr/local/mariadb/columnstore/lib/libstdc++.so.6.0.14
/usr/local/mariadb/columnstore/lib/libthrift.so.1.0.0 /usr/local/mariadb/columnstore/lib/libthrift.so.1.0.0
/usr/local/mariadb/columnstore/lib/libquerytele.so.1.0.0 /usr/local/mariadb/columnstore/lib/libquerytele.so.1.0.0

View File

@@ -328,7 +328,6 @@ rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/%{name}-%{version}.%{release}
/usr/local/mariadb/columnstore/lib/libmysqlcl_idb.so.1.0.0 /usr/local/mariadb/columnstore/lib/libmysqlcl_idb.so.1.0.0
/usr/local/mariadb/columnstore/lib/libquerystats.so.1.0.0 /usr/local/mariadb/columnstore/lib/libquerystats.so.1.0.0
/usr/local/mariadb/columnstore/lib/libwriteengineredistribute.so.1.0.0 /usr/local/mariadb/columnstore/lib/libwriteengineredistribute.so.1.0.0
/usr/local/mariadb/columnstore/lib/libjemalloc.so.3.3.0
/usr/local/mariadb/columnstore/lib/libidbdatafile.so.1.0.0 /usr/local/mariadb/columnstore/lib/libidbdatafile.so.1.0.0
/usr/local/mariadb/columnstore/lib/hdfs-20.so /usr/local/mariadb/columnstore/lib/hdfs-20.so
/usr/local/mariadb/columnstore/lib/hdfs-12.so /usr/local/mariadb/columnstore/lib/hdfs-12.so

View File

@@ -65,12 +65,6 @@ find ${prefix}/Calpont -type f | xargs chmod +r
mkdir -p ${prefix}/Calpont/data1/systemFiles/dbrm mkdir -p ${prefix}/Calpont/data1/systemFiles/dbrm
if [ ! -e ${prefix}/Calpont/lib/libjemalloc.so ]; then
pushd ${prefix}/Calpont/lib >/dev/null
ln -s libjemalloc.so.1 libjemalloc.so
popd >/dev/null
fi
if [ ! -f ${prefix}/Calpont/etc/Columnstore.xml.rpmsave ]; then if [ ! -f ${prefix}/Calpont/etc/Columnstore.xml.rpmsave ]; then
cp ${prefix}/Calpont/etc/Columnstore.xml.singleserver ${prefix}/Calpont/etc/Columnstore.xml.rpmsave cp ${prefix}/Calpont/etc/Columnstore.xml.singleserver ${prefix}/Calpont/etc/Columnstore.xml.rpmsave
fi fi

View File

@@ -130,7 +130,6 @@ if [ $? -ne 0 -o ! -x $prefix/Calpont/bin/PrimProc ]; then
fi fi
cp dbcon/mysql/my.cnf $prefix/Calpont/mysql cp dbcon/mysql/my.cnf $prefix/Calpont/mysql
cp utils/jemalloc/libjemalloc.so.3.3.0 $prefix/Calpont/lib/libjemalloc.so
echo "InfiniDB binaries and libs are in $prefix/Calpont" echo "InfiniDB binaries and libs are in $prefix/Calpont"

View File

@@ -46,12 +46,6 @@ if [ -n "$plugin" ]; then
. $InstallDir/bin/$setenv >/dev/null 2>&1 . $InstallDir/bin/$setenv >/dev/null 2>&1
fi fi
if [ -e $InstallDir/lib/libjemalloc.so ]; then
export LD_PRELOAD=$InstallDir/lib/libjemalloc.so
elif [ -e $InstallDir/lib/libjemalloc.so.1 ]; then
export LD_PRELOAD=$InstallDir/lib/libjemalloc.so.1
fi
test -f $InstallDir/post/functions && . $InstallDir/post/functions test -f $InstallDir/post/functions && . $InstallDir/post/functions
mt=`module_type` mt=`module_type`

View File

@@ -46,12 +46,6 @@ if [ -n "$plugin" ]; then
. $InstallDir/bin/$setenv >/dev/null 2>&1 . $InstallDir/bin/$setenv >/dev/null 2>&1
fi fi
if [ -e $InstallDir/lib/libjemalloc.so ]; then
export LD_PRELOAD=$InstallDir/lib/libjemalloc.so
elif [ -e $InstallDir/lib/libjemalloc.so.1 ]; then
export LD_PRELOAD=$InstallDir/lib/libjemalloc.so.1
fi
test -f $InstallDir/post/functions && . $InstallDir/post/functions test -f $InstallDir/post/functions && . $InstallDir/post/functions
mt=`module_type` mt=`module_type`

View File

@@ -87,9 +87,6 @@ if [ -f libstdc++.so.6.0.14 ]; then
chown -h $user.$user libstdc++.so.6 >/dev/null 2>&1 chown -h $user.$user libstdc++.so.6 >/dev/null 2>&1
fi fi
ln -sf libjemalloc.so.3.3.0 libjemalloc.so
chown -h $user.$user libjemalloc.so >/dev/null 2>&1
# softlink for libperl.sp, used by cplogger # softlink for libperl.sp, used by cplogger
sudo ln -s /usr/lib64/perl5/CORE/libperl.so /usr/lib64/libperl.so >/dev/null 2>&1 sudo ln -s /usr/lib64/perl5/CORE/libperl.so /usr/lib64/libperl.so >/dev/null 2>&1

View File

@@ -1,29 +0,0 @@
# Copyright (C) 2014 InfiniDB, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of
# the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
test:
coverage:
leakcheck:
docs:
bootstrap: install-data-am
mkdir -p $(libdir)
$(install_sh) libjemalloc.so.3.3.0 $(libdir)

Binary file not shown.

Binary file not shown.

View File

@@ -1,3 +0,0 @@
This is a build of jemalloc version 3.3.0 with CFLAGS="-O3 -g0", using all
other defaults at configure.