GreatSQL社区

搜索

[已解决] 是否可以提供基于openssl1.1.1版本的编译二进制包

687 4 2023-9-21 15:12
是否可以提供基于openssl1.1.1版本的编译二进制包,或者提供一个centos7中使用openssl1.1.1的编译方案也可以。我现在使用下面的方案进行编译没有通过。



  1. FROM centos:7
  2. ENV LANG en_US.utf8

  3. RUN yum install -y epel-release && \
  4. curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo && \
  5. yum clean all && \
  6. yum makecache
  7. RUN yum install -y yum-utils && \

  8. RUN yum install -y --skip-broken yum-utils wget diffutils net-tools vim git gcc gcc-c++ automake libtool cmake cmake3 \
  9. make psmisc   zlib-devel readline-devel bzip2-devel expat-devel  \
  10. bison  flex wget unzip libcurl-devel libevent-devel libffi-devel lz4-devel \
  11. file clang bzip2 libxml2-devel libtirpc libtirpc-devel numactl-devel numactl-libs \
  12. numactl openldap-devel openldap-clients pam-devel valgrind boost-devel \
  13. libzstd libzstd-devel patchelf perl perl-Env perl-JSON perl-Memoize perl-Time-HiRes time libaio-devel libarchive \
  14. ncurses-devel ncurses-libs pam redhat-lsb-core scl-utils-build pkg-config ccache \
  15. jemalloc jemalloc-devel libicu-devel re2-devel redhat-lsb-core rpm* tar libssh \
  16. cyrus-sasl-devel cyrus-sasl-scram

  17. #RUN dnf install -y dnf
  18. RUN dnf install -y gcc-toolset-11 gcc-toolset-11-annobin-plugin-gcc && source /opt/rh/gcc-toolset-11/enable
  19. RUN echo 'source /opt/rh/gcc-toolset-11/enable' >> /root/.bash_profile


  20. #git, https://github.com/git/git/archive/v2.27.0.tar.gz, 下载后重命名为 git-v2.27.0.tar.gz
  21. COPY git-v2.27.0.tar.gz /tmp/
  22. RUN cd /tmp/ && tar -xzvf git-v2.27.0.tar.gz && cd git-2.27.0 && make prefix=/opt/git/ all && make prefix=/opt/git/ install
  23. RUN mv /usr/bin/git /usr/bin/git.bk && ln -s /opt/git/bin/git /usr/bin/git

  24. #patchelf, https://github.com/NixOS/patchelf/archive/refs/tags/0.12.tar.gz, 下载后重命名为 patchelf-0.12.tar.gz
  25. #如果编译过程报错,再手动打补丁 https://github.com/NixOS/patchelf/pull/275/files
  26. COPY patchelf-0.12.tar.gz /tmp/
  27. RUN cd /tmp && tar -xzvf patchelf-0.12.tar.gz && cd patchelf-0.12 && ./bootstrap.sh && ./configure && make && make install

  28. #rpcsvc-proto, https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto-1.4.tar.gz
  29. COPY rpcsvc-proto-1.4.tar.gz /tmp/rpcsvc-proto-1.4.tar.gz
  30. RUN tar zxvf /tmp/rpcsvc-proto-1.4.tar.gz -C /tmp && cd /tmp/rpcsvc-proto-1.4/ && ./configure && make && make install

  31. RUN rm -fr /tmp/*

  32. COPY openssl-1.1.1v.tar.gz /tmp/openssl-1.1.1v.tar.gz

  33. RUN tar zxvf /tmp/openssl-1.1.1v.tar.gz -C /tmp && cd /tmp/openssl-1.1.1v/ && ./config --prefix=/usr/local/openssl -d shared  -fPIC && make -j 4 && make install &&echo '/usr/local/openssl/lib' >> /etc/ld.so.conf &&ldconfig -v

  34. RUN rm -fr /tmp/*


  35. #boost, https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz
  36. COPY boost_1_73_0.tar.gz /opt/

  37. RUN ln -fs /usr/bin/cmake3 /usr/bin/cmake


复制代码

  1. #!/bin/bash
  2. MAJOR_VERSION=8
  3. MINOR_VERSION=0
  4. PATCH_VERSION=32
  5. RELEASE=24
  6. REVISION=3714067bc8c
  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. BASE_DIR=/usr/local/mysql
  13. BOOST_VERSION=1_77_0
  14. SOURCE_DIR=greatsql-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${RELEASE}
  15. CMAKE_EXE_LINKER_FLAGS=""
  16. JOBS=`lscpu | grep '^CPU(s)'|awk '{print $NF}'`
  17. if [ ${JOBS} -ge 16 ] ; then
  18.   JOBS=`expr ${JOBS} - 4`
  19. else
  20.   JOBS=`expr ${JOBS} - 1`
  21. fi


  22. if [ ${ARCH} = "x86_64" ] ; then
  23.   CMAKE_EXE_LINKER_FLAGS=" -ljemalloc "
  24. fi

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




  29. cd /opt/${SOURCE_DIR} && \
  30. rm -fr bld && \
  31. mkdir bld && \
  32. cd bld && \


  33. cmake .. -DBOOST_INCLUDE_DIR=/opt/boost_${BOOST_VERSION} \
  34. -DLOCAL_BOOST_DIR=/opt/boost_${BOOST_VERSION} \
  35. -DCMAKE_INSTALL_PREFIX=${BASE_DIR} -DWITH_ZLIB=bundled \
  36. -DWITH_NUMA=ON -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \
  37. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release \
  38. -DOPENSSL_ROOT_DIR=/usr/local/openssl -DOPENSSL_LIBRARIES=/usr/local/openssl/lib  -DOPENSSL_CRYPTO_LIBRARY=/usr/local/openssl/lib -DOPENSSL_INCLUDE_DIR=/usr/local/openssl/include \
  39. -DWITH_SSL=/usr/local/openssl \
  40. -DWITH_LIBEVENT=bundled \
  41. -DWITH_TOKUDB=OFF -DWITH_ROCKSDB=OFF \
  42. -DCOMPILATION_COMMENT="${MYSQL} GreatSQL, Release ${RELEASE}, Revision ${REVISION}" \
  43. -DMAJOR_VERSION=${MAJOR_VERSION} -DMINOR_VERSION=${MINOR_VERSION} -DPATCH_VERSION=${PATCH_VERSION} \
  44. -DWITH_NDB=OFF -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DWITH_NDBCLUSTER=OFF \
  45. -DWITH_UNIT_TESTS=OFF  -DWITH_SYSTEMD=ON \
  46. >> /tmp/greatsql-automake.log 2>&1 && make -j${JOBS} >> /tmp/greatsql-automake.log 2>&1 && make -j${JOBS} install >> /tmp/greatsql-automake.log 2>&1
复制代码


编译日志.zip

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

全部回复(4)
yejr 2023-9-21 17:18:44
我看 greatsql-automake.log 日志中提示:
  1. -- OPENSSL_VERSION (system) is 1.00.02
  2. -- The openssl command does not support zlib
  3. -- OPENSSL_INCLUDE_DIR = /usr/local/openssl/include
  4. -- OPENSSL_LIBRARY = /usr/local/openssl/lib/libssl.so
  5. -- CRYPTO_LIBRARY = /usr/local/openssl/lib/libcrypto.so
  6. -- OPENSSL_LIB_DIR =
  7. -- OPENSSL_VERSION_MAJOR = 1
  8. -- OPENSSL_VERSION_MINOR = 00
  9. -- OPENSSL_FIX_VERSION = 02
  10. -- Looking for SHA512_DIGEST_LENGTH
  11. -- Looking for SHA512_DIGEST_LENGTH - found
  12. -- SSL_LIBRARIES = /usr/local/openssl/lib/libssl.so;/usr/local/openssl/lib/libcrypto.so;dl
  13. ...
  14. -- Found OpenSSL: /usr/local/openssl/lib (found version "1.0.2k")  
复制代码


看起来似乎并没有指定正确的openssl版本。

建议直接升级OS层的openssl版本,然后还按标准方式编译应该就可以。
yejr 2023-9-21 17:19:54
yejr 发表于 2023-9-21 17:18
我看 greatsql-automake.log 日志中提示:

也就是说,把新版本的openssl直接替换覆盖OS原来的openssl版本,而不是安装到/usr/local/openssl目录下。
mlovewt 2023-9-26 09:23:20
是用下面的dockfile 和构建脚本可以构建centos7 openssl1.1.1 的greatsql8.0.32
  1. FROM centos:7
  2. ENV LANG en_US.utf8

  3. RUN yum install -y epel-release && \
  4. curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo && \
  5. yum clean all && \
  6. yum makecache
  7. RUN yum install -y yum-utils && \

  8. RUN yum install -y --skip-broken yum-utils wget diffutils net-tools vim git gcc gcc-c++ automake libtool cmake cmake3 \
  9. make psmisc   zlib-devel readline-devel bzip2-devel expat-devel  \
  10. bison  flex wget unzip libcurl-devel libevent-devel libffi-devel lz4-devel \
  11. file clang bzip2 libxml2-devel libtirpc libtirpc-devel numactl-devel numactl-libs \
  12. numactl openldap-devel openldap-clients pam-devel valgrind boost-devel \
  13. libzstd libzstd-devel patchelf perl perl-Env perl-JSON perl-Memoize perl-Time-HiRes time libaio-devel libarchive \
  14. ncurses-devel ncurses-libs pam redhat-lsb-core scl-utils-build pkg-config ccache \
  15. jemalloc jemalloc-devel libicu-devel re2-devel redhat-lsb-core rpm* tar libssh \
  16. cyrus-sasl-devel cyrus-sasl-scram

  17. #RUN dnf install -y dnf
  18. RUN dnf install -y gcc-toolset-11 gcc-toolset-11-annobin-plugin-gcc && source /opt/rh/gcc-toolset-11/enable
  19. RUN echo 'source /opt/rh/gcc-toolset-11/enable' >> /root/.bash_profile


  20. #git, https://github.com/git/git/archive/v2.27.0.tar.gz, 下载后重命名为 git-v2.27.0.tar.gz
  21. COPY git-v2.27.0.tar.gz /tmp/
  22. RUN cd /tmp/ && tar -xzvf git-v2.27.0.tar.gz && cd git-2.27.0 && make prefix=/opt/git/ all && make prefix=/opt/git/ install
  23. RUN mv /usr/bin/git /usr/bin/git.bk && ln -s /opt/git/bin/git /usr/bin/git

  24. #patchelf, https://github.com/NixOS/patchelf/archive/refs/tags/0.12.tar.gz, 下载后重命名为 patchelf-0.12.tar.gz
  25. #如果编译过程报错,再手动打补丁 https://github.com/NixOS/patchelf/pull/275/files
  26. COPY patchelf-0.12.tar.gz /tmp/
  27. RUN cd /tmp && tar -xzvf patchelf-0.12.tar.gz && cd patchelf-0.12 && ./bootstrap.sh && ./configure && make && make install

  28. #rpcsvc-proto, https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto-1.4.tar.gz
  29. COPY rpcsvc-proto-1.4.tar.gz /tmp/rpcsvc-proto-1.4.tar.gz
  30. RUN tar zxvf /tmp/rpcsvc-proto-1.4.tar.gz -C /tmp && cd /tmp/rpcsvc-proto-1.4/ && ./configure && make && make install

  31. RUN rm -fr /tmp/*

  32. COPY openssl-1.1.1w.tar.gz /tmp/openssl-1.1.1w.tar.gz

  33. RUN tar zxvf /tmp/openssl-1.1.1w.tar.gz -C /tmp && cd /tmp/openssl-1.1.1w/ && ./config && make -j 8 && make install  &&ldconfig -v

  34. RUN rm -fr /tmp/*


  35. #boost, https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz
  36. COPY boost_1_77_0.tar.gz /opt/
  37. RUN tar zxvf /opt/boost_1_77_0.tar.gz -C /opt

  38. RUN ln -fs /usr/bin/cmake3 /usr/bin/cmake


复制代码



  1. #!/bin/bash
  2. MAJOR_VERSION=8
  3. MINOR_VERSION=0
  4. PATCH_VERSION=32
  5. RELEASE=24
  6. REVISION=3714067bc8c
  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. BASE_DIR=/usr/local/mysql
  13. BOOST_VERSION=1_77_0
  14. SOURCE_DIR=greatsql-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${RELEASE}
  15. CMAKE_EXE_LINKER_FLAGS=""
  16. JOBS=`lscpu | grep '^CPU(s)'|awk '{print $NF}'`
  17. if [ ${JOBS} -ge 16 ] ; then
  18.   JOBS=`expr ${JOBS} - 4`
  19. else
  20.   JOBS=`expr ${JOBS} - 1`
  21. fi


  22. if [ ${ARCH} = "x86_64" ] ; then
  23.   CMAKE_EXE_LINKER_FLAGS=" -ljemalloc "
  24. fi

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




  29. cd /opt/${SOURCE_DIR} && \
  30. rm -fr bld && \
  31. mkdir bld && \
  32. cd bld && \


  33. cmake .. -DBOOST_INCLUDE_DIR=/opt/boost_${BOOST_VERSION} \
  34. -DLOCAL_BOOST_DIR=/opt/boost_${BOOST_VERSION} \
  35. -DCMAKE_INSTALL_PREFIX=${BASE_DIR} -DWITH_ZLIB=bundled \
  36. -DWITH_NUMA=ON -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \
  37. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release \
  38. -DWITH_LIBEVENT=bundled \
  39. -DWITH_TOKUDB=OFF -DWITH_ROCKSDB=OFF \
  40. -DCOMPILATION_COMMENT="${MYSQL} GreatSQL, Release ${RELEASE}, Revision ${REVISION}" \
  41. -DMAJOR_VERSION=${MAJOR_VERSION} -DMINOR_VERSION=${MINOR_VERSION} -DPATCH_VERSION=${PATCH_VERSION} \
  42. -DWITH_NDB=OFF -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DWITH_NDBCLUSTER=OFF \
  43. -DWITH_UNIT_TESTS=OFF  -DWITH_SYSTEMD=ON \
  44. -DWITH_AUTHENTICATION_CLIENT_PLUGINS=OFF \
  45. -DWITH_AUTHENTICATION_LDAP=OFF \
  46. -DWITH_SSL=system \
  47. >> /tmp/greatsql-automake.log 2>&1 && make -j${JOBS} >> /tmp/greatsql-automake.log 2>&1 && make -j${JOBS} install >> /tmp/greatsql-automake.log 2>&1
复制代码
yejr 2023-9-26 11:12:44
mlovewt 发表于 2023-9-26 09:23
是用下面的dockfile 和构建脚本可以构建centos7 openssl1.1.1 的greatsql8.0.32

感谢分享,手动点赞
mlovewt

5

主题

0

博客

25

贡献

新手上路

Rank: 1

积分
41

助人为乐(铜)

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

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