doris has envolved many thirdparty components since v0.9. so the build progress has changed a lot since v0.9, in this article, I will demostrate the process about building doris v0.11.5 on centos 7. In the building process, I have encountered some issues, and thanks to the help of May who a key engineer of doris team, I solved them.

1. install dependencies which is required for build doris on local machine

sudo yum install gcc-c++ libstdc++-static ant cmake byacc flex automake libtool binutils-devel bison ncurses-devel  && \
sudo updatedb && \
sudo yum install redhat-lsb

2. download source from github

wget https://codeload.github.com/baidu-doris/incubator-doris/tar.gz/DORIS-0.11.5-alpha
tar -xzvf incubator-doris-DORIS-0.11.-alpha-src.tar.gz
cd incubator-doris-DORIS-0.11.-alpha-src

3. build third party components

the thirdparty components download is very slow, I have upload the thirdparty tarball onto pan.baidu.com, we can download it there to improve the process.

链接: https://pan.baidu.com/s/1kxW07GTh0Jx66f1AYfgPsw 提取码: b7ki, to use the tarball, just unzip it and move the contents into incubator-doris-DORIS-0.11.5-alpha-src/thirdparty/src folder.

cd thirdparty
sh build-thirdparty.sh

the thirdparty components reqiure GCC 5+ to build!  which has been changed since v0.8.2.1 to be compatible with ubuntu 18.04 to build doris, because the llvm component failed to build on ununtu 18.04, and the root cause is the glibc version on ununtu is higher than centos, so the doris team has made this change on centos( reqiure GCC 5+ to build the souce)

if you have installed gcc 5+ on centos, then the thirdparty components would build success. for install gcc 5+ on centos 7, please refere my previous post   in the section of 3. 安装GCC v5.2+

but there's another issue about build the source which I would refer below!!!

4. Build doris product source

4.1 build be source on centos 7

cd incubator-doris-DORIS-0.11.-alpha-src && sh build.sh  --be

In my build progess, I have encounted issues as follows:

/root/workspace/palo-0.11./be/src/olap/key_coder.cpp: In member function ‘void doris::KeyCoderResolver::add_mapping()’:
/root/workspace/palo-0.11./be/src/olap/key_coder.cpp::: error: ‘class std::unordered_map<doris::FieldType, doris::KeyCoder*>’ has no member named ‘emplace’
_coder_map.emplace(field_type, new KeyCoder(KeyCoderTraits<field_type>()));
^
make[]: *** [src/olap/CMakeFiles/Olap.dir/key_coder.cpp.o] Error
make[]: *** [src/olap/CMakeFiles/Olap.dir/all] Error
make[]: *** Waiting for unfinished jobs....
[ %] Building CXX object src/olap/rowset/CMakeFiles/Rowset.dir/rowset_id_generator.cpp.o
[ %] Building CXX object src/exec/CMakeFiles/Exec.dir/merge_join_node.cpp.o

the reason for this failure is: doris require GCC 7+ to build the product source even if the thirdparty components has build success!!! So the solution is to upgrade local GCC to version 7+, installing GCC 7+, please refer to my post centos7 gcc升级

since the thirdparty is build using GCC lower than 7, so you need to rebuild the thirdparth components,or else the product code would failed.

BTW, if you have seem the following error message during building product code:

[  %] Generating /workspace/palo-0.11./gensrc/build/geo/wkt_yacc.y.cpp, /root/workspace/palo-0.11./gensrc/build/geo/wkt_yacc.y.hpp
/root/workspace/palo-0.11./be/src/geo/wkt_yacc.y:56.20-: error: syntax error, unexpected {...}
make[]: *** [/root/workspace/palo-0.11./gensrc/build/geo/wkt_yacc.y.cpp] Error
make[]: *** [src/geo/CMakeFiles/Geo.dir/all] Error

it most likely the version issue caused by yacc,  the doris has changed the dependency of yacc into byacc, the soluton is to  install byacc as mentioned in section 1, then this issue would be resolved. this dependency is introduced since v0.11.

after upgrade GCC to version above 7.0+, you build for thirdparty component would encouter error like

