0

I am trying to run SPEC2017 benchmarks using llvm testsuite according to LLVM's Test Suite Guide. My cmake command succeeds, but with make, I get errors in include files like numeric_traits.h. I get the error for every occurrence of __is_signal in numeric_traits.h and stl_algobase.h.

CMake command:

$ cmake -DCMAKE_C_COMPILER:STRING="/usr/bin/clang-7" -DCMAKE_CXX_COMPILER:STRING="/usr/bin/clang++-7" -DCMAKE_C_FLAGS="-fPIC" -C../test-suite/cmake/caches/O3.cmake -DTEST_SUITE_SPEC2017_ROOT:STRING="../speccpu2017" ../test-suite
...
$ make
...
In file included from /home/speccpu2017/benchspec/CPU/526.blender_r/src/blender/source/blender/render/intern/raytrace/rayobject_qbvh.cpp:37:
In file included from /home/speccpu2017/benchspec/CPU/526.blender_r/src/blender/source/blender/render/intern/raytrace/vbvh.h:34:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/algorithm:61:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/stl_algobase.h:63:

/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ext/numeric_traits.h:63:25: error: expected member name or ';' after
      declaration specifiers
      static const bool __is_signed = __glibcxx_signed(_Value);
      ~~~~~~~~~~~~~~~~~ ^

/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ext/numeric_traits.h:74:50: error: expected unqualified-id
    const bool __numeric_traits_integer<_Value>::__is_signed;
                                                 ^    
[Long error. Truncated for clarity]

Setup:

  • Clang version 7
  • OS: Ubuntu 18.04
  • linux: 4.18.0-25-generic
  • Spec version: 2017
jww
  • 97,681
  • 90
  • 411
  • 885
kshh23
  • 36
  • 6
  • [Possible source of your problem](https://stackoverflow.com/q/228783/10957435). though without a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) it's impossible to tell. –  Oct 20 '19 at 03:22
  • Is your compiler able to properly compile at all? Have you tried compiling a simple file containing `#include` to make sure? – walnut Oct 20 '19 at 03:37
  • You should use `cmake ... V=1` for the verbose out, which should include compiler options. My guess is - and it is purely a guess - `is_signed` is being called on a custom struct that lacks a numeric conversion. That's because `__glibcxx_signed` is `#define __glibcxx_signed(_Tp) ((_Tp)(-1) < 0)` in `numeric_traits.h`. You should probably switch to `numeric_limits::is_signed` instead of the lightweight helper in `numeric_traits.h`. (Read the headnotes in `/usr/include/c++/8/ext/numeric_traits.h`). – jww Oct 20 '19 at 08:46

1 Answers1

1

Put this into portability flags for CXX https://www.spec.org/cpu2017/Docs/benchmarks/flags/526.blender_r.flags.html#b526.blender_r_D__BOOL_DEFINED

FYI, <SPEC_SRC>/config/Example-clang-llvm-linux-x86.cfg or <SPEC_SRC>/config/Example-aocc-linux-x86.cfg contains Clang-specific portability flags.

kula85
  • 73
  • 1
  • 9