filebench也是一套檔案系統的效能評測軟體,不過ubuntu並沒有提供套件,似乎也找不到deb檔,
只好自己動手來,動手之後才發現...他...很難搞!

完全不能用無腦的./configure && make && make install搞定他Orz
都是compile error,好險我會寫C :p

好的!那我們就一步步來KO他吧!

首先,必須安裝一些套件:
$ sudo apt-get install intltool automake libtool flex bison

然後還要安裝libtecla函式庫,雖然沒有套件可以用,但是問題不大
$ wget http://www.astro.caltech.edu/~mcs/tecla/libtecla-1.6.1.tar.gz
$ tar zxf libtecla-1.6.1.tar.gz
$ cd libtecla/
$ ./configure && make && sudo make install

再來是重點filebench

先到sourceforge下載filebench原始碼
http://sourceforge.net/project/showfiles.php?group_id=133644

這裡操作先以1.4.4版為例
$ tar zxf filebench-1.4.4.tar.gz
$ cd filebench-1.4.4/

根據INSTALL檔的說明,我們必須先執行下面幾個指令(也就是剛剛先裝一些必備套件的原因)
$ aclocal && autoconf && autoheader && automake --add-missing --copy
$ ./configure

接著進行make吧!
$ make

如果你馬上就出現了error那一點也不意外,不然就不會有這篇了XDDD
往前看一點,可以看到應該型態沒宣告的錯誤,然後修完一個還有一個....

filebench/fb_avl.h加入:
typedef unsigned long int ulong_t;

filebench/fileset.h加入:
#ifndef HAVE_UINT_T
#define    uint_t unsigned int
#endif /* HAVE_UINT_T */;

multi_client_sync.c會有一個gethostbyname_r參數個數錯誤的問題,只要補一個空參數給他就好了。
請先宣告一個struct hostent *empty_hostent=NULL;
然後補在第五個參數的位置:
if (gethostbyname_r(master_name, &master_info, buffer, MCS_MSGLENGTH,
    &empty_hostent, &error_num) == NULL) {

multi_client_sync.h:31:21: 錯誤: inet/ip.h:沒有此一檔案或目錄
inet/ip.h改成linux/ip.h

好了,了結了compile error,接下來還有link error..... /usr/bin/ld: cannot find -laio

修改 filebench/Makefile 將
LDLIBS = -lm  -lm -lpthread -laio -lfl -lrt -ltecla -lsocket -lnsl 改成
LDLIBS = -lm  -lm -lpthread -lfl -lrt -ltecla
LIBS = -lm  -lm -lpthread -laio -lfl -lrt -ltecla -lsocket -lnsl 改成
LIBS = -lm  -lm -lpthread -lfl -lrt -ltecla

好了,應該通通完成了吧。囧。那安裝一下~
$ sudo make install

koukaipan 發表在 痞客邦 PIXNET 留言(1) 人氣()


留言列表 (1)

發表留言
  • Guest
  • Other solutions ?!

    Have you tried the ported solution for Linux/FreeBSD ?? I thought the original FileBench was developed on SUN/Solaris system. Therefore, there should be many difficulties for building it onto Linux(Ubuntu).

    There are some works about the porting project.
    http://www.fsl.cs.sunysb.edu/~vass/filebench

    BTW, your post is very helpful for me. Thanks !!
  • yah~ you're right, filebench is originally designed for Solaris, and this article is describing how to port to Linux, but I have not tried to port filebench to FreeBSD.

    actually, I have successfully built the newer version of filebench (1.4.8) to Ubuntu 9.10, but filebench still has many problems running benchmarks..... :(
    Maybe I will post another article for the newer one if I have free time. :p

    thanks for your info, that would be very useful!

    koukaipan 於 2010/04/25 23:02 回覆