环境准备
当前机器环境centos7
硬件要求
类型 | 要求 |
---|---|
CPU | 架构 x86_64 |
内存 | 4 GB |
硬盘 | 10 GB,SSD |
环境依赖(针对centos7)
软件名称 | 版本 | 备注 |
---|---|---|
glibc | 2.17 及以上 | 执行命令ldd –version检查版本。 |
g++ | 8.5.0 及以上 | 执行命令g++ -v检查版本。 |
cmake | 3.14.0 及以上 | 执行命令cmake –version检查版本。 |
yum安装准备
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.back
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
yum update
yum install -y make \
m4 \
git \
wget \
unzip \
xz \
readline-devel \
ncurses-devel \
zlib-devel \
gcc \
gcc-c++ \
cmake \
curl \
redhat-lsb-core \
bzip2
gcc++ 升级
g++ --version
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-2-3.el7.centos.noarch.rpm
rpm -ivh centos-*.rpm
yum install devtoolset-9-gcc-c++
source /opt/rh/devtoolset-9/enable
cmake升级
cmake --version
wget https://cmake.org/files/v3.17/cmake-3.17.0.tar.gz
tar -zxvf cmake-3.17.0.tar.gz
cd cmake-3.17.0
./bootstrap
gmake
make install
编译nebula
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nebula -DENABLE_TESTING=OFF -DENABLE_ASAN=ON -DCMAKE_BUILD_TYPE=Release ..
编译异常处理
-
如果发现 Bzip2 doesn’t exist 报错
CMake Error at cmake/FindBzip2.cmake:31 (message): Bzip2 doesn't exist Call Stack (most recent call first): cmake/nebula/ThirdPartyConfig.cmake:94 (find_package)
- 检查bzip2是否安装
- 如果已安装,注掉ThirdPartyConfig.cmake的第94行
vim ../cmake/nebula/ThirdPartyConfig.cmake 94 # find_package(Bzip2 REQUIRED)
make -j4
make install
>> Home