[ %] Generating ../include/mysqld_error.h, ../sql/share/english/errmsg.sys
./comp_err: error while loading shared libraries: libatomic.so.: cannot open shared object file: No such file or directory
make[]: *** [include/mysqld_error.h] Error
make[]: *** [extra/CMakeFiles/GenError.dir/all] Error
make[]: *** [libmysql/CMakeFiles/mysqlclient.dir/rule] Error
make: *** [mysqlclient] Error

to resolve such error,

sudo cp /usr/local/lib64/libatomic.so.1.2. /usr/lib64
sudo cp /usr/local/lib64/libatomic.so.1.2. /usr/lib
sudo ldconfig

4.2 build source code on ununtu

if you are builing the source code on ununtu, since the default gcc version is v7.0+, so the gcc version is compatible for building doris, but there's another question about it:

[  %] Building CXX object src/env/CMakeFiles/Env.dir/env_posix.cpp.o
In file included from workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/env/env_posix.cpp:::
workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/env/env_posix.cpp: In function ‘doris::Status doris::do_readv_at(int, const string&, uint64_t, const doris::Slice*, size_t’:
workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/env/env_posix.cpp::: error: ‘preadv’ was not declared in this scope
RETRY_ON_EINTR(r, preadv(fd, iov + completed_iov, iov_count, cur_offset));
^
workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/gutil/macros.h::: note: in definition of macro ‘RETRY_ON_EINTR’
(err) = (expr); \
^~~~
workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/env/env_posix.cpp::: note: suggested alternative: ‘pread’
RETRY_ON_EINTR(r, preadv(fd, iov + completed_iov, iov_count, cur_offset));
^
workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/gutil/macros.h::: note: in definition of macro ‘RETRY_ON_EINTR’
(err) = (expr); \
^~~~
workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/env/env_posix.cpp: In function ‘doris::Status doris::do_writev_at(int, const string&, uint64_t, const doris::Slice*, size_t, size_t*)’:
workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/env/env_posix.cpp::: error: ‘pwritev’ was not declared in this scope
RETRY_ON_EINTR(w, pwritev(fd, iov + completed_iov, iov_count, cur_offset));
^
workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/gutil/macros.h::: note: in definition of macro ‘RETRY_ON_EINTR’
(err) = (expr); \
^~~~
workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/env/env_posix.cpp::: note: suggested alternative: ‘pwrite’
RETRY_ON_EINTR(w, pwritev(fd, iov + completed_iov, iov_count, cur_offset));
^
workspace/open-source/incubator-doris-DORIS-0.11.-alpha/be/src/gutil/macros.h::: note: in definition of macro ‘RETRY_ON_EINTR’
(err) = (expr); \
^~~~
src/env/CMakeFiles/Env.dir/build.make:: recipe for target 'src/env/CMakeFiles/Env.dir/env_posix.cpp.o' failed
make[]: *** [src/env/CMakeFiles/Env.dir/env_posix.cpp.o] Error
CMakeFiles/Makefile2:: recipe for target 'src/env/CMakeFiles/Env.dir/all' failed
make[]: *** [src/env/CMakeFiles/Env.dir/all] Error
make[]: *** Waiting for unfinished jobs....
[ %] Building CXX object src/exprs/CMakeFiles/Exprs.dir/conditional_functions.cpp.o
[ %] Building CXX object src/exprs/CMakeFiles/Exprs.dir/conditional_functions_ir.cpp.o

this is caused by missing reference for  preadv,  the solution is to include header file for peadv, detail action as follows:

a) open file   incubator-doris-DORIS-0.11.5-alpha/be/src/env/env_posix.cpp

b)  include <sys/uio.h> at the header reference section, then rebuild the source ,everything would go smoothly on ubuntu.

For such issue, I have commite a pull request to the doris team, it must has been merged into the master branch.

 

build doris 0.11.5 on centos 7/ubuntu的更多相关文章

  1. CentOS 7.2.1511编译安装Nginx1.10.1+MySQL5.7.14+PHP7.0.11

    准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.se ...

  2. Centos 6.5下mysql 8.0.11的rpm包的安装方式

    1.系统版本及mysql下载地址 操作系统:Centos 6.5(Centos 7.4下载对应的mysql版本安装同理) mysql数据库版本:mysql8.0.11 mysql官方网站:http:/ ...

  3. CentOS 7.2.1511编译安装Nginx1.10.1+MySQL5.7.15+PHP7.0.11

    准备篇 一.防火墙配置 CentOS 7.2默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.se ...

  4. centos 7 redis-4.0.11 主从

    redis-master:192.168.199.223 redis-slave: 192.168.199.224 cd /opt wget http://download.redis.io/rele ...

  5. doris 0.9.0版本docker镜像制作与使用

    1. 安装docker 详情请参见本人博客 2. 编译doris 详情请参见doris官网文档 3. 在编译好的doris output文件夹下编写两个Dockerfile 3.1  Dockerfi ...

  6. [转载]Linux 环境下编译 0.11版本内核 kernel

    最近在看<.如果Clobber/Modify 为空,则其前面的冒号(:)必须省略. 2.如果Output,Input,Clobber/Modify都为空,Output,Input之前的冒号(:) ...

  7. Kafka 0.11.0.0 实现 producer的Exactly-once 语义(英文)

    Exactly-once Semantics are Possible: Here’s How Kafka Does it I’m thrilled that we have hit an excit ...

  8. redis(4.0.11)编译安装

    一: redis数据库安装 系统环境:linux系统(centos/redhat):Red Hat Enterprise Linux Server release 6.8 (Santiago) red ...

  9. system libzip must be upgraded to version >= 0.11

    PHP当前最新版本是PHP7.3,今天在尝试安装的过程中报如下错误: system libzip must be upgraded to version >= 0.11, 根据提示我们可以清楚的 ...

随机推荐

  1. python - django (视图)

    # """ 一:# 视图 (接收请求返回响应的那部分) FBV版:基于 函数的 请求 CBV版:基于 类的 请求 注册方法: url(r'^add_publisher/' ...

  2. BZOJ 2502 清理雪道(有源汇上下界最小流)

    题面 滑雪场坐落在FJ省西北部的若干座山上. 从空中鸟瞰,滑雪场可以看作一个有向无环图,每条弧代表一个斜坡(即雪道),弧的方向代表斜坡下降的方向. 你的团队负责每周定时清理雪道.你们拥有一架直升飞机, ...

  3. loj #137 and #6021

    最小瓶颈路 加强版 重构树 最小生成树在合并 (x, y) 时,新建节点 z,link(x, z), link(y, z), 新建节点的权值为 w_{x,y}, 这样的 话任意两点的 answer 为 ...

  4. 2017.10.4 国庆清北 D4T1 财富

    (其实这题是luogu P1901 发射站 原题,而且数据范围还比luogu小) 题目描述 LYK有n个小伙伴.每个小伙伴有一个身高hi. 这个游戏是这样的,LYK生活的环境是以身高为美的环境,因此在 ...

  5. 洛谷P5506 封锁

    题目 一道模拟题,问题不是很大,主要需要读题清晰,且算法的操作顺序要搞明白,比如在每一秒的开始,所有无人机先移动,然后再一步一步操作. 然后就是判断方向是否一致了,细节还是很多的. #include ...

  6. shell编程题(三)

    将一目录下所有的文件的扩展名改为bak #! /bin/bash for i in `ls` do mv $i ${i%%.*}.bak done ${i%%.*} 截掉一个变量字符串第一个" ...

  7. 《挑战30天C++入门极限》C++的iostream标准库介绍(1)

        C++的iostream标准库介绍(1) 我们从一开始就一直在利用C++的输入输出在做着各种练习,输入输出是由iostream库提供的,所以讨论此标准库是有必要的,它与C语言的stdio库不同 ...

  8. P1041 传染病控制——暴力遍历所有相同深度的节点

    P1041 传染病控制 说实话这种暴力我还是头一次见,每次病毒都会往下传染一层: 数据范围小,我们可以直接枚举当前层保护谁就好了: 用vector 记录相同层数的节点:维护已经断了的点: 如果超出最底 ...

  9. Spring的Core模块

    Core模块主要的功能是实现了反向控制IOC(Inversion of Control)与依赖注入DI(Dependency Injection).Bean配置以及加载.Core模块中有Beans.B ...

  10. Codeforces Round #604 (Div. 1) - 1C - Beautiful Mirrors with queries

    题意 给出排成一列的 \(n\) 个格子,你要从 \(1\) 号格子走到 \(n\) 号格子之后(相当于 \(n+1\) 号格子),一旦你走到 \(i+1\) 号格子,游戏结束. 当你在 \(i\) ...