UnixBench5.1.3 图形性能测试 ubgears.c:(.text+0x66d): undefined reference to `sincos‘

启动图形性能测试支持

GRAPHIC_TESTS=1 make

故障

gcc -o ./pgms/ubgears -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/ubgears.c -lGL -lXext -lX11
/usr/bin/ld: /tmp/ccE1c4UY.o: in function `gear.constprop.1':
ubgears.c:(.text+0x587): undefined reference to `sincos'
/usr/bin/ld: ubgears.c:(.text+0x66d): undefined reference to `sincos'
/usr/bin/ld: ubgears.c:(.text+0x739): undefined reference to `sincos'
/usr/bin/ld: ubgears.c:(.text+0x7af): undefined reference to `sincos'
/usr/bin/ld: ubgears.c:(.text+0x80e): undefined reference to `sincos'
/usr/bin/ld: /tmp/ccE1c4UY.o:ubgears.c:(.text+0x866): more undefined references to `sincos' follow
/usr/bin/ld: /tmp/ccE1c4UY.o: in function `gear.constprop.1':
ubgears.c:(.text+0x10f6): undefined reference to `sincosf'
/usr/bin/ld: ubgears.c:(.text+0x1136): undefined reference to `sincos'
collect2: error: ld returned 1 exit status

解决方案

修改Makefile GL_LIBS,差异如下

*** Makefile    2022-04-18 11:35:59.423467216 +0800
--- Makefile.bak        2022-04-18 11:35:52.491163276 +0800
*************** SHELL = /bin/sh
*** 47,53 ****
  # GRAPHIC_TESTS = defined
  
  # Set "GL_LIBS" to the libraries needed to link a GL program.
! GL_LIBS = -lGL -lXext -lX11 -lm
  
  
  # COMPILER CONFIGURATION: Set "CC" to the name of the compiler to use
--- 47,53 ----
  # GRAPHIC_TESTS = defined
  
  # Set "GL_LIBS" to the libraries needed to link a GL program.
! GL_LIBS = -lGL -lXext -lX11
  
  
  # COMPILER CONFIGURATION: Set "CC" to the name of the compiler to use

开始图形性能测试

./Run graphics
make all
make[1]: 进入目录“/home/yeqiang/Downloads/src/UnixBench”
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./tmp  exists
./results  exists
make[1]: 离开目录“/home/yeqiang/Downloads/src/UnixBench”
sh: 1: 3dinfo: not found

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com

Wide character in print at ./Run line 1511.
Wide character in printf at ./Run line 1542.

1 x 2D graphics: rectangles  1 2 3

1 x 2D graphics: ellipses  1 2 3

1 x 2D graphics: aa polygons  1 2 3

1 x 2D graphics: text  1 2 3

1 x 2D graphics: images and blits  1 2 3

1 x 2D graphics: windows  1 2 3

1 x 3D graphics: gears  1 2 3
Wide character in printf at ./Run line 1484.
Wide character in printf at ./Run line 1484.

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: yeqiang-PC: GNU/Linux
   OS: GNU/Linux -- 5.10.60-amd64-desktop -- #3 SMP Tue Nov 9 20:52:29 CST 2021
   Machine: x86_64 (unknown)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   CPU 1: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   CPU 2: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   CPU 3: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   CPU 4: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   CPU 5: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   11:11:07 up  3:19,  2 users,  load average: 1.11, 1.80, 1.98; runlevel 5

------------------------------------------------------------------------
Benchmark Run: 一 4月 18 2022 11:11:07 - 11:29:14
6 CPUs in system; running 1 parallel copy of tests

2D graphics: aa polygons                     137885.3 score (60.3 s, 2 samples)
2D graphics: ellipses                          4963.1 score (52.5 s, 2 samples)
2D graphics: images and blits               1773643.1 score (56.2 s, 2 samples)
2D graphics: rectangles                       55366.1 score (57.4 s, 2 samples)
2D graphics: text                            342006.2 score (37.2 s, 2 samples)
2D graphics: windows                           1976.8 score (51.2 s, 2 samples)
3D graphics: gears                               60.1 fps   (20.0 s, 2 samples)

2D Graphics Benchmarks Index Values          BASELINE       RESULT    INDEX
2D graphics: aa polygons                         15.0     137885.3  91923.5
2D graphics: ellipses                            15.0       4963.1   3308.7
2D graphics: images and blits                    15.0    1773643.1 1182428.7
2D graphics: rectangles                          15.0      55366.1  36910.8
2D graphics: text                                15.0     342006.2 228004.1
2D graphics: windows                             15.0       1976.8   1317.8
                                                                   ========
2D Graphics Benchmarks Index Score                                  39823.3

3D Graphics Benchmarks Index Values          BASELINE       RESULT    INDEX
3D graphics: gears                               33.4         60.1     18.0
                                                                   ========
3D Graphics Benchmarks Index Score                                     18.0

------------------------------------------------------------------------
Benchmark Run: 一 4月 18 2022 11:29:14 - 11:29:14
6 CPUs in system; running 6 parallel copies of tests

注意:默认情况下,图形测试,不支持以下多核测试方法

./Run graphics -c 6

需要修改Run脚本,差异如下

*** Run 2022-04-19 13:45:08.882281336 +0800
--- Run.bak     2022-04-19 11:28:27.887847029 +0800
*************** my $TESTDIR = getDir('UB_TESTDIR', $BASE
*** 107,114 ****
  # Configure the categories to which tests can belong.
  my $testCats = {
      'system'    => { 'name' => "System Benchmarks", 'maxCopies' => 16 },
!     '2d'        => { 'name' => "2D Graphics Benchmarks", 'maxCopies' => 1 },
!     '3d'        => { 'name' => "3D Graphics Benchmarks", 'maxCopies' => 1 },
      'misc'      => { 'name' => "Non-Index Benchmarks", 'maxCopies' => 16 },
  };
  
--- 107,114 ----
  # Configure the categories to which tests can belong.
  my $testCats = {
      'system'    => { 'name' => "System Benchmarks", 'maxCopies' => 16 },
!     '2d'        => { 'name' => "2D Graphics Benchmarks", 'maxCopies' => 6 },
!     '3d'        => { 'name' => "3D Graphics Benchmarks", 'maxCopies' => 6 },
      'misc'      => { 'name' => "Non-Index Benchmarks", 'maxCopies' => 16 },
  };

再次执行即可

yeqiang@yeqiang-PC:~/Downloads/src/UnixBench$ ./Run graphics -c 6
make all
make[1]: 进入目录“/home/yeqiang/Downloads/src/UnixBench”
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./tmp  exists
./results  exists
make[1]: 离开目录“/home/yeqiang/Downloads/src/UnixBench”
sh: 1: 3dinfo: not found

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com

Wide character in print at ./Run line 1511.
Wide character in printf at ./Run line 1542.

6 x 2D graphics: rectangles  1 2 3

6 x 2D graphics: ellipses  1 2 3

6 x 2D graphics: aa polygons  1 2 3

6 x 2D graphics: text  1 2 3

6 x 2D graphics: images and blits  1 2 3

6 x 2D graphics: windows  1 2 3

6 x 3D graphics: gears  1 2 3
Wide character in printf at ./Run line 1484.

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: yeqiang-PC: GNU/Linux
   OS: GNU/Linux -- 5.10.60-amd64-desktop -- #3 SMP Tue Nov 9 20:52:29 CST 2021
   Machine: x86_64 (unknown)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   CPU 1: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   CPU 2: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   CPU 3: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   CPU 4: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   CPU 5: Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (7399.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   11:28:45 up  3:41,  1 user,  load average: 2.21, 2.31, 1.91; runlevel 5

------------------------------------------------------------------------
Benchmark Run: 二 4月 19 2022 11:28:45 - 12:04:48
6 CPUs in system; running 6 parallel copies of tests

2D graphics: aa polygons                     343399.6 score (132.9 s, 2 samples)
2D graphics: ellipses                         11377.5 score (92.6 s, 2 samples)
2D graphics: images and blits               4766773.6 score (82.8 s, 2 samples)
2D graphics: rectangles                      170501.9 score (104.5 s, 2 samples)
2D graphics: text                            874079.1 score (57.3 s, 2 samples)
2D graphics: windows                           6186.1 score (92.3 s, 2 samples)
3D graphics: gears                              360.1 fps   (20.0 s, 2 samples)

2D Graphics Benchmarks Index Values          BASELINE       RESULT    INDEX
2D graphics: aa polygons                         15.0     343399.6 228933.1
2D graphics: ellipses                            15.0      11377.5   7585.0
2D graphics: images and blits                    15.0    4766773.6 3177849.1
2D graphics: rectangles                          15.0     170501.9 113667.9
2D graphics: text                                15.0     874079.1 582719.4
2D graphics: windows                             15.0       6186.1   4124.1
                                                                   ========
2D Graphics Benchmarks Index Score                                 107078.7

3D Graphics Benchmarks Index Values          BASELINE       RESULT    INDEX
3D graphics: gears                               33.4        360.1    107.8
                                                                   ========
3D Graphics Benchmarks Index Score                                    107.8

标签