Fork me on GitHub

[原]解决ubench安装失败问题

解决ubench安装失败问题
2011-12-21 13:42
想使用ubench测试CPU,但是一直安装存在问题。后查阅资料,请教群友及同事,最终解决。记录如下:
==== Creating Makefile for Linux x86_64
==== Now type make to compile ubench for Linux
testcloud@computer9:~/Test/Ubench_1221/ubench-0.32$ make
gcc -O2 -Wall -malign-loops=2 -malign-jumps=2 -malign-functions=2 -I. -c cpubench.c
cpubench.c:1:0: warning: -malign-loops is obsolete, use -falign-loops [enabled by default]
cpubench.c:1:0: warning: -malign-jumps is obsolete, use -falign-jumps [enabled by default]
cpubench.c:1:0: warning: -malign-functions is obsolete, use -falign-functions [enabled by default]
cpubench.c: In function ?.pucalc?.
cpubench.c:72:2: warning: implicit declaration of function ?.bs?.[-Wimplicit-function-declaration]
cpubench.c: In function ?.puload?.
cpubench.c:93:59: error: ?.LK_TCK?.undeclared (first use in this function)
cpubench.c:93:59: note: each undeclared identifier is reported only once for each function it appears in
cpubench.c: In function ?.pubench?.
cpubench.c:136:9: warning: implicit declaration of function ?.xit?.[-Wimplicit-function-declaration]
cpubench.c:136:22: warning: incompatible implicit declaration of built-in function ?.xit?.[enabled by default]
cpubench.c:195:50: warning: incompatible implicit declaration of built-in function ?.xit?.[enabled by default]
make: *** [cpubench.o] Error 1
 
1.参考http://www.extmail.org/forum/thread-7882-1-4.html安装并打上了patch,但是问题没有解决,make时候又出错。
testcloud@computer9:~/Test/Ubench_1221/ubench-0.32$ patch -p0 < /home/testcloud/Test/Ubench_1221/ubench-patch 
patching file membench.c
patching file cpubench.c
patching file configure
testcloud@computer9:~/Test/Ubench_1221/ubench-0.32$ ./configure 
==== Creating Makefile for Linux x86_64
==== Now type make to compile ubench for Linux
testcloud@computer9:~/Test/Ubench_1221/ubench-0.32$ make
gcc -O2 -Wall -falign-loops=2 -falign-jumps=2 -falign-functions=2 -I. -c cpubench.c
cpubench.c: In function ?.pucalc?.
cpubench.c:73:2: warning: implicit declaration of function ?.bs?.[-Wimplicit-function-declaration]
cpubench.c: In function ?.pubench?.
cpubench.c:137:9: warning: implicit declaration of function ?.xit?.[-Wimplicit-function-declaration]
cpubench.c:137:22: warning: incompatible implicit declaration of built-in function ?.xit?.[enabled by default]
cpubench.c:196:50: warning: incompatible implicit declaration of built-in function ?.xit?.[enabled by default]
gcc -O2 -Wall -falign-loops=2 -falign-jumps=2 -falign-functions=2 -I. -c membench.c
gcc -O2 -Wall -falign-loops=2 -falign-jumps=2 -falign-functions=2 -I. -c ubench.c
gcc -O2 -Wall -falign-loops=2 -falign-jumps=2 -falign-functions=2 -s -lm -o ubench signals.o cpubench.o membench.o ubench.o
cpubench.o: In function `cpucalc':
cpubench.c:(.text+0x7f): undefined reference to `log'
cpubench.c:(.text+0xd5): undefined reference to `atan'
cpubench.c:(.text+0xda): undefined reference to `cos'
cpubench.c:(.text+0x101): undefined reference to `atan'
cpubench.c:(.text+0x106): undefined reference to `sin'
cpubench.c:(.text+0x181): undefined reference to `pow'
cpubench.c:(.text+0x1af): undefined reference to `exp'
cpubench.c:(.text+0x22f): undefined reference to `pow'
cpubench.c:(.text+0x23e): undefined reference to `sqrt'
collect2: ld returned 1 exit status
make: *** [ubench] Error 1
 
2.修改或者检查Makefile:
其中第14,15行:
另外第22行:
    $(CC) $(CFLAGS) -o $@ $(objects) $(LDFLAGS) 
然后重新make:
3.修改cpubench.c
第28行增加头文件:#include <stdio.h>
检查第74行:
4.执行:gcc -o ubench signals.o cpubench.o membench.o ubench.o -lm
5.检查makefile,并重新编译:
运行./ubench之后得出结果如下:
完成。
 
 
posted @ 2011-12-21 13:42  念槐聚  阅读(1144)  评论(0编辑  收藏  举报

IT技术&应用开发&研究 - 创建于 2008年05月12日

这是一位IT工程师的个人站,内容主要是网站开发方面的技术文章,大部分来自学习或工作,部分来源于网络,希望对大家有所帮助。

致力于软件学习&研究工作,涉及Linux与软件开发出、测试、产品、行业相关知识,关注互联网前沿技术与与创业趋势等。


博客园 | Github | W3C

返回顶部