GreatSQL社区

搜索

[已解决] GreatSQL发布Rapid引擎(Rapid Engine),TPC-H 100G不到80秒,牛~

1620 13 2024-2-4 10:27
全部回复(13)
mlovewt 2024-3-4 10:00:18
yejr 发表于 2024-3-1 21:00
请详细描述你编译的过程

  1. #!/bin/bash
  2. MAJOR_VERSION=8
  3. MINOR_VERSION=0
  4. PATCH_VERSION=32
  5. RELEASE=25
  6. REVISION=db07cc5cb73
  7. GLIBC=`ldd --version | head -n 1 | awk '{print $NF}'`
  8. ARCH=`uname -p`
  9. OS=`grep '^ID=' /etc/os-release | sed 's/.*"\(.*\)".*/\1/ig'`
  10. #OS=Linux
  11. PKG_NAME=GreatSQL-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${RELEASE}-${OS}-glibc${GLIBC}-${ARCH}
  12. # 修改安装目录
  13. BASE_DIR=/usr/local/mysql
  14. BOOST_VERSION=1_77_0
  15. MAKELOG=/tmp/greatsql-automake.log
  16. #使用原来的源代码目录
  17. SOURCE_DIR=greatsql-8.0.32-24
  18. CMAKE_EXE_LINKER_FLAGS=""
  19. JOBS=`lscpu | grep '^CPU(s)'|awk '{print $NF}'`
  20. if [ ${JOBS} -ge 16 ] ; then
  21.   JOBS=`expr ${JOBS} - 4`
  22. else
  23.   JOBS=`expr ${JOBS} - 2`
  24. fi

  25. if [ ${ARCH} = "x86_64" ] ; then
  26.   CMAKE_EXE_LINKER_FLAGS=" -ljemalloc "
  27. fi

  28. if [ ${ARCH} = "loongarch64" ] ; then
  29.   cd /opt/${SOURCE_DIR}
  30.   sed -i 's/\(.*defined.*mips.*\) \\/\1 defined(__loongarch__) || \\/ig' extra/icu/source/i18n/double-conversion-utils.h
  31. fi


  32. LIBLIST="libcrypto.so libssl.so libreadline.so libtinfo.so libsasl2.so libbrotlidec.so libbrotlicommon.so libgssapi_krb5.so libkrb5.so libkrb5support.so libk5crypto.so librtmp.so libgssapi.so libssl3.so libsmime3.so libnss3.so libnssutil3.so libplc4.so libnspr4.so libssl3.so libplds4.so libncurses.so libjemalloc.so"
  33. DIRLIST="bin lib lib/private lib/plugin lib/mysqlrouter/plugin lib/mysqlrouter/private"

  34. LIBPATH=""

  35. function gather_libs {
  36.     local elf_path=$1
  37.     for lib in ${LIBLIST}; do
  38.         for elf in $(find ${elf_path} -maxdepth 1 -exec file {} \; | grep 'ELF ' | cut -d':' -f1); do
  39.             IFS=$'\n'
  40.             for libfromelf in $(ldd ${elf} | grep ${lib} | awk '{print $3}'); do
  41.                 lib_realpath="$(readlink -f ${libfromelf})"
  42.                 lib_realpath_basename="$(basename $(readlink -f ${libfromelf}))"
  43.                 lib_without_version_suffix=$(echo ${lib_realpath_basename} | awk -F"." 'BEGIN { OFS = "." }{ print $1, $2}')

  44.                 # Some libraries may have dependencies on earlier openssl libraries, such as authentication_ldap_simple.so,
  45.                 # thus we need to treat them specially here, other than stripping version suffix.
  46.                 if [[ "${lib_realpath_basename}" =~ ^libcrypto.so.1.0.* ]] || [[ "${lib_realpath_basename}" =~ ^libssl.so.1.0.* ]];
  47.                 then
  48.                   lib_without_version_suffix=$(basename ${libfromelf})
  49.                 fi


  50.                 if [ ! -f "lib/private/${lib_realpath_basename}" ] && [ ! -L "lib/private/${lib_realpath_basename}" ]; then

  51.                     echo "Copying lib ${lib_realpath_basename}"
  52.                     cp ${lib_realpath} lib/private

  53.                     echo "Symlinking lib from ${lib_realpath_basename} to ${lib_without_version_suffix}"
  54.                     cd lib/
  55.                     ln -s private/${lib_realpath_basename} ${lib_without_version_suffix}
  56.                     cd -
  57.                     if [ ${lib_realpath_basename} != ${lib_without_version_suffix} ]; then
  58.                         cd lib/private
  59.                         ln -s ${lib_realpath_basename} ${lib_without_version_suffix}
  60.                         cd -
  61.                     fi

  62.                     patchelf --set-soname ${lib_without_version_suffix} lib/private/${lib_realpath_basename}

  63.                     LIBPATH+=" $(echo ${libfromelf} | grep -v $(pwd))"
  64.                 fi
  65.             done
  66.             unset IFS
  67.         done
  68.     done
  69. }

  70. function set_runpath {
  71.     # Set proper runpath for bins but check before doing anything
  72.     local elf_path=$1
  73.     local r_path=$2
  74.     for elf in $(find ${elf_path} -maxdepth 1 -exec file {} \; | grep 'ELF ' | cut -d':' -f1); do
  75.         echo "Checking LD_RUNPATH for ${elf}"
  76.         if [[ -z $(patchelf --print-rpath ${elf}) ]]; then
  77.             echo "Changing RUNPATH for ${elf}"
  78.             patchelf --set-rpath ${r_path} ${elf}
  79.         fi
  80.         if [[ ! -z "${override}" ]] && [[ "${override}" == "true" ]]; then
  81.             echo "Overriding RUNPATH for ${elf}"
  82.             patchelf --set-rpath ${r_path} ${elf}
  83.         fi
  84.     done
  85. }

  86. function replace_libs {
  87.     local elf_path=$1
  88.     for libpath_sorted in ${LIBPATH}; do
  89.         for elf in $(find ${elf_path} -maxdepth 1 -exec file {} \; | grep 'ELF ' | cut -d':' -f1); do
  90.             LDD=$(ldd ${elf} | grep ${libpath_sorted}|head -n1|awk '{print $1}')
  91.             lib_realpath_basename="$(basename $(readlink -f ${libpath_sorted}))"
  92.             lib_without_version_suffix="$(echo ${lib_realpath_basename} | awk -F"." 'BEGIN { OFS = "." }{ print $1, $2}')"
  93.             if [[ ! -z $LDD  ]] && [[ "${minimal}" == "false" ]]; then
  94.                 echo "Replacing lib ${lib_realpath_basename} to ${lib_without_version_suffix} for ${elf}"
  95.                 patchelf --replace-needed ${LDD} ${lib_without_version_suffix} ${elf}
  96.             fi
  97.         done
  98.     done
  99. }

  100. function check_libs {
  101.     local elf_path=$1
  102.     for elf in $(find ${elf_path} -maxdepth 1 -exec file {} \; | grep 'ELF ' | cut -d':' -f1); do
  103.         if ! ldd ${elf}; then
  104.             exit 1
  105.         fi
  106.     done
  107. }

  108. function link {
  109.     if [ ! -d lib/private ]; then
  110.         mkdir -p lib/private
  111.     fi
  112.     # Gather libs
  113.     for DIR in ${DIRLIST}; do
  114.         gather_libs ${DIR}
  115.     done
  116.     # Set proper runpath
  117.     export override=false
  118.     set_runpath bin '$ORIGIN/../lib/private/'
  119.     set_runpath lib '$ORIGIN/private/'
  120.     set_runpath lib/plugin '$ORIGIN/../private/'
  121.     set_runpath lib/private '$ORIGIN'
  122.     # LIBS MYSQLROUTER
  123.     unset override && export override=true && set_runpath lib/mysqlrouter/plugin '$ORIGIN/:$ORIGIN/../private/:$ORIGIN/../../private/'
  124.     unset override && export override=true && set_runpath lib/mysqlrouter/private '$ORIGIN/:$ORIGIN/../plugin/:$ORIGIN/../../private/'
  125.     #  BINS MYSQLROUTER
  126.     unset override && export override=true && set_runpath bin/mysqlrouter_passwd '$ORIGIN/../lib/mysqlrouter/private/:$ORIGIN/../lib/mysqlrouter/plugin/:$ORIGIN/../lib/private/'
  127.     unset override && export override=true && set_runpath bin/mysqlrouter_plugin_info '$ORIGIN/../lib/mysqlrouter/private/:$ORIGIN/../lib/mysqlrouter/plugin/:$ORIGIN/../lib/private/'
  128.     unset override && export override=true && set_runpath bin/mysqlrouter '$ORIGIN/../lib/mysqlrouter/private/:$ORIGIN/../lib/mysqlrouter/plugin/:$ORIGIN/../lib/private/'
  129.     unset override && export override=true && set_runpath bin/mysqlrouter_keyring '$ORIGIN/../lib/mysqlrouter/private/:$ORIGIN/../lib/mysqlrouter/plugin/:$ORIGIN/../lib/private/'
  130.     # Replace libs
  131.     for DIR in ${DIRLIST}; do
  132.         replace_libs ${DIR}
  133.     done
  134.     # Make final check in order to determine any error after linkage
  135.     for DIR in ${DIRLIST}; do
  136.         check_libs ${DIR}
  137.     done
  138. }

  139. rm -fr ${MAKELOG}

  140. cd /opt/${SOURCE_DIR} && \
  141. rm -fr bld && \
  142. mkdir bld && \
  143. cd bld && \
  144. cmake .. -DBOOST_INCLUDE_DIR=/opt/boost_${BOOST_VERSION} \
  145. -DLOCAL_BOOST_DIR=/opt/boost_${BOOST_VERSION} \
  146. -DCMAKE_INSTALL_PREFIX=${BASE_DIR} -DWITH_ZLIB=bundled \
  147. -DWITH_NUMA=ON -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \
  148. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release \
  149. -DWITH_TOKUDB=OFF -DWITH_ROCKSDB=OFF \
  150. -DROCKSDB_DISABLE_AVX2=1 \
  151. -DROCKSDB_DISABLE_MARCH_NATIVE=1 \
  152. -DGROUP_REPLICATION_WITH_ROCKSDB=OFF \
  153. -DALLOW_NO_SSE42=ON \
  154. -DMYSQL_MAINTAINER_MODE=OFF \
  155. -DFORCE_INSOURCE_BUILD=1 \
  156. -DCOMPILATION_COMMENT="GreatSQL, Release ${RELEASE}, Revision ${REVISION}" \
  157. -DMAJOR_VERSION=${MAJOR_VERSION} -DMINOR_VERSION=${MINOR_VERSION} -DPATCH_VERSION=${PATCH_VERSION} \
  158. -DWITH_NDB=OFF -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DWITH_NDBCLUSTER=OFF \
  159. -DWITH_UNIT_TESTS=OFF -DWITH_SSL=system -DWITH_SYSTEMD=ON \
  160. -DWITH_AUTHENTICATION_LDAP=OFF \
  161. -DWITH_PAM=1 \
  162. -DWITH_LIBEVENT=bundled \
  163. -DWITH_LDAP=system \
  164. -DWITH_SYSTEM_LIBS=ON \
  165. -DWITH_LZ4=bundled \
  166. -DWITH_PROTOBUF=bundled \
  167. -DWITH_RAPIDJSON=bundled \
  168. -DWITH_ICU=bundled \
  169. -DWITH_READLINE=system \
  170. -DWITH_ZSTD=bundled \
  171. -DWITH_FIDO=bundled \
  172. -DWITH_KEYRING_VAULT=ON \
  173. >> ${MAKELOG} 2>&1 && make -j${JOBS} >> ${MAKELOG} 2>&1 && make -j${JOBS} install >> ${MAKELOG} 2>&1

  174. rm -fr ${BASE_DIR}/mysql-test 2 > /dev/null

  175. # strip binaries to get minimal package
  176. minimal=true
  177. echo "minimal = ${minimal}" >> ${MAKELOG} 2>&1
  178. echo "link ${BASE_DIR}-minimal" >> ${MAKELOG} 2>&1
  179. (
  180.   cp -rp ${BASE_DIR} ${BASE_DIR}-minimal
  181.   cd ${BASE_DIR}-minimal
  182.   find . -type f -exec file '{}' \; | grep ': ELF ' | cut -d':' -f1 | xargs strip --strip-unneeded
  183.   link >> ${MAKELOG} 2>&1
  184. )
  185. #如果要打包压缩,就把下面两行注释去掉
  186. tar -cf ${BASE_DIR}-minimal.tar ${BASE_DIR}-minimal
  187. xz -9 -f -T${JOBS} ${BASE_DIR}-minimal.tar ${BASE_DIR}-minimal

  188. minimal=false
  189. (
  190.   cd ${BASE_DIR}
  191.   link >> ${MAKELOG} 2>&1
  192. )
  193. #如果要打包压缩,就把下面两行注释去掉
  194. tar -cf ${BASE_DIR}.tar ${BASE_DIR}
  195. xz -9 -f -T${JOBS} ${BASE_DIR}.tar.xz ${BASE_DIR}
复制代码
yejr 2024-3-4 11:25:27

您好,我需要的是详细编译过程,包括这个过程中产生的日志,不只是编译脚本。
mlovewt 2024-3-4 15:10:46
yejr 发表于 2024-3-4 11:25
您好,我需要的是详细编译过程,包括这个过程中产生的日志,不只是编译脚本。 ...

编译日志,和dockerfile,docker镜像是以前做的,没有重新构建。

greatsql-automake.zip

297.92 KB, 下载次数: 2, 下载积分: 金币 -1

编译文件

Dockerfile.zip

1.22 KB, 下载次数: 0, 下载积分: 金币 -1

dockerfile

yejr 2024-3-4 17:56:02
mlovewt 发表于 2024-3-4 15:10
编译日志,和dockerfile,docker镜像是以前做的,没有重新构建。

看了日志,您的编译环境有确实的依赖包未安装
  1. CMake Warning at cmake/fido2.cmake:70 (MESSAGE):
  2.   Cannot find development libraries.  You need to install the required
  3.   packages:

  4.     Debian/Ubuntu:              apt install libudev-dev
  5.     RedHat/Fedora/Oracle Linux: yum install libudev-devel
  6.     SuSE:                       zypper install libudev-devel
复制代码


建议使用我们提供的GreatSQL-Build Docker镜像,详情参考 https://gitee.com/GreatSQL/Great ... ster/GreatSQL-Build
12

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-11-23 19:52 , Processed in 0.017079 second(s), 11 queries , Redis On.
快速回复 返回顶部 返回列表