【解决】SPECCPU编译出错“f951: error: argument to '-O' should be a non-negative integer”

交叉编译speccpu2006时,遇到一个错误,把错误现象摘录如下:

1、执行编译命令:runspec --action=build --config=armv8.cfg --rebuild  --tune=base 410

2、编译报错结果:

runspec v6152 - Copyright 1999-2008 Standard Performance Evaluation Corporation
Using 'linux-suse101-AMD64' tools
Reading MANIFEST... 18335 files
Loading runspec modules................
Locating benchmarks...found 31 benchmarks in 6 benchsets.
Reading config file '/home/zql/SPEC_install/config/armv8.cfg'
Loading "http://www.spec.org/auto/cpu2006/current_version" for version check: OK

NOTICE: There is a newer version of the suite available from SPEC.
  Version 1.200 was released on Wed Aug 17 09:10:33 2011
                       ----------------------------------
                       The run will continue in 5 seconds
                       ----------------------------------
Retrieving flags file (/home/zql/SPEC_install/Docs/flags/example-medium-cfg-flags.xml)...
Benchmarks selected: 410.bwaves
Compiling Binaries
  Building 410.bwaves base DL585_08_2005 default: (build_base_DL585_08_2005.0000)
Error with make 'specmake build': check file '/home/zql/SPEC_install/benchspec/CPU2006/410.bwaves/build/build_base_DL585_08_2005.0000/make.err'
  Command returned exit code 2
  Error with make!

*** Error building 410.bwaves
If you wish to ignore this error, please use '-I' or ignore errors.

The log for this run is in /home/zql/SPEC_install/result/CPU2006.010.log
The debug log for this run is in /home/zql/SPEC_install/result/CPU2006.010.log.debug

*
* Temporary files were NOT deleted; keeping temporaries such as
* /home/zql/SPEC_install/result/CPU2006.010.log.debug and
* /home/zql/SPEC_install/tmp/CPU2006.010
* (These may be large!)
*
runspec finished at Tue Feb 19 15:02:12 2013; 8 total seconds elapsed
root@zql-virtual-machine:/home/zql/SPEC_install# vim /home/zql/SPEC_install/benchspec/CPU2006/410.bwaves/build/build_base_DL585_08_2005.0000/make.err


3、问题分析:以上错误信息中的红色部分对我们分析错误是有用的,打开红色部分指定的文件make.err,其中内容如下:

f951: error: argument to '-O' should be a non-negative integer
specmake: *** [block_solver.o] Error 1

4、看来错误原因在于配置文件,我用的交叉编译,需要修改编译工具链,对config文件的修改如下:

CC           = aarch64-linux-gnu-gcc -static
CXX          = aarch64-linux-gnu-g++ -static

FC           = aarch64-linux-gnu-gfortran -static

其他地方不作改动。

5、上面出现的错误猜测和-O优化选项有关,但是尝试删除-O3后还是不对,后来删除了fortran的优化:FOPTIMIZE    = -OPT:div_split=on,问题解决!


可能原因:我的交叉编译工具链不支持fortran的优化,所以这个选项编译工具链不识别!

你可能感兴趣的:(speccpu2006)