Open GQBBBB opened 4 years ago
这是在riscv64 linux环境下构建cpu2006的过程:
因为cpu2006预编译工具链不包括riscv64架构的,所以你要重新构建所有工具,然后才可以安装. 以下操作在cpu2006/tools/src下.
cpu2006/tools/src
执行./buildtools开始构建.
./buildtools
以下是我出现的错误以及解决办法:
首先你要保证它自带的工具可以识别出来你的架构,更新一下config.guess和config.sub. 下载最新的config.guess和config.sub
wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' wget -O config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
把下载的config.guess和config.sub替换掉以下目录中已存在的
tools/src/expat-1.95.8/conftools/ tools/src/tar-1.15.1/config/ tools/src/specinvoke/ tools/src/make-3.80/config/
安装texinfo这个包
sudo dnf install -y texi2html texinfo
安装byacc这个包
sudo dnf install -y byacc
把函数定义中变量类型和声明类型统一一下.
把CPU2006所有文件中包含# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION的全部改为# if _GNU_GLOB_INTERFACE_VERSION >= GLOB_INTERFACE_VERSION. 参考这里
# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
# if _GNU_GLOB_INTERFACE_VERSION >= GLOB_INTERFACE_VERSION
<command-line>', needed by
打开tools/src/perl-5.8.7/makedepend.SH, 添加一行:
tools/src/perl-5.8.7/makedepend.SH
-e '/^#.*<command line>/d' \ + -e '/^#.*<command-line>/d' \
打开./tools/src/specmd5sum/md5sum.c文件,注释掉#include "getline.h".
./tools/src/specmd5sum/md5sum.c
#include "getline.h"
make: *** [miniperl] Error 1 + testordie 'error building Perl' + test 2 -ne 0 + echo '!!! error building Perl' !!! error building Perl + kill -TERM 15173 + exit 1 !!!!! buildtools killed
./tools/src/perl-5.8.7/ext/IPC/SysV/SysV.xs
include <asm/page.h>
./tools/src/buildtools
\-dOes
./Configure -dOes -Ud_flock $PERLFLAGS -Ddosuid=undef -Dprefix=$INSTALLDIR -Dd_bincompat3=undef -A ldflags="-ldl -lm -L${INSTALLDIR}/lib" -A ccflags=-I${INSTALLDIR}/include -Ui_db -Ui_gdbm -Ui_ndbm -Ui_dbm -Uuse5005threads -Dcccdlflags="-fPIC -shared" -Dlddlflags="-shared -fPIC" -Duseshrplib=true ; testordie "error configuring perl"
打开./tools/src/buildtools, 找到BZIP2CFLAGS变量, 在它所在语句的上面添加BZIP2CFLAGS=-fPIC.
BZIP2CFLAGS
BZIP2CFLAGS=-fPIC
很多解决办法参考这里
Top of SPEC benchmark tree is '/home/gqb/cpu2006' Tools built successfully. Go to the top of the tree and source the shrc file. Then you should be ready.
build大概需要一个小时, 中间可能有很多warning, 但是不用管. :sob::sob::sob:
因为cpu2006不包含riscv64的cfg文件,所以你需要从这里获得riscv.cfg, 然后可能需要根据你的机器做一些修改, 并把它移动到cpu2006/config/目录下.
riscv.cfg
cpu2006/config/
在cpu2006下运行./install.sh. 查看输出感觉这一步操作的含义是不是和./buildtools差不多??? install大概需要一个多小时.
cpu2006
./install.sh
软件包完整性校验失败,可能是我们修改了代码.
... Tools build successful. Checking the integrity of your source tree... bin/specmd5sum: WARNING: 4 of 15910 computed checksums did NOT match bin/specmd5sum: WARNING: 37 of 15910 file sizes did NOT match tools/src/buildtools: FAILED size mismatch tools/src/bzip2-1.0.3/configure: FAILED size mismatch tools/src/expat-1.95.8/conftools/config.guess: FAILED size mismatch tools/src/expat-1.95.8/conftools/config.sub: FAILED size mismatch tools/src/make-3.80/config.h.in: FAILED size mismatch tools/src/make-3.80/config/config.guess: FAILED size mismatch tools/src/make-3.80/config/config.sub: FAILED size mismatch tools/src/make-3.80/configure: FAILED size mismatch tools/src/make-3.80/configure.in: FAILED tools/src/make-3.80/glob/glob.c: FAILED tools/src/make-3.80/po/da.gmo: FAILED size mismatch tools/src/make-3.80/po/da.po: FAILED size mismatch tools/src/make-3.80/po/de.gmo: FAILED size mismatch tools/src/make-3.80/po/de.po: FAILED size mismatch tools/src/make-3.80/po/es.gmo: FAILED size mismatch tools/src/make-3.80/po/es.po: FAILED size mismatch tools/src/make-3.80/po/fr.gmo: FAILED size mismatch tools/src/make-3.80/po/fr.po: FAILED size mismatch tools/src/make-3.80/po/gl.gmo: FAILED size mismatch tools/src/make-3.80/po/gl.po: FAILED size mismatch tools/src/make-3.80/po/he.gmo: FAILED size mismatch tools/src/make-3.80/po/he.po: FAILED size mismatch tools/src/make-3.80/po/hr.gmo: FAILED size mismatch tools/src/make-3.80/po/hr.po: FAILED size mismatch tools/src/make-3.80/po/ja.gmo: FAILED size mismatch tools/src/make-3.80/po/ja.po: FAILED size mismatch tools/src/make-3.80/po/ko.gmo: FAILED size mismatch tools/src/make-3.80/po/ko.po: FAILED size mismatch tools/src/perl-5.8.7/ext/IPC/SysV/SysV.xs: FAILED size mismatch tools/src/perl-5.8.7/makedepend.SH: FAILED size mismatch tools/src/specinvoke/config.guess: FAILED size mismatch tools/src/specinvoke/config.sub: FAILED size mismatch tools/src/specmd5sum/md5sum.c: FAILED size mismatch tools/src/tar-1.15.1/config.hin: FAILED size mismatch tools/src/tar-1.15.1/config/config.guess: FAILED size mismatch tools/src/tar-1.15.1/config/config.sub: FAILED size mismatch tools/src/tar-1.15.1/configure: FAILED size mismatch tools/src/tar-1.15.1/doc/stamp-vti: FAILED tools/src/tar-1.15.1/doc/version.texi: FAILED tools/src/tar-1.15.1/lib/getdate.c: FAILED size mismatch tools/src/tar-1.15.1/lib/getdate.y: FAILED size mismatch Package integrity check failed. Some failures are to be expected after building the tools, as the build process modifies some files in the distribution.
安装成功
Top of SPEC benchmark tree is '/home/gqb/cpu2006' Everything looks okay. cd to /home/gqb/cpu2006, source the shrc file and have at it!
. ./shrc
运行一下mcf测试一下吧
runspec --config riscv.cfg --size=ref --noreportable --iterations=1 --tune=base 429.mcf
(这里的riscv.cfg就是上面让你移到config文件夹下的那个, 如果重命名为default.cfg也可以去掉--config )
default.cfg
--config
结果:
[gqb@stage4 cpu2006]$ runspec --config riscv.cfg --size=ref --noreportable --iterations=1 --tune=base 429.mcf runspec v4662 - Copyright 1999-2006 Standard Performance Evaluation Corporation Using 'riscv64-linux' tools Reading MANIFEST... 17911 files Loading runspec modules............... Locating benchmarks...found 31 benchmarks in 12 benchsets. Locating output formats: ASCII, config, CSV, flags, HTML, mail, PDF, PostScript, raw, Screen, Submission Check Reading config file '/home/gqb/cpu2006/config/riscv.cfg' Benchmarks selected: 429.mcf Compiling Binaries Building 429.mcf ref base riscv default: (build_base_riscv.0000) Build successes: 429.mcf(base) Parsing Flags Looking at 429.mcf base riscv default: done Flag Parsing Complete Setting Up Run Directories Setting up 429.mcf ref base riscv default: created (run_base_ref_riscv.0000) Running Benchmarks Running 429.mcf ref base riscv default Success: 1x429.mcf Producing Reports mach: default ext: riscv size: ref set: int format: raw -> /home/gqb/cpu2006/result/CINT2006.002.rsf format: flags -> /home/gqb/cpu2006/result/CINT2006.002.flags.html format: ASCII -> /home/gqb/cpu2006/result/CINT2006.002.txt format: CSV -> /home/gqb/cpu2006/result/CINT2006.002.csv format: HTML -> /home/gqb/cpu2006/result/CINT2006.002.html, ../../../../../result//invalid.gif, CINT2006.002.gif set: fp The log for this run is in /home/gqb/cpu2006/result/CPU2006.002.log runspec finished at Wed Nov 20 14:53:28 2019; 2117 total seconds elapsed
运行时出现错误参考这里.
参考:
这是在riscv64 linux环境下构建cpu2006的过程:
build tools
因为cpu2006预编译工具链不包括riscv64架构的,所以你要重新构建所有工具,然后才可以安装. 以下操作在
cpu2006/tools/src
下.执行
./buildtools
开始构建.以下是我出现的错误以及解决办法:
Q1: config.guess无法识别你机器的架构
首先你要保证它自带的工具可以识别出来你的架构,更新一下config.guess和config.sub. 下载最新的config.guess和config.sub
把下载的config.guess和config.sub替换掉以下目录中已存在的
Q2: WARNING: `makeinfo' is missing on your system.
安装texinfo这个包
Q3: yacc command not found
安装byacc这个包
Q4: error: conflicting types for 'yylex'
把函数定义中变量类型和声明类型统一一下.
Q5: ./glob/glob.c:577:23: warning: implicit declaration of function '__alloca'; did you mean 'alloca'? [-Wimplicit-function-declaration]
把CPU2006所有文件中包含
# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
的全部改为# if _GNU_GLOB_INTERFACE_VERSION >= GLOB_INTERFACE_VERSION
. 参考这里Q6: make: *** No rule to make target
<command-line>', needed by
miniperlmain.o'.打开
tools/src/perl-5.8.7/makedepend.SH
, 添加一行:Q7: lib/getline.h:31:1: error: conflicting types for 'getline' & !!! error building specmd5sum
打开
./tools/src/specmd5sum/md5sum.c
文件,注释掉#include "getline.h"
.Q8:下面一大段错误:
./tools/src/perl-5.8.7/ext/IPC/SysV/SysV.xs
,注释掉include <asm/page.h>
./tools/src/buildtools
, 输入\-dOes
找到代码段位置, 并做以下修改:Q9: make: *** [blib/arch/auto/Compress/Bzip2/Bzip2.so] Error 1
打开
./tools/src/buildtools
, 找到BZIP2CFLAGS
变量, 在它所在语句的上面添加BZIP2CFLAGS=-fPIC
.很多解决办法参考这里
最后
./buildtools
成功:build大概需要一个小时, 中间可能有很多warning, 但是不用管. :sob::sob::sob:
获得config文件
因为cpu2006不包含riscv64的cfg文件,所以你需要从这里获得
riscv.cfg
, 然后可能需要根据你的机器做一些修改, 并把它移动到cpu2006/config/
目录下.安装
在
cpu2006
下运行./install.sh
.查看输出感觉这一步操作的含义是不是和install大概需要一个多小时../buildtools
差不多???软件包完整性校验失败,可能是我们修改了代码.
安装成功
配置环境变量
. ./shrc
运行
运行一下mcf测试一下吧
(这里的
riscv.cfg
就是上面让你移到config文件夹下的那个, 如果重命名为default.cfg
也可以去掉--config
)结果:
运行时出现错误参考这里.
参考: