Bug#1132300: libbenchmark1.9.1: ***WARNING*** Library was built as DEBUG. Timings may be affected.

Marius Mikucionis mmikucionis at gmail.com
Mon Mar 30 11:10:00 BST 2026


Package: libbenchmark1.9.1
Version: 1.9.1-1+b1
Severity: normal

Dear Maintainer,

I am getting the warning that the benchmark library was built as DEBUG,
which basically defeats the purpose of benchmarking the optimized builds
(the majority of use cases, while debugging the benchmark library is really niche).

I used the following `bm_test.cpp`:

```c++
#include <benchmark/benchmark.h>
#include <string>

static void bm_string(benchmark::State& state) {
  for (auto _ : state) {
    auto text = std::string{"Hello world!"};
    benchmark::DoNotOptimize(text);
    benchmark::ClobberMemory();
  }
}
BENCHMARK(bm_string);
BENCHMARK_MAIN();
```

Compile and run:

```shell
g++ -std=c++11 -pedantic -Wall -Wextra -O3 -DNDEBUG -o bm_test bm_test.cpp -lbenchmark
./bm_test
```

Observe the output:

```text
2026-03-30T12:02:02+02:00
Running ./bm_test
Run on (4 X 2600 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x2)
  L1 Instruction 32 KiB (x2)
  L2 Unified 256 KiB (x2)
  L3 Unified 4096 KiB (x1)
Load Average: 0.43, 0.89, 1.21
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
***WARNING*** Library was built as DEBUG. Timings may be affected.
-----------------------------------------------------
Benchmark           Time             CPU   Iterations
-----------------------------------------------------
bm_string        1.94 ns         1.94 ns    360112507
```

I do not expect to see the "Librry was built as DEBUG" warning.
I expect the library to be built with -O3 -DNDEBUG (which does not produce such warning).

Bes regards,
Marius

-- System Information:
Debian Release: forky/sid
  APT prefers testing
  APT policy: (900, 'testing'), (500, 'stable'), (50, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.19.10+deb14-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libbenchmark1.9.1 depends on:
hi  libc6       2.42-13
ii  libgcc-s1   16-20260308-1
ii  libstdc++6  16-20260308-1

libbenchmark1.9.1 recommends no packages.

Versions of packages libbenchmark1.9.1 suggests:
ii  libbenchmark-tools  1.9.1-1

-- debconf-show failed



More information about the debian-science-maintainers mailing list