ninja是一个小型构建系统,专注于速度,和常用的make构建系统类似,有一些软件就是基于ninja编译构建的,比如greenplum数据库、clickhouse数据库都需要依赖ninja,具体的介绍信息请参考https://ninja-build.org/

ninja编译需要依赖re2c,re2c是一款语法分析器,官网地址是:http://re2c.org/

以下内容操作环境为CentOS8

re2c安装

安装说明请参考re2c官网http://re2c.org/install/install.html,以下是一个参考安装步骤:

sudo yum install autoconf
sudo yum install automake
sudo yum install libtool
git clone https://github.com/skvadrik/re2c
cd re2c
./autogen.sh
./configure
make
sudo make install

ninja安装

git clone https://github.com/ninja-build/ninja.git
cd ninja
./configure.py --bootstrap
# bootstrapping ninja...
# wrote build.ninja.
# bootstrap complete.  rebuilding...
# [34/34] LINK ninja
# 编译完成
sudo cp ninja /usr/bin

安装完成后,通过以下命令查看版本信息:

[parallels@ct8-1 ninja]$ ninja --version
1.10.2.git
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