SPEC CPU 2006 1.2 D2000 ARM64 aarch64平台 docker 环境下的编译 宿主机测试

文章描述了一位用户在基于银河麒麟V10操作系统上遇到speccpu2006编译错误,因为系统GCC版本过高且缺乏arm64架构支持。用户采用docker运行旧版本gcc镜像来编译工具,并通过应用补丁成功解决编译问题。之后,用户在docker内进行了静态编译并运行测试,但遇到了416.gamess测试项的运行错误。最后,用户计划进一步调查错误原因。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

由于spec cpu 2006版本太老,现代操作系统gcc版本远高于gcc4.3,且tools也没有提供arm64架构程序文件,导致安装编译会报大量编译错误,难以适配。故采用docker方式尝试编译。

系统

root@yeqiang-greatwall:/home/yeqiang/Downloads# cat /etc/os-release 
NAME="Kylin"
VERSION="银河麒麟桌面操作系统V10 (SP1)"
VERSION_US="Kylin Linux Desktop V10 (SP1)"
ID=kylin
ID_LIKE=debian
PRETTY_NAME="Kylin V10 SP1"
VERSION_ID="v10"
HOME_URL="http://www.kylinos.cn/"
SUPPORT_URL="http://www.kylinos.cn/support/technology.html"
BUG_REPORT_URL="http://www.kylinos.cn/"
PRIVACY_POLICY_URL="http://www.kylinos.cn"
VERSION_CODENAME=kylin
UBUNTU_CODENAME=kylin
PROJECT_CODENAME=v10sp1
root@yeqiang-greatwall:/home/yeqiang/Downloads# uname -a
Linux yeqiang-greatwall 5.4.18-80.43.2-generic #GWOEM SMP Wed Mar 9 14:13:16 CST 2022 aarch64 aarch64 aarch64 GNU/Linux
root@yeqiang-greatwall:/home/yeqiang/Downloads# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-10kylin2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-10kylin2)

cpu2006

root@yeqiang-greatwall:/home/yeqiang/Downloads# file cpu2006-1.2.iso 
cpu2006-1.2.iso: ISO 9660 CD-ROM filesystem data 'SPEC_CPU2006v1.2'
root@yeqiang-greatwall:/home/yeqiang/Downloads# md5sum cpu2006-1.2.iso 
185f9167fb4c2208380e769d6668285d  cpu2006-1.2.iso

docker安装

https://download.csdn.net/download/hknaruto/86608404

gcc4镜像

root@yeqiang-greatwall:~# docker pull gcc:4
4: Pulling from library/gcc
e91a355b0d3f: Pull complete 
16e054bfb022: Pull complete 
498121800d24: Pull complete 
39f6cc0761da: Pull complete 
771c6f7e9958: Pull complete 
2257a24fdd87: Pull complete 
20bf3e0a5329: Pull complete 
1d7d21146b13: Pull complete 
Digest: sha256:6356ef8b29cc3522527a85b6c58a28626744514bea87a10ff2bf67599a7474f5
Status: Downloaded newer image for gcc:4

验证可用

root@yeqiang-greatwall:/home/yeqiang/桌面# docker run --rm -it gcc:4 /bin/bash
root@c20e8a50b277:/# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/aarch64-linux-gnu/4.9.4/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /usr/src/gcc/configure --build=aarch64-linux-gnu --disable-multilib --enable-languages=c,c++,fortran,go
Thread model: posix
gcc version 4.9.4 (GCC) 
root@c20e8a50b277:/# uname -a
Linux c20e8a50b277 5.4.18-80.43.2-generic #GWOEM SMP Wed Mar 9 14:13:16 CST 2022 aarch64 GNU/Linux

编译spec cpu 2006

宿主机解压出spec cpu 2006

root@yeqiang-greatwall:/home/yeqiang/Downloads# mkdir /mnt/iso/ -p
root@yeqiang-greatwall:/home/yeqiang/Downloads# mount cpu2006-1.2.iso /mnt/iso/
mount: /mnt/iso: WARNING: device write-protected, mounted read-only.
root@yeqiang-greatwall:/home/yeqiang/Downloads# cp /mnt/iso cpu2006-1.2-setup -r

---------------------------------------------------------------------------------------------------------------

注意,如果直接安装会报以下错误

root@yeqiang-greatwall:/home/yeqiang/Downloads# cd /mnt/iso/
root@yeqiang-greatwall:/mnt/iso# bash install.sh -d /opt/speccpu2006

提示:

We do not appear to have working vendor-supplied binaries for your
architecture.  You will have to compile the tool binaries by
yourself.  Please read the file

    /opt/speccpu2006/Docs/tools-build.html

for instructions on how you might be able to build them.

Please only attempt this as a last resort.

且/opt/speccpu2006目录为空

---------------------------------------------------------------------------------------------------------------

tools补丁

fix.patch

diff -Npr /mnt/speccpu2006/tools/src/buildtools ./buildtools
*** /mnt/speccpu2006/tools/src/buildtools	Sat Apr  9 04:41:02 2011
--- ./buildtools	Wed Jun 21 00:30:56 2023
*************** if [ -n "$DOTAR" ] || [ -z "$SKIPNONPERL
*** 226,232 ****
      LIBS="$ALLLIBS $TARLIBS"; export LIBS
      ./configure $CONFIGFLAGS $TARFLAGS --with-xz=specxz --prefix=$INSTALLDIR; testordie "error configuring tar"
      $MYMAKE; testordie "error building tar"
!     MAKEFLAGS= $MYMAKE check; testordie "error testing tar"
      MAKEFLAGS= $MYMAKE install; testordie "error installing tar")
  fi
  
--- 226,232 ----
      LIBS="$ALLLIBS $TARLIBS"; export LIBS
      ./configure $CONFIGFLAGS $TARFLAGS --with-xz=specxz --prefix=$INSTALLDIR; testordie "error configuring tar"
      $MYMAKE; testordie "error building tar"
! #    MAKEFLAGS= $MYMAKE check; testordie "error testing tar"
      MAKEFLAGS= $MYMAKE install; testordie "error installing tar")
  fi
  
*************** if [ -n "$DOPERL" ] || [ -z "$SKIPPERL"
*** 355,365 ****
      LD_LIBRARY_PATH=`pwd`
      DYLD_LIBRARY_PATH=`pwd`
      export LD_LIBRARY_PATH DYLD_LIBRARY_PATH
!     ./Configure -dOes -Ud_flock $PERLFLAGS -Ddosuid=undef -Dprefix=$INSTALLDIR -Dd_bincompat3=undef -A ldflags=-L${INSTALLDIR}/lib -A ccflags=-I${INSTALLDIR}/include -Ui_db -Ui_gdbm -Ui_ndbm -Ui_dbm -Uuse5005threads ; testordie "error configuring perl"
      $MYMAKE; testordie "error building Perl"
      ./perl installperl; testordie "error installing Perl"
      setspecperllib
!     MAKEFLAGS= $MYMAKE test
      if [ $? -ne 0 ]; then
        set +x
        echo
--- 355,366 ----
      LD_LIBRARY_PATH=`pwd`
      DYLD_LIBRARY_PATH=`pwd`
      export LD_LIBRARY_PATH DYLD_LIBRARY_PATH
!     ./Configure -dOes -Ud_flock $PERLFLAGS -Ddosuid=undef -Dprefix=$INSTALLDIR -Dd_bincompat3=undef -A ldflags='-L${INSTALLDIR}/lib -lm' -A ccflags=-I${INSTALLDIR}/include -Ui_db -Ui_gdbm -Ui_ndbm -Ui_dbm -Uuse5005threads ; testordie "error configuring perl"
      $MYMAKE; testordie "error building Perl"
      ./perl installperl; testordie "error installing Perl"
      setspecperllib
! #    MAKEFLAGS= $MYMAKE test
!     true
      if [ $? -ne 0 ]; then
        set +x
        echo
*************** if [ -n "$DOPERL2" ] || [ -z "$SKIPPERL2
*** 421,427 ****
        # The tests are done after the install; because of the lib path munging,
        # the tests will actually use the installed modules.  It doesn't really
        # matter either way -- if the test fails, the whole run is scrapped.
!       [ -f $i/spec_do_no_tests ] || ($MYMAKE test; testordie "error running $i test suite")
        )
      done
  
--- 422,428 ----
        # The tests are done after the install; because of the lib path munging,
        # the tests will actually use the installed modules.  It doesn't really
        # matter either way -- if the test fails, the whole run is scrapped.
! #      [ -f $i/spec_do_no_tests ] || ($MYMAKE test; testordie "error running $i test suite")
        )
      done
  
diff -Npr /mnt/speccpu2006/tools/src/make-3.82/glob/glob.c ./make-3.82/glob/glob.c
*** /mnt/speccpu2006/tools/src/make-3.82/glob/glob.c	Fri Mar  4 06:29:36 2011
--- ./make-3.82/glob/glob.c	Tue Jun 20 18:18:45 2023
*************** my_realloc (p, n)
*** 208,214 ****
  #endif /* __GNU_LIBRARY__ || __DJGPP__ */
  
  
! #if !defined __alloca && !defined __GNU_LIBRARY__
  
  # ifdef	__GNUC__
  #  undef alloca
--- 208,214 ----
  #endif /* __GNU_LIBRARY__ || __DJGPP__ */
  
  
! // #if !defined __alloca && !defined __GNU_LIBRARY__
  
  # ifdef	__GNUC__
  #  undef alloca
*************** extern char *alloca ();
*** 229,235 ****
  
  # define __alloca	alloca
  
! #endif
  
  #ifndef __GNU_LIBRARY__
  # define __stat stat
--- 229,235 ----
  
  # define __alloca	alloca
  
! // #endif
  
  #ifndef __GNU_LIBRARY__
  # define __stat stat
diff -Npr /mnt/speccpu2006/tools/src/specsum/gnulib/stdio.in.h ./specsum/gnulib/stdio.in.h
*** /mnt/speccpu2006/tools/src/specsum/gnulib/stdio.in.h	Fri Mar  4 06:29:36 2011
--- ./specsum/gnulib/stdio.in.h	Tue Jun 20 18:25:39 2023
*************** _GL_WARN_ON_USE (fflush, "fflush is not
*** 159,165 ****
     so any use of gets warrants an unconditional warning.  Assume it is
     always declared, since it is required by C89.  */
  #undef gets
! _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
  
  #if @GNULIB_FOPEN@
  # if @REPLACE_FOPEN@
--- 159,165 ----
     so any use of gets warrants an unconditional warning.  Assume it is
     always declared, since it is required by C89.  */
  #undef gets
! // _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
  
  #if @GNULIB_FOPEN@
  # if @REPLACE_FOPEN@
diff -Npr /mnt/speccpu2006/tools/src/tar-1.25/gnu/stdio.in.h ./tar-1.25/gnu/stdio.in.h
*** /mnt/speccpu2006/tools/src/tar-1.25/gnu/stdio.in.h	Fri Mar  4 06:29:36 2011
--- ./tar-1.25/gnu/stdio.in.h	Tue Jun 20 18:24:35 2023
*************** _GL_WARN_ON_USE (fflush, "fflush is not
*** 144,150 ****
     so any use of gets warrants an unconditional warning.  Assume it is
     always declared, since it is required by C89.  */
  #undef gets
! _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
  
  #if @GNULIB_FOPEN@
  # if @REPLACE_FOPEN@
--- 144,150 ----
     so any use of gets warrants an unconditional warning.  Assume it is
     always declared, since it is required by C89.  */
  #undef gets
! // _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
  
  #if @GNULIB_FOPEN@
  # if @REPLACE_FOPEN@

打补丁

root@yeqiang-greatwall:/home/yeqiang/下载/cpu2006-1.2-setup# cd tools/src/
root@yeqiang-greatwall:/home/yeqiang/下载/cpu2006-1.2-setup/tools/src# patch -p0 < /home/yeqiang/Downloads/fix.patch 
patching file ./buildtools
patching file ./make-3.82/glob/glob.c
patching file ./specsum/gnulib/stdio.in.h
patching file ./tar-1.25/gnu/stdio.in.h

启动docker

root@yeqiang-greatwall:/home/yeqiang/Downloads# docker run --name build-speccpu2006 -it -v $(pwd)/cpu2006-1.2-setup:/cpu2006-1.2-setup gcc:4 /bin/bash
root@197be7a54cbe:/# cd /cpu2006-1.2-setup/
root@197be7a54cbe:/cpu2006-1.2-setup#

编译tools(docker内)

root@197be7a54cbe:~# cd /cpu2006-1.2-setup/
root@197be7a54cbe:/cpu2006-1.2-setup# source shrc

WARNING: this benchmark tree has not yet been installed.  Please
         run install.sh before continuing.

root@197be7a54cbe:/cpu2006-1.2-setup# export CONFIGFLAGS=--build=aarch64-unknown-linux
root@197be7a54cbe:/cpu2006-1.2-setup# export FORCE_UNSAFE_CONFIGURE=1
root@197be7a54cbe:/cpu2006-1.2-setup# cd tools/src/
root@197be7a54cbe:/cpu2006-1.2-setup/tools/src# bash buildtools

编译完成,提示

Top of SPEC benchmark tree is '/cpu2006-1.2-setup'
Tools built successfully.  Go to the top of the tree and
source the shrc file.  Then you should be ready.

gcc.cfg静态编译补丁(宿主机)

gcc.cfg.patch

*** Example-linux64-amd64-gcc43+.cfg	2023-07-18 09:31:17.885512189 +0800
--- gcc.cfg	2023-07-18 10:25:33.524791992 +0800
*************** default=default=default=default:
*** 79,85 ****
  CC                 = /usr/bin/gcc
  CXX                = /usr/bin/g++
  FC                 = /usr/bin/gfortran
! 
  ## HW config
  # default sysinfo is expected to write hw_cpu_name, hw_memory, hw_nchips,
  # hw_disk
--- 79,85 ----
  CC                 = /usr/bin/gcc
  CXX                = /usr/bin/g++
  FC                 = /usr/bin/gfortran
! makeflags          = -j8
  ## HW config
  # default sysinfo is expected to write hw_cpu_name, hw_memory, hw_nchips,
  # hw_disk
*************** notes_os_000 ='ulimit -s unlimited' was
*** 127,135 ****
  #####################################################################
  
  default=base=default=default:
! COPTIMIZE   = -O2 -fno-strict-aliasing
! CXXOPTIMIZE = -O2 -fno-strict-aliasing
! FOPTIMIZE   = -O2 -fno-strict-aliasing
  
  #####################################################################
  # 32/64 bit Portability Flags - all
--- 127,135 ----
  #####################################################################
  
  default=base=default=default:
! COPTIMIZE   = -O2 -fno-strict-aliasing -static
! CXXOPTIMIZE = -O2 -fno-strict-aliasing -static
! FOPTIMIZE   = -O2 -fno-strict-aliasing -static
  
  #####################################################################
  # 32/64 bit Portability Flags - all

打补丁

root@yeqiang-greatwall:/home/yeqiang/Downloads/cpu2006-1.2-setup/tools/src# cd /home/yeqiang/Downloads/cpu2006-1.2-setup/config/
root@yeqiang-greatwall:/home/yeqiang/Downloads/cpu2006-1.2-setup/config# cp Example-linux64-amd64-gcc43+.cfg gcc.cfg
root@yeqiang-greatwall:/home/yeqiang/Downloads/cpu2006-1.2-setup/config# patch -p0 < /home/yeqiang/Downloads/gcc.cfg.patch 
patching file gcc.cfg

静态编译用例(docker内)

静态编译的目的是为了能在宿主系统上正常运行起来

root@197be7a54cbe:/cpu2006-1.2-setup# ln -s /usr/bin/gcc-4.9 /usr/bin/gcc
root@197be7a54cbe:/cpu2006-1.2-setup# ln -s /usr/bin/g++-4.9 /usr/bin/g++
root@197be7a54cbe:/cpu2006-1.2-setup# ln -s /usr/local/bin/gfortran /usr/bin/gfortran
root@197be7a54cbe:/cpu2006-1.2-setup# cd /cpu2006-1.2-setup/
root@197be7a54cbe:/cpu2006-1.2-setup# source shrc
root@197be7a54cbe:/cpu2006-1.2-setup# runspec --action=build -c gcc.cfg -T all -I -i ref all int fp

编译完成

Build Complete

The log for this run is in /cpu2006-1.2-setup/result/CPU2006.006.log

runspec finished at Tue Jul 18 02:37:36 2023; 346 total seconds elapsed

运行测试(宿主机)

针对d2000修改gcc.cfg bind

​
bind0  = numactl -m 0 --physcpubind=0
bind1  = numactl -m 0 --physcpubind=1
bind2  = numactl -m 0 --physcpubind=2
bind3  = numactl -m 0 --physcpubind=3
bind4  = numactl -m 0 --physcpubind=4
bind5  = numactl -m 0 --physcpubind=5
bind6  = numactl -m 0 --physcpubind=6
bind7  = numactl -m 0 --physcpubind=7

​
root@yeqiang-greatwall:/home/yeqiang/Downloads/cpu2006-1.2-setup# cd /home/yeqiang/Downloads/cpu2006-1.2-setup
root@yeqiang-greatwall:/home/yeqiang/Downloads/cpu2006-1.2-setup# source shrc
root@yeqiang-greatwall:/home/yeqiang/Downloads/cpu2006-1.2-setup# ulimit -s unlimited
root@yeqiang-greatwall:/home/yeqiang/Downloads/cpu2006-1.2-setup# runspec -c gcc.cfg -T base -I -i ref all -n 1 -r 8 int

报错

bash: /home/yeqiang/Downloads/cpu2006-1.2-setup/bin/runspec: /cpu2006-1.2-setup/bin/specperl: bad interpreter: No such file or directory

原因:docker内的路径与宿主机路径不一致,关闭docker容器,宿主机执行移动操作

退出容器

root@197be7a54cbe:/cpu2006-1.2-setup# exit
exit
root@yeqiang-greatwall:/home/yeqiang/Downloads# docker rm build-speccpu2006
build-speccpu2006

移动目标目录

root@yeqiang-greatwall:/home/yeqiang/Downloads# mv cpu2006-1.2-setup/ /

再次测试

root@yeqiang-greatwall:/home/yeqiang/Downloads# cd /cpu2006-1.2-setup/
root@yeqiang-greatwall:/cpu2006-1.2-setup# source shrc
root@yeqiang-greatwall:/cpu2006-1.2-setup# ulimit -s unlimited
root@yeqiang-greatwall:/cpu2006-1.2-setup# runspec -c gcc.cfg -T base -I -i ref all -n 1 -r 8 int

可运行

由此得出:采用此方式编译speccpu2006未经过install.sh过程,一开始就应该保持宿主与容器speccpu2006目标目录的一致性,本文路径:/cpu2006-1.2-setup。

中途报错,完整日志

root@yeqiang-greatwall:/cpu2006-1.2-setup# runspec -c gcc.cfg -T base -I -i ref all -n 1 -r 8 int
runspec v6674 - Copyright 1999-2011 Standard Performance Evaluation Corporation
Using 'unknown' tools
Reading MANIFEST... 19896 files
Loading runspec modules................
Locating benchmarks...found 31 benchmarks in 6 benchsets.
Reading config file '/cpu2006-1.2-setup/config/gcc.cfg'
Running "specperl /cpu2006-1.2-setup/Docs/sysinfo" to gather system information.
Loading "http://www.spec.org/auto/cpu2006/current_version" for version check: OK
Reportable runs must include a 'test' run; adding to run list
Reportable runs must include a 'train' run; adding to run list
Retrieving flags file (/cpu2006-1.2-setup/config/flags/Example-gcc4x-flags-revA.xml)...
Retrieving flags file (/cpu2006-1.2-setup/config/flags/Example-linux-platform-revA.xml)...
Benchmarks selected: 400.perlbench, 401.bzip2, 403.gcc, 429.mcf, 445.gobmk, 456.hmmer, 458.sjeng, 462.libquantum, 464.h264ref, 471.omnetpp, 473.astar, 483.xalancbmk, 999.specrand, 410.bwaves, 416.gamess, 433.milc, 434.zeusmp, 435.gromacs, 436.cactusADM, 437.leslie3d, 444.namd, 447.dealII, 450.soplex, 453.povray, 454.calculix, 459.GemsFDTD, 465.tonto, 470.lbm, 481.wrf, 482.sphinx3, 998.specrand

Notice: Errors may not be ignored for reportable runs.
Compiling Binaries
  Up to date 400.perlbench base gcc43-64bit default
  Up to date 401.bzip2 base gcc43-64bit default
  Up to date 403.gcc base gcc43-64bit default
  Up to date 429.mcf base gcc43-64bit default
  Up to date 445.gobmk base gcc43-64bit default
  Up to date 456.hmmer base gcc43-64bit default
  Up to date 458.sjeng base gcc43-64bit default
  Up to date 462.libquantum base gcc43-64bit default
  Up to date 464.h264ref base gcc43-64bit default
  Up to date 471.omnetpp base gcc43-64bit default
  Up to date 473.astar base gcc43-64bit default
  Up to date 483.xalancbmk base gcc43-64bit default
  Up to date 999.specrand base gcc43-64bit default
  Up to date 410.bwaves base gcc43-64bit default
  Up to date 416.gamess base gcc43-64bit default
  Up to date 433.milc base gcc43-64bit default
  Up to date 434.zeusmp base gcc43-64bit default
  Up to date 435.gromacs base gcc43-64bit default
  Up to date 436.cactusADM base gcc43-64bit default
  Up to date 437.leslie3d base gcc43-64bit default
  Up to date 444.namd base gcc43-64bit default
  Up to date 447.dealII base gcc43-64bit default
  Up to date 450.soplex base gcc43-64bit default
  Up to date 453.povray base gcc43-64bit default
  Up to date 454.calculix base gcc43-64bit default
  Up to date 459.GemsFDTD base gcc43-64bit default
  Up to date 465.tonto base gcc43-64bit default
  Up to date 470.lbm base gcc43-64bit default
  Up to date 481.wrf base gcc43-64bit default
  Up to date 482.sphinx3 base gcc43-64bit default
  Up to date 998.specrand base gcc43-64bit default


Running Benchmarks (up to 8 concurrent processes)
  Running 400.perlbench test base gcc43-64bit default
  Running 401.bzip2 test base gcc43-64bit default
  Running 403.gcc test base gcc43-64bit default
  Running 429.mcf test base gcc43-64bit default
  Running 445.gobmk test base gcc43-64bit default
  Running 456.hmmer test base gcc43-64bit default
  Running 458.sjeng test base gcc43-64bit default
  Running 462.libquantum test base gcc43-64bit default
  Running 464.h264ref test base gcc43-64bit default
  Running 471.omnetpp test base gcc43-64bit default
  Running 473.astar test base gcc43-64bit default
  Running 483.xalancbmk test base gcc43-64bit default
  Running 999.specrand test base gcc43-64bit default
  Running 410.bwaves test base gcc43-64bit default
  Running 416.gamess test base gcc43-64bit default
  Running 433.milc test base gcc43-64bit default
  Running 434.zeusmp test base gcc43-64bit default
ERROR: Run for 416.gamess test base gcc43-64bit default FAILED (exit code 1).
        See the log file for details.

Waiting for subprocesses to exit...
ERROR: do_exit for 464.h264ref test base gcc43-64bit default FAILED (exit code 1).
        See the log file for details.

The log for this run is in /cpu2006-1.2-setup/result/CPU2006.007.log
The debug log for this run is in /cpu2006-1.2-setup/result/CPU2006.007.log.debug

*
* Temporary files were NOT deleted; keeping temporaries such as
* /cpu2006-1.2-setup/result/CPU2006.007.log.debug and
* /cpu2006-1.2-setup/tmp/CPU2006.007
* (These may be large!)
*
runspec finished at Tue Jul 18 10:52:04 2023; 75 total seconds elapsed

分析debug日志

1689648687.91: 1689648687.79: *** Miscompare of exam29.out; for details see
1689648687.91: 1689648687.79:     /cpu2006-1.2-setup/benchspec/CPU2006/416.gamess/run/run_base_test_gcc43-64bit.0000/exam29.out.mis
1689648687.91: 1689648687.79: 0423:     1  0  0     -228.438026762  -228.438026762   0.585016182   0.000000000
1689648687.91: 1689648687.79:           1  0  0     -228.438026762  -228.438026762   2.057216987   0.000000000
1689648687.91: 1689648687.79:                                                                  ^
1689648687.91: 1689648687.79: 0424:            ---------------START SECOND ORDER SCF---------------
1689648687.91: 1689648687.79:           2  1  0      -13.398272306   215.039754456   0.019611730   2.138165837
1689648687.91: 1689648687.79:        ^
1689648687.91: 1689648687.79: 0425:     2  1  0     -228.975183270    -0.537156507   0.141897260   0.111481465
1689648687.91: 1689648687.79:                  ---------------START SECOND ORDER SCF---------------
1689648687.91: 1689648687.79:        ^
1689648687.91: 1689648687.79: 0426:     3  2  0     -229.014081256    -0.038897986   0.064028396   0.079634004
1689648687.91: 1689648687.79:           3  2  0      -13.404086244    -0.005813938   0.000644098   0.008801378
1689648687.91: 1689648687.79:                                    ^
1689648687.91: 1689648687.79: 0427:     4  3  0     -229.036210679    -0.022129423   0.025840433   0.007697238
1689648687.91: 1689648687.79:           4  3  0      -13.404093666    -0.000007422   0.000028154   0.000448854
1689648687.91: 1689648687.79:                                    ^
1689648687.91: 1689648687.79: 0428:     5  4  0     -229.036777024    -0.000566345   0.008639408   0.001874192
1689648687.91: 1689648687.79:           5  4  0      -13.404093683    -0.000000017   0.000000370   0.000004470
1689648687.91: 1689648687.79:                                    ^
1689648687.91: 1689648687.79: 0429:     6  5  0     -229.036824895    -0.000047871   0.001734717   0.000979860
1689648687.91: 1689648687.79:           6  5  0      -13.404093683    -0.000000000   0.000000008   0.000000051
1689648687.91: 1689648687.79:                                    ^
1689648687.91: 1689648687.79: 0431:     7  6  0     -229.036831711    -0.000006816   0.000315932   0.000297576
1689648687.91: 1689648687.79:                  -----------------
1689648687.91: 1689648687.79:        ^
1689648687.91: 1689648687.79: 0432:     8  7  0     -229.036832335    -0.000000624   0.000112760   0.000083271
1689648687.91: 1689648687.79:                  DENSITY CONVERGED
1689648687.91: 1689648687.79:        ^
1689648687.91: 1689648687.79: 0433:     9  8  0     -229.036832426    -0.000000092   0.000074046   0.000042607
1689648687.91: 1689648687.79:                  -----------------
1689648687.91: 1689648687.79:        ^
1689648687.91: 1689648687.79: Benchmark Times:
1689648687.91: 1689648687.79:   Start:    Tue Jul 18 10:51:26 2023 (1689648686)
1689648687.91: 1689648687.79:   Stop:     Tue Jul 18 10:51:26 2023 (1689648686)
1689648687.91: 1689648687.79:   Elapsed:  00:00:00 (0)
1689648687.91: 1689648687.79:   Reported: 0 48422000 0.048422
1689648687.91: 1689648687.79:  Error 416.gamess base test ratio=-0.00, runtime=0.048422, power=0.00w, temp=0.00 deg, humidity=0.00%
1689648687.91: 1689648687.79: Invalid run; unable to continue.
1689648687.91: 1689648687.79: If you wish to ignore errors please use '-I' or ignore_errors
1689648687.91: REAPER reaped 171607 (rc was 256)
1689648687.91: check_children(Run): kill says 1 about 171314
1689648687.91: check_children(Run): reporting on 171607
1689648687.91: ERROR: Run for 416.gamess test base gcc43-64bit default FAILED (exit code 1).
1689648687.91:         See the log file for details.

经测试,docker gcc:4容器内也报此错误

手动执行

root@1903469d91ae:/cpu2006-1.2-setup/benchspec/CPU2006/416.gamess/run/run_base_test_gcc43-64bit.0000# /cpu2006-1.2-setup/bin/specinvoke -E -d /cpu2006-1.2-setup/benchspec/CPU2006/416.gamess/run/run_base_test_gcc43-64bit.0000 -c 1 -e compare.err -o compare.stdout -f compare.cmd
root@1903469d91ae:/cpu2006-1.2-setup/benchspec/CPU2006/416.gamess/run/run_base_test_gcc43-64bit.0000# echo $?
1

返回值为1,与日志想同。

一顿百度,发现还是gcc版本高了。CPU SPEC 2006 416.gamess 报错 ABRT_speccpu2006 416测试项报错_朱乐乐在路上的博客-CSDN博客

待续。。。

参考资料

runspec (CPU2006)

<think>我们面对的任务是在飞腾D2000平台ARM架构)的麒麟系统上,使用Dhrystone工具对每个CPU核心进行单独跑分。 步骤分析: 1. 获取Dhrystone源码并编译:由于Dhrystone是一个经典的基准测试程序,我们需要先获取其源代码,然后针对ARM架构进行编译2. 确保系统环境:确认系统已安装必要的编译工具(如gcc)。 3. 绑定进程到特定核心:为了单独测试每个核心,我们需要将Dhrystone进程绑定到特定的CPU核心上运行。这可以通过`taskset`命令来实现。 4. 运行测试并记录结果:对每个核心依次运行测试,并记录跑分结果。 具体步骤: ### 1. 安装编译工具 确保系统已安装gcc编译器。在终端中执行: ```bash sudo apt update sudo apt install gcc ``` ### 2. 下载Dhrystone源码 可以从网上获取Dhrystone的C语言源码,例如: ```bash wget http://www.netlib.org/benchmark/dhrystone.c ``` 或者使用其他来源(注意:由于网络原因,可能需要寻找可用的源)。 ### 3. 编译Dhrystone 使用gcc编译源码,生成可执行文件: ```bash gcc -O3 -o dhrystone dhrystone.c ``` 这里使用`-O3`优化选项以获得最佳性能。 ### 4. 确认CPU核心数量 使用以下命令查看系统有多少个CPU核心: ```bash nproc ``` 或者 ```bash lscpu ``` 假设飞腾D2000有8个核心(具体以实际为准)。 ### 5. 对每个核心单独测试 使用`taskset`命令将进程绑定到指定核心运行。核心编号从0开始(例如0-7)。 例如,测试核心0: ```bash taskset -c 0 ./dhrystone ``` 测试核心1: ```bash taskset -c 1 ./dhrystone ``` 以此类推。 我们可以编写一个简单的脚本来循环测试所有核心: ```bash #!/bin/bash # 获取核心数量 cores=$(nproc) for ((core=0; core<cores; core++)); do echo "Testing core $core" taskset -c $core ./dhrystone | tee "dhrystone_core_$core.log" done ``` 这个脚本会依次在每个核心上运行Dhrystone,并将输出保存到各自的日志文件中。 ### 6. 解析结果 Dhrystone运行后会输出DMIPS(Dhrystone MIPS)值,我们可以从日志文件中提取这个值。 注意:Dhrystone的版本可能不同,输出格式也可能有差异,需要根据实际输出来提取结果。 示例输出: ``` Dhrystone Benchmark, Version 2.1 (Language: C) Program compiled without 'register' attribute Please give the number of runs through the benchmark: Execution starts, 100000000 runs through Dhrystone Execution ends Final values of the variables used in the benchmark: Int_Glob: 5 should be: 5 Bool_Glob: 1 should be: 1 Ch_1_Glob: A should be: A Ch_2_Glob: B should be: B Arr_1_Glob[8]: 7 should be: 7 Arr_2_Glob[8][7]: 100000010 should be: Number_Of_Runs + 10 Ptr_Glob-> Ptr_Comp: 0 should be: (implementation-dependent) Discr: 0 should be: 0 Enum_Comp: 2 should be: 2 Int_Comp: 17 should be: 17 Str_Comp: DHRYSTONE PROGRAM, SOME STRING should be: DHRYSTONE PROGRAM, SOME STRING Next_Ptr_Comp: 0 should be: (implementation-dependent), same as above Microseconds for one run through Dhrystone: 0.1 Dhrystones per Second: 10000000.0 DMIPS: 5698.2 ``` 我们关注的是“Dhrystones per Second”或“DMIPS”的值。 ### 注意事项 - 在运行测试时,确保系统没有其他高负载任务,以免影响结果。 - 可能需要多次运行取平均值以提高准确性。 - 不同版本的Dhrystone可能有不同的输出格式,请根据实际情况调整解析方法。 如果遇到问题,可以尝试以下替代方案: 1. 使用`perf`工具进行更详细的性能分析。 2. 使用其他基准测试工具(如sysbench)进行补充测试。 希望这些步骤能帮助你在飞腾D2000平台上完成每个核心的Dhrystone测试。 §§相关问题§§ 1. 如何解析Dhrystone的输出结果以获取每个核心的DMIPS值? 2. 除了Dhrystone,还有哪些工具可以测试ARM架构CPU的单核性能? 3. 在麒麟系统上,如何监控测试过程中每个核心的负载情况? 4. 如何确保测试结果的准确性(例如,避免其他进程干扰)?</think>### 在飞腾D2000 ARM架构麒麟系统运行Dhrystone的步骤 #### 1. **安装编译环境** ```bash sudo apt update sudo apt install gcc make -y # 安装编译工具链 ``` #### 2. **获取Dhrystone源码** ```bash wget https://fossies.org/linux/privat/old/dhrystone-2.1.tar.gz tar -xzvf dhrystone-2.1.tar.gz cd dhrystone-2.1 ``` #### 3. **编译ARM版本** ```bash gcc -O3 -o dhrystone dhry_1.c dhry_2.c -DARM # 启用ARM优化 ``` #### 4. **确认CPU核心数** ```bash nproc # 查看总核心数(飞腾D2000通常为8核) cat /proc/cpuinfo | grep "processor" # 列出所有核心ID ``` #### 5. **单核心测试脚本** 创建测试脚本 `run_dhrystone.sh`: ```bash #!/bin/bash TOTAL_CORES=$(nproc) for core in $(seq 0 $((TOTAL_CORES-1))); do echo "测试核心 $core ..." taskset -c $core ./dhrystone > core_${core}_result.txt 2>&1 & sleep 1 # 避免瞬时负载冲突 wait done echo "所有核心测试完成!" ``` #### 6. **执行测试** ```bash chmod +x run_dhrystone.sh ./run_dhrystone.sh # 需要root权限 ``` #### 7. **查看结果** ```bash grep "Dhrystones per Second" core_*_result.txt ``` #### 关键参数说明: - **`taskset -c N`**:将进程绑定到指定核心(N=0~7) - **`-O3`**:启用最高级别编译优化 - **`-DARM`**:启用ARM架构特定优化 - 输出文件命名格式:`core_0_result.txt` ~ `core_7_result.txt` > **注意**: > 1. 测试前关闭其他高负载进程 > 2. 建议重复3次测试取平均值 > 3. 飞腾D2000ARMv8架构需确保gcc版本≥8.0 > 4. 麒麟系统需开启性能模式:`sudo cpupower frequency-set -g performance`
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值