google/benchmark

master is broken on Android

Open

#731 opened on Nov 26, 2018

View on GitHub
 (3 comments) (0 reactions) (0 assignees)C++ (7,968 stars) (1,539 forks)batch import
bughelp wanted

Description

master version (I tested revision c9311a44e1280853632fe2472345dd04514a2f74) fails to build on Android, with the error:

/Users/marat/benchmark/src/sysinfo.cc:586:21: error: use of undeclared identifier 'getloadavg'
  const int nelem = getloadavg(res.data(), kMaxSamples);
                    ^
1 error generated.

Repro:

git clone https://github.com/google/benchmark.git
cd benchmark
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/android/ndk/build/cmake/android.toolchain.cmake -DBENCHMARK_ENABLE_TESTING=OFF ..
make

Contributor guide