← All tasks
cppgoogle/benchmark #1556Not a task: not reproduced

[BUG] Release build fails with nvhpc-22.5 (nvc++)

envgap__google__benchmark-1556

01 / FAILURE SIGNATURE

As reported upstream

"[xxxxx]/master_benchmarks/ext/google-benchmark/src/timers.cc", line 86: error: function "benchmark::<unnamed>::MakeTime(const rusage &)" was declared but never referenced
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
f23fedbbf8a581a42b0e480d754f2183cd58d3e9
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

google/benchmark #1556 · read the original issue
**Describe the bug**

I have google benchmark (84c71faa8126e4eedc2bb520352615cb4484d6ad) as dependency in my cmake project. When I trigger a Release build with `-DCMAKE_BUILD_TYPE=Release` using nvhpc-22.5, the build fails because of:



```

"[xxxxx]/master_benchmarks/ext/google-benchmark/src/timers.cc", line 86: error: function "benchmark::<unnamed>::MakeTime(const rusage &)" was declared but never referenced

  double MakeTime(struct rusage const& ru) {

         ^





"[xxxx]/master_benchmarks/ext/google-benchmark/src/benchmark.cc", line 201: error: offsetof applied to a type other than a standard-layout class

    static_assert(offsetof(State, error_occurred_) <=

                           ^

```



Currently I use `set(BENCHMARK_ENABLE_WERROR OFF)` to force the build to pass with warnings.



**System**

Which OS, compiler, and compiler version are you using:

  - OS: `Linux 4.19.0-18-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64 GNU/Linux`

  - Compiler and version: `nvc++ 22.5-0 64-bit target on x86-64 Linux -tp zen`



**To reproduce**

Steps to reproduce the behavior:

1. Use google benchmark (84c71faa8126e4eedc2bb520352615cb4484d6ad) as dependency in cmake

2. run `cmake -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_CXX_COMPILER=nvc++ -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-stdpar=multicore" -S . -B ./cmake-build-debug-nvidia`

3. run build ( I use the command `cmake --build cmake-build-debug-nvidia --target master_benchmarks -j 8`)

4. See error



**Expected behavior**

I expected the build to run without any errors or warnings (since it does so with other compilers e.g. g++)



**Screenshots**

![image](https://user-images.githubusercontent.com/25965672/222701529-72f45b30-1ccc-489b-b0b9-03aa9ecda464.png)



![image](https://user-images.githubusercontent.com/25965672/222701325-e5604673-4235-4bae-a3c4-597f8e0ef672.png)





Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]