C-BGP安装

1 安装PCRE(Perl Compatible Regular Expressions):http://www.pcre.org/,按照正常automake执行即可。
2 安装Readline: http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html, 按照正常automake执行即可。
(The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in)
3 安装 libGDS:http://sourceforge.net/projects/libgds/,按照正常automake执行即可
(The library contains dynamic arrays, hash tables, radix trees, Patricia trees, tokenizers, FIFO queues, stacks,
string management functions and memory management functions.generic data structures that we use in various projects such as C-BGP)

上面三个执行安装完成后,相关库都安装在了/usr/local/lib下面,但是./configure CBGP的仍然会报错:libgds >= 2.0.0 is needed to compile cbgp

仔细阅读了cbgp的configure.in文件知道了错误地点在:
(注意configure.in文件是被GNU的autoconf工具用来生成configure file的。
Project GNU provides two programs, automake and autoconf, that simplify the generation of portable Makefiles and configure scripts。
automake is a program that generates makefile templates automatically from Makefile.am.
And autoconf is a tool that creates the configure file from configure.in)

dnl *****************************************************************
dnl LIBGDS CHECK
dnl *****************************************************************
LIBGDS_VERSION="2.0.0"
AC_SUBST(LIBGDS_VERSION, [$LIBGDS_VERSION])
PKG_CHECK_MODULES([LIBGDS], [libgds >= $LIBGDS_VERSION],[],[
  AC_MSG_ERROR([libgds >= $LIBGDS_VERSION is needed to compile cbgp])
])

其中的PKG_CHECK_MODULES宏就是用来检查库文件的,调用的就是系统中的pkg-config来做的
(The main interface between autoconf and pkg-config is the PKG_CHECK_MODULES macro, which provides a very basic and easy
way to check for the presence of a given package in the system。
详见:http://www.flameeyes.eu/autotools-mythbuster/pkgconfig/pkg_check_modules.html)
(而pkg-config是The pkgconfig package contains tools for passing the include path and/or library paths to build tools during the make file execution.
pkg-config is a function that returns meta information for the specified library.)

由此可见原因就是pkg-config没有找到libgds,事实上通过查看PKG_CONFIG_PATH(echo $PKG_CONFIG_PATH)就可以证实,因为往PKG_CONFIG_PATH中导入该环境变量
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH,
并且在当前这个shell下面继续执行configure即可通过(这是因为使用export导入环境变量的原因)

4) 安装C-BGP,按照正常automake执行即可。
可运行文件被安装在了/usr/local/bin下面,并且该目录已经在$PATH中,所以从shell上可以直接运行。

 

 

你可能感兴趣的:(Arrays,Path,library,makefile,templates,generation)