From dadefb355c048b226d6ded363ba96dad020027ed Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sat, 25 Aug 2018 16:42:06 +0200 Subject: [PATCH] Using jemalloc --- .gitmodules | 3 ++ .idea/workspace.xml | 22 ++++++++----- Jenkinsfile | 4 +-- TeaSpeak | 2 +- cmake-build-debug/CMakeFiles/clion-log.txt | 1 + libraries/CXXTerminal | 2 +- libraries/build.sh | 4 ++- libraries/build_jemalloc.sh | 38 ++++++++++++++++++++++ libraries/jemalloc | 1 + 9 files changed, 63 insertions(+), 14 deletions(-) create mode 100644 cmake-build-debug/CMakeFiles/clion-log.txt create mode 100755 libraries/build_jemalloc.sh create mode 160000 libraries/jemalloc diff --git a/.gitmodules b/.gitmodules index e0a30ab..9699d6b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -56,3 +56,6 @@ [submodule "libraries/DataPipes"] path = libraries/DataPipes url = https://github.com/WolverinDEV/DataPipes.git +[submodule "libraries/jemalloc"] + path = libraries/jemalloc + url = https://github.com/jemalloc/jemalloc.git diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0037f43..1751f07 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -10,10 +10,13 @@ + + + - - + + - - + - - + + + + - - diff --git a/Jenkinsfile b/Jenkinsfile index 64fc439..2341ad9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { CMAKE_MAKE_OPTIONS = '-j 12' //Make specific flags - MAKE_OPTIONS = '' + MAKE_OPTIONS = '-j 12' } @@ -61,7 +61,7 @@ pipeline { CMAKE_MAKE_OPTIONS = '-j 12' //Make specific flags - MAKE_OPTIONS = '' + MAKE_OPTIONS = '-j 12' } diff --git a/TeaSpeak b/TeaSpeak index dc16b7d..c2cb037 160000 --- a/TeaSpeak +++ b/TeaSpeak @@ -1 +1 @@ -Subproject commit dc16b7d0fecfbc5ac2755b1657bf5d35611721f4 +Subproject commit c2cb037cbcfda5d4a5cfb0e42de489e2ef20f600 diff --git a/cmake-build-debug/CMakeFiles/clion-log.txt b/cmake-build-debug/CMakeFiles/clion-log.txt new file mode 100644 index 0000000..bb08bee --- /dev/null +++ b/cmake-build-debug/CMakeFiles/clion-log.txt @@ -0,0 +1 @@ +CMakeLists.txt not found in /home/wolverindev/TeaSpeak diff --git a/libraries/CXXTerminal b/libraries/CXXTerminal index e2d8def..d44e435 160000 --- a/libraries/CXXTerminal +++ b/libraries/CXXTerminal @@ -1 +1 @@ -Subproject commit e2d8def235184c77a82039e7d39a9bce0d824406 +Subproject commit d44e435f1ec8b130df5f9db2868e9abf94ddf9d2 diff --git a/libraries/build.sh b/libraries/build.sh index fa6a343..4a42b57 100755 --- a/libraries/build.sh +++ b/libraries/build.sh @@ -17,7 +17,8 @@ mkdir -p \ tomcrypt/build \ tommath/build \ yaml-cpp/build \ - protobuf/build + protobuf/build \ + jemalloc/build function exec_script { echo "Executing ${1}" @@ -43,3 +44,4 @@ exec_script build_stringvariable.sh exec_script build_threadpool.sh exec_script build_tom.sh exec_script build_yaml.sh +exec_script build_jemalloc.sh diff --git a/libraries/build_jemalloc.sh b/libraries/build_jemalloc.sh new file mode 100755 index 0000000..25d6b80 --- /dev/null +++ b/libraries/build_jemalloc.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +cd jemalloc/ + +if ! [ -f configure ]; then + autoconf + if [ $? -ne 0 || ! -f configure ]; then + echo "Failed to create configure file" + exit 1 + fi +fi + +cd build +../configure +if [ $? -ne 0 ]; then + echo "Failed to create makefile" + exit 1 +fi + +(cat Makefile | sed 's/.*$(CC) $(DSO_LDFLAGS) $(call RPATH,$(RPATH_EXTRA)) $(LDTARGET) $+ $(LDFLAGS) $(LIBS) $(EXTRA_LDFLAGS).*/ $(CXX) $(DSO_LDFLAGS) $(call RPATH,$(RPATH_EXTRA)) $(LDTARGET) $+ $(LDFLAGS) $(LIBS) $(EXTRA_LDFLAGS)/') > tmp +rm Makefile +mv tmp Makefile +make -j 12 LIBS="-pthread -static-libgcc -static-libstdc++ -fPIC" CFLAGS="-static-libgcc -static-libstdc++ -fPIC" CXXFLAGS="-static-libgcc -static-libstdc++ -fPIC" +#make -j 12 LIBS="-pthread -static-libgcc -static-libstdc++" CFLAGS="-fPIC" CXXFLAGS="-fPIC" +#make -j 12 LIBS="-pthread -lm -l/usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a" ${MAKE_OPTIONS} CFLAGS="-shared -static-libstdc++ -static-libgcc -fPIC" CXXFLAGS="-static-libstdc++ -static-libgcc -shared -fPIC" +if [ $? -ne 0 ]; then + echo "Failed to build jemalloc" + exit 1 +fi +sudo make install &>/dev/null +if [ $? -ne 0 ]; then #Workaround because the install fails + exit 0 +fi + + + + +make -j 12 LIBS="-pthread -static-libgcc -static-libstdc++" CFLAGS="-fPIC" CXXFLAGS="-fPIC" diff --git a/libraries/jemalloc b/libraries/jemalloc new file mode 160000 index 0000000..4c548a6 --- /dev/null +++ b/libraries/jemalloc @@ -0,0 +1 @@ +Subproject commit 4c548a61c89b0472b9952fcc4090eb00c2a88870