libPhenom库编译

来源:互联网 发布:php订单管理系统 开源 编辑:程序博客网 时间:2024/06/05 06:45

libPhenom是Facebook发布的一个C语言事件框架,用于构建高性能和高可扩展的系统。支持多线程、提供内存管理和常用数据结构、json处理。

以下是编译过程:

一、环境准备

所用的操作系统环境是CentOS 6.7。登陆之后首先安装需要的开发环境:

yum groupinstall "Development tools"

这一步会自动去安装automake、autoconf和libtool等工具。然后从Github上面检出libPhenom的源代码。

二、编译过程

git clone https://github.com/facebook/libphenom.git

然后cd到libphenom目录,截止当前最新pull到的代码是2015年11月16日的。可以看到当前的目录结构:


在指令行运行autogen.sh,会自动运行libtool、automake和autoconf等指令。


运行完之后,如果直接运行./configure,这个时候会提示:

No package 'ck' foundconfigure: error: ck is required

这个就需要安装ConcurrencyKit这个库。从Github上面查询到这个库的源代码。然后使用git来进行检出。

git clone https://github.com/concurrencykit/ck.git

然后./configure进行编译,运行make && make install进行安装,默认安装到了/usr/local目录下面。这个时候再次切换到libphenome目录下进行./configure。这个时候发现还是没有识别出来ck,在终端提示

Package ck was not found in the pkg-config search path.Perhaps you should add the directory containing `ck.pc'to the PKG_CONFIG_PATH environment variable

cd到/usr/local目录下,运行指令查找ck.pc这个文件。

find . -name *.pc


然后再次运行configure,同时带上PKG_CONFIG_PATH这个参数,如下所示:

./configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

这次顺利通过configure,但是直接make发现编译不通过,显示内容如下:


是ConcurrencyKit库的代码不匹配,在travis目录找到一个deps.sh文件,在里面看到所使用的ck库的版本是0.4.1。


使用git切换到0.4.1的tag,重新编译安装ck库,这次可以正常make编译libPhenom库了。



1 0
原创粉丝点击