You've already forked mariadb-columnstore-engine
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:
@@ -75,6 +75,11 @@ if (NOT NETSNMP_FOUND)
|
||||
MESSAGE(FATAL_ERROR "Could not find net-snmp!")
|
||||
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")
|
||||
if(NOT AWK_EXECUTABLE)
|
||||
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_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_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})
|
||||
@@ -204,6 +209,4 @@ ADD_SUBDIRECTORY(writeengine/server)
|
||||
ADD_SUBDIRECTORY(writeengine/bulk)
|
||||
ADD_SUBDIRECTORY(writeengine/splitter)
|
||||
|
||||
INSTALL(PROGRAMS utils/jemalloc/libjemalloc.so.3.3.0 DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
||||
|
||||
INCLUDE(cpackEngineRPM.cmake)
|
||||
|
44
FindJeMalloc.cmake
Normal file
44
FindJeMalloc.cmake
Normal 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
|
||||
)
|
@@ -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/libquerystats.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/hdfs-20.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/libquerytele.so.1.0.0
|
||||
|
||||
|
@@ -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/libquerystats.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/hdfs-20.so
|
||||
/usr/local/mariadb/columnstore/lib/hdfs-12.so
|
||||
|
@@ -65,12 +65,6 @@ find ${prefix}/Calpont -type f | xargs chmod +r
|
||||
|
||||
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
|
||||
cp ${prefix}/Calpont/etc/Columnstore.xml.singleserver ${prefix}/Calpont/etc/Columnstore.xml.rpmsave
|
||||
fi
|
||||
|
@@ -130,7 +130,6 @@ if [ $? -ne 0 -o ! -x $prefix/Calpont/bin/PrimProc ]; then
|
||||
fi
|
||||
|
||||
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"
|
||||
|
||||
|
@@ -46,12 +46,6 @@ if [ -n "$plugin" ]; then
|
||||
. $InstallDir/bin/$setenv >/dev/null 2>&1
|
||||
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
|
||||
|
||||
mt=`module_type`
|
||||
|
@@ -46,12 +46,6 @@ if [ -n "$plugin" ]; then
|
||||
. $InstallDir/bin/$setenv >/dev/null 2>&1
|
||||
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
|
||||
|
||||
mt=`module_type`
|
||||
|
@@ -87,9 +87,6 @@ if [ -f libstdc++.so.6.0.14 ]; then
|
||||
chown -h $user.$user libstdc++.so.6 >/dev/null 2>&1
|
||||
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
|
||||
sudo ln -s /usr/lib64/perl5/CORE/libperl.so /usr/lib64/libperl.so >/dev/null 2>&1
|
||||
|
||||
|
@@ -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.
@@ -1,3 +0,0 @@
|
||||
This is a build of jemalloc version 3.3.0 with CFLAGS="-O3 -g0", using all
|
||||
other defaults at configure.
|
||||
|
Reference in New Issue
Block a user