-
2010-03-18
Rrdtool 1.4.1 安装 - [E]
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://jiaion.blogbus.com/logs/60731214.html
最近自己没事就是想安装个新版本的rrdtool 与cacti结合起来 想想新的rrdtool是不是能会话出的图来更美观一些,真是不弄不知道,弄了才吓一跳,安装rrdtool 的时候总是提示
configure: error: Please fix the library issues listed above and try again.
好像就是说上面所列的依赖的库版本有问题或者不存在之类的意思,在网上找了好多文章。有的说要装freetype-devel,有的说要更新cgilib ,又有人说要装 libart_lgpl-devel 我都实验了都没用让我百思不得其解,难道是人品问题吗?
然后就来到rrdtool的目录下看了一边里面的东西,让我受益匪浅呀原理doc/rrdbuild.txt中已经告诉我们怎么去编译rrdtool了,我们为什么不早看这个呢?
Build Instructions
Linux
export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"Building pkgconfig
Building pkgconfig
As mentioned above, without pkgconfig the whole build process will be
lots of pain and suffering, so make sure you have a copy on your
system. If it is not available natively, here is how to compile it.
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
gunzip -c pkg-config-0.23.tar.gz | tar xf -
cd pkg-config-0.23
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
After installing pkgconfig in a custom directory, setting up the
corresponding environment variable will be helpful.
export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config每个包下面都告诉了我们怎么去编译怎么去安装他们 ,好了真的看到希望了照着帮助写了一个安装脚本内容如下
#!/bin/bash
DIR=/root/new
INSTALL_DIR=/usr/local
export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
export CFLAGS="-O3 -fPIC"
export PATH=$INSTALL_DIR/bin:$PATH
export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config
cd ${DIR}
tar zxf pkg-config-0.23.tar.gz && cd pkg-config-0.23
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" && make -j 2 && make install
cd ${DIR}
tar zxf zlib-1.2.3.tar.gz && cd zlib-1.2.3
./configure --prefix=$INSTALL_DIR --shared && make -j 2 && make install
cd ${DIR}
tar zxf libpng-1.2.18.tar.gz && cd libpng-1.2.18
env CFLAGS="-O3 -fPIC" ./configure --prefix=$INSTALL_DIR && make -j 2 && make install
cd ${DIR}
tar zxf freetype-2.3.5.tar.gz && cd freetype-2.3.5
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" && make -j 2 && make install
env EGREP=egrep
cd ${DIR}
tar zxf libxml2-2.6.32.tar.gz && cd libxml2-2.6.32
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" && make -j 2 && make install
cd ${DIR}
tar zxf fontconfig-2.4.2.tar.gz && cd fontconfig-2.4.2
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --with-freetype-config=$INSTALL_DIR/bin/freetype-config && make -j 2 && make install
cd ${DIR}
tar zxf pixman-0.10.0.tar.gz && cd pixman-0.10.0
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" && make -j 2 && make install
cd ${DIR}
tar zxf cairo-1.6.4.tar.gz && cd cairo-1.6.4
./configure --prefix=$INSTALL_DIR --enable-xlib=no --enable-xlib-render=no --enable-win32=no CFLAGS="-O3 -fPIC" && make -j 2 && make install
cd ${DIR}
tar zxf glib-2.22.0.tar.gz && cd glib-2.22.0
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" && make -j 2 && make install
cd ${DIR}
tar jxf pango-1.21.1.tar.bz2 && cd pango-1.21.1
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --without-x && make -j 2 && make install
cd ${DIR}
tar zxf rrdtool-1.4.1.tar.gz && cd rrdtool-1.4.1
./configure --prefix=/usr/local/rrdtool --disable-tcl --disable-python && make -j 2 && make install哈哈终于可以看到胜利的曙光了,曙光真的在前面吗????
使用Crt记录下会话日志 bash -x rrdinstall.sh 执行了脚本等待着成功的喜悦,等待脚本执行完. 其实不然还是报的一样的错误
* I could not find a working copy of pangocairo. Check config.log for hints on why
this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
so that compiler and the linker can find libpango-1.0 and its header files. If
you have not installed pangocairo, you can get it either from its original home on
http://ftp.gnome.org/pub/GNOME/sources/pango/1.17
You can find also find an archive copy on
http://oss.oetiker.ch/rrdtool/pub/libs
The last tested version of pangocairo is 1.17.
LIBS=-lm -lglib-2.0
LDFLAGS=-Wl,--rpath -Wl,/usr/local/lib -L/usr/local/lib
CPPFLAGS= -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include
----------------------------------------------------------------------------
checking for xmlParseFile in -lxml2... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes
configure: error: Please fix the library issues listed above and try again.为什么还是同样的问题呢。 打开crt的会话日志仔细观看,原理在make fontconfig 的时候出错了
.libs/libfontconfig.so.1.2.0
/usr/lib/libexpat.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[3]: *** [libfontconfig.la] Error 1
make[3]: Leaving directory `/root/new/fontconfig-2.4.2/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/new/fontconfig-2.4.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/new/fontconfig-2.4.2'
make: *** [all] Error 2还导致 pango-1.21.1 没有安装成功
checking for FONTCONFIG... no
no
checking Carbon/Carbon.h usability... no
checking Carbon/Carbon.h presence... no
checking for Carbon/Carbon.h... no
checking for CAIRO... no
no好像是这个/usr/lib/libexpat.so 连接库有问题不能执行 , yum provides "*libexpat.so*" 查看下这个库是expat-devel 提供的 由于系统是X86_64的安装了 expat-devel-1.95.8-8.2.1.i386 和 expat-devel-1.95.8-8.2.1.x86_64 两个包
凭自己的感觉系统式X86_64的应该执行/usr/lib64/下的libexpat.so而不是/usr/lib/libexpat.so
于是就将 mv /usr/lib/libexpat.so /usr/lib/libexpat.so.old 并把64位的库连接到这个目录下
ln -s /usr/lib64/libexpat.so /usr/lib/libexpat.so
继续执行脚本 居然安装成功了 我的猜测还是对的啊可能有更好的帮让 fontconfig check 的时候去/usr/lib64下检查连接库 我没有测试 但是基本问题就已经解决了 好多网友都问我什么都装了为什么还报错 可能就和这个库有关系以后对看看 源码目录下的doc里面的东西也是一个好习惯哦
其实系统的判断写也可以写在脚本中哦
A=`uname -a | awk -F "GNU" '{print $1}' | awk '{print $NF}'`
if [ "${A}" == "x86_64"];then
mv /usr/lib/libexpat.so /usr/lib/libexpat.so.old
ln -s /usr/lib64/libexpat.so /usr/lib/libexpat.so
fi
把这些加到脚本的最前面 就好了 32位系统 我并没有测试!!
刚刚最新测试 使用--libdir=/usr/lib64 就可以安装fontconfig 成功了 更好的解决办法吧!!
