Doris-1.4.2 Linux 直接编译问题记录
官方文档:直接编译-centos-ubuntu
我是在 AWS 上的 EC2 进行的部署,本文主要记录按官方文档操作直接编译过程中遇到的问题,方便查询。
EC2 实例选择
不要太抠,我就是太抠,选了最便宜最小的测试,1核1G内存,8G 硬盘,不够用。
升到2核8G内存,24G 硬盘才完成编译,1G内存会报错提示:virtual memory exhausted: Cannot allocate memory。
flex 版本太低,需要大于2.6.0
[ec2-user ~] wget https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz
[ec2-user ~] tar -xvf flex-2.6.4.tar.gz
[ec2-user ~] cd flex-2.6.4
[ec2-user flex-2.6.4] ./configure
[ec2-user flex-2.6.4] make
[ec2-user flex-2.6.4] make install
flex 软件包来源:Linux From Scratch - 版本 11.0-中文翻译版
配置 JAVA_HOME 环境变量
cmake 版本太低,安装 cmake 提示找不到 openssl
cmake 安装参考问题1 flex版本更新,软件包来源:CMake
gmake: `cmake' is up to date.
loading initial cache file /home/ec2-user/cmake-3.22.1/Bootstrap.cmk/InitialCacheFlags.cmake
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
CMake Error at Utilities/cmcurl/CMakeLists.txt:562 (message):
Could not find OpenSSL. Install an OpenSSL development package or
configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.
解决办法:
yum install -y openssl openssl-devel
提示错误:fatal error: sasl/sasl.h: No such file or directory
详细提示如下;
###########################################################
### Configure failed ###
###########################################################
### Accumulated failures: ###
###########################################################
libsasl2 (WITH_SASL_CYRUS)
module: self
action: fail
reason:
compile check failed:
CC: CC
flags: -lsasl2
/usr/bin/../bin/gcc -fPIC -I/home/ec2-user/incubator-doris/thirdparty/installed/include -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -Wall -Werror _mkltmpDG8OLw.c -o _mkltmpDG8OLw.c.o -L/home/ec2-user/incubator-doris/thirdparty/installed/lib -lsasl2:
_mkltmpDG8OLw.c:3:10: fatal error: sasl/sasl.h: No such file or directory
#include <sasl/sasl.h>
^~~~~~~~~~~~~
compilation terminated.
source:
#include <stddef.h>
#include <sasl/sasl.h>
libsasl (WITH_SASL_CYRUS)
module: self
action: fail
reason:
compile check failed:
CC: CC
flags: -lsasl
/usr/bin/../bin/gcc -fPIC -I/home/ec2-user/incubator-doris/thirdparty/installed/include -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -Wall -Werror _mkltmpx7M6e0.c -o _mkltmpx7M6e0.c.o -L/home/ec2-user/incubator-doris/thirdparty/installed/lib -lsasl:
_mkltmpx7M6e0.c:3:10: fatal error: sasl/sasl.h: No such file or directory
#include <sasl/sasl.h>
^~~~~~~~~~~~~
compilation terminated.
source:
#include <stddef.h>
#include <sasl/sasl.h>
解决办法
yum -y install cyrus-sasl cyrus-sasl-devel cyrus-sasl-lib
sudo yum install centos-release-scl 找不到
解决办法
rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl-rh/2/3.el7.centos/noarch/centos-release-scl-rh-2-3.el7.centos.noarch.rpm
rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl/2/3.el7.centos/noarch/centos-release-scl-2-3.el7.centos.noarch.rpm
sudo yum install devtoolset-10 依赖 libgfortran5 缺失
解决办法:
rpm -ivh http://mirror.centos.org/centos/7/os/x86_64/Packages/libgfortran5-8.3.1-2.1.1.el7.x86_64.rpm
sudo yum install devtoolset-10 报错:GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle"
wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle