SPEC CPU2006
安裝 SPEC
It is generally not possible to do cross-compilation of Perl, as Perl's build process involves running binaries generated during the build. Therefore, getting a toolset onto an embedded platform without a native compiler is most likely impossible. 1.c. When to build the tools yourself http://www.spec.org/cpu2006/docs/tools-build.html#when2build
- SPEC 會用到的工具缺少 ARM 的 binary。建議使用 QEMU。或是採取另一種方法,請見
tools/src/perl-5.8.8/INSTALL
,它有說明如何 cross compile。$ wget http://people.debian.org/~aurel32/qemu/armel/vmlinuz-2.6.32-5-versatile $ wget http://people.debian.org/~aurel32/qemu/armel/initrd.img-2.6.32-5-versatile $ wget http://people.debian.org/~aurel32/qemu/armel/debian_squeeze_armel_desktop.qcow2 $ wget http://people.debian.org/~aurel32/qemu/armel/debian_squeeze_armel_standard.qcow2 # root/root; user/user $ qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.32-5-versatile \ -initrd initrd.img-2.6.32-5-versatile \ -hda debian_squeeze_armel_standard.qcow2 -append "root=/dev/sda1 console=ttyAMA0" -nographic
- 修正 SPEC 的問題。
$ cd tools/src/perl-5.8.8 # 中途會出現找不到以下檔案的訊息,請繼續。 $ mv t/op/sprintf.t t/op/sprintf.off $ mv t/uni/sprintf.t t/uni/sprintf.off $ mv t/op/sprintf2.t t/op/sprintf2.off
--- makedepend.orig 2012-04-27 18:44:40.000000000 +0800 +++ makedepend 2012-04-27 17:35:33.000000000 +0800 @@ -103,7 +103,7 @@ *.y) filebase=`basename $file .y` ;; esac case "$file" in - */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;; + */*) finc="-I`echo $file | sed 's#/[^/]*$##'`" ;; *) finc= ;; esac $echo "Finding dependencies for $filebase$_o."
--- SysV.xs.orig 2012-04-27 19:43:11.000000000 +0800 +++ SysV.xs 2012-04-27 19:42:16.000000000 +0800 @@ -4,7 +4,7 @@ #include <sys/types.h> #ifdef __linux__ -# include <asm/page.h> +//# include <asm/page.h> #endif #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM) #ifndef HAS_SEM
- 安裝 SPEC 會用到的工具。或是以 NFS 掛上已編譯好的 SPEC1)。
$ apt-get update $ apt-get install gcc g++ gfortran automake # 避掉 "You haven't done a "make depend" yet" 的錯誤。 $ ln -sf /bin/bash /bin/sh # 預設可使用網路,可以透過網路取得 SPEC tarball; 又或是掛載 ISO 檔。 $ cd ${SRC}/tools/src $ ./build.sh
運行 SPEC
閱讀 SPEC CPU2006 Documentation、SPEC CPU2006 Config Files 和 The 'runspec' Command。
選項
–nobuild
可以避免重新編譯。
- 在 /data/Benchmarks/SPEC/CPU2006_v1.1_x86/config 底下生成一個設定檔。
$ cp Example-linux64-amd64-gcc43.cfg chenwj-i71-example.cfg
- 新增
qemu = /path/to/qemu-i38 curdir = /tmp/chenwj/spec # 測量結果放置處 output_root = ${curdir}/spec_results # summit 可以加上額外的指令及參數,預設為 $command submit = $qemu $command
- 建立軟連結,方便修改設定檔
$ cd /tmp/chenwj/spec $ ln -s /data/Benchmarks/SPEC/CPU2006_v1.1_x86/config/chenwj-i71-example.cfg . $ cd /data/Benchmarks/SPEC/CPU2006_v1.1_x86 # 這樣才抓得到 runspec $ . shrc $ cd /tmp/chenwj/spec $ runspec --config=chenwj-i71-example.cfg --iterations=1 --size=test mcf
- 中止測量Ctrl+Z
$ pstree -p | grep runspec -A2 -B2 $ killall
若要同時執行多個 benchmark,請手動並將其至於背景執行。
declare -a benchmark=( "400.perlbench" "401.bzip2" "403.gcc" "410.bwaves" "416.gamess" "429.mcf" "433.milc" "434.zeusmp" "435.gromacs" "436.cactusADM" "437.leslie3d" "444.namd" "445.gobmk" "447.dealII" "450.soplex" "453.povray" "454.calculix" "456.hmmer" "458.sjeng" "459.GemsFDTD" "462.libquantum" "464.h264ref" "465.tonto" "470.lbm" "471.omnetpp" "473.astar" "481.wrf" "482.sphinx3" "483.xalancbmk" "998.specrand" "999.specrand" ) for bench in "${benchmark[@]}"; do runspec --config=${CONFIG} --iterations=1 --size=test $bench done
Cross Compile
修改 CC 和 CXX 成 cross compiler。
$ runspec --config=chenwj-armv5.cfg --action=build --action setup all
SPEC Virt
需安裝 JDK,不建議安裝 GCJ。
$ apt-get install openjdk-6-jre $ java -jar setup.jar -i console # 修改設定檔以符合自身需求。 $ vi /opt/SPECvirt/Control.config
$ -net nic -net tap