diff --git a/CMakeLists.txt b/CMakeLists.txt index 001701b6a..74805c282 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/FindJeMalloc.cmake b/FindJeMalloc.cmake new file mode 100644 index 000000000..c97bb1b9f --- /dev/null +++ b/FindJeMalloc.cmake @@ -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 +) diff --git a/build/columnstore.community.spec.in b/build/columnstore.community.spec.in index ad80b46c7..e53017618 100644 --- a/build/columnstore.community.spec.in +++ b/build/columnstore.community.spec.in @@ -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 diff --git a/build/columnstore.spec.in b/build/columnstore.spec.in index 9f87c6749..f43f54718 100644 --- a/build/columnstore.spec.in +++ b/build/columnstore.spec.in @@ -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 diff --git a/build/nightly-mini-tester.sh b/build/nightly-mini-tester.sh index d245d5bc3..a9ae28d29 100755 --- a/build/nightly-mini-tester.sh +++ b/build/nightly-mini-tester.sh @@ -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 diff --git a/build/src-build b/build/src-build index d5470d301..eea71f8cc 100755 --- a/build/src-build +++ b/build/src-build @@ -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" diff --git a/oam/install_scripts/columnstore b/oam/install_scripts/columnstore index e1638246a..c346e3eb0 100644 --- a/oam/install_scripts/columnstore +++ b/oam/install_scripts/columnstore @@ -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` diff --git a/oam/install_scripts/infinidb b/oam/install_scripts/infinidb index a371dadf8..fb1f952e3 100644 --- a/oam/install_scripts/infinidb +++ b/oam/install_scripts/infinidb @@ -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` diff --git a/oam/install_scripts/post-install b/oam/install_scripts/post-install index 6be7d1f2d..847246d7b 100755 --- a/oam/install_scripts/post-install +++ b/oam/install_scripts/post-install @@ -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 diff --git a/utils/jemalloc/Makefile.am b/utils/jemalloc/Makefile.am deleted file mode 100644 index f837201b5..000000000 --- a/utils/jemalloc/Makefile.am +++ /dev/null @@ -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) - diff --git a/utils/jemalloc/jemalloc-3.3.0.tar.gz b/utils/jemalloc/jemalloc-3.3.0.tar.gz deleted file mode 100644 index 526f5b623..000000000 Binary files a/utils/jemalloc/jemalloc-3.3.0.tar.gz and /dev/null differ diff --git a/utils/jemalloc/libjemalloc.so.3.3.0 b/utils/jemalloc/libjemalloc.so.3.3.0 deleted file mode 100755 index 9136fc445..000000000 Binary files a/utils/jemalloc/libjemalloc.so.3.3.0 and /dev/null differ diff --git a/utils/jemalloc/readme.txt b/utils/jemalloc/readme.txt deleted file mode 100644 index 939dfd6a3..000000000 --- a/utils/jemalloc/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -This is a build of jemalloc version 3.3.0 with CFLAGS="-O3 -g0", using all -other defaults at configure. -