Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 54f346f

Browse files
committed
Update README / CMakeLists.txt; fix for -Wformat warning in btree_bench.cc
1 parent f85129d commit 54f346f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

‎CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ if(build_tests)
2929
enable_testing()
3030
include_directories($ENV{GTEST_ROOT}/include)
3131
link_directories($ENV{GTEST_ROOT})
32+
include_directories($ENV{GFLAGS_ROOT}/include)
33+
link_directories($ENV{GFLAGS_ROOT}/lib)
3234
add_executable(btree_test btree_test.cc btree_test_flags.cc)
3335
add_executable(safe_btree_test safe_btree_test.cc btree_test_flags.cc)
3436
add_executable(btree_bench btree_bench.cc btree_test_flags.cc)

‎README

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@ CMake, the Google C++ Test framework, and the Google flags package.
1111

1212
Download and install CMake from http://www.cmake.org
1313

14-
Download and build the GoogleTest framework from http://code.google.com/p/googletest
14+
Download and build the GoogleTest framework from
15+
http://code.google.com/p/googletest
1516

1617
Download and install gflags from https://code.google.com/p/gflags
1718

19+
Set GTEST_ROOT to the directory where GTEST was built.
20+
Set GFLAGS_ROOT to the directory prefix where GFLAGS is installed.
21+
1822
export GTEST_ROOT=/path/for/gtest-x.y
23+
export GFLAGS_ROOT=/opt
1924

2025
cmake . -Dbuild_tests=ON
26+
27+
For example, to build on a Unix system with the clang++ compiler,
28+
29+
export GTEST_ROOT=$(HOME)/src/googletest
30+
export GFLAGS_ROOT=/opt
31+
cmake . -G "Unix Makefiles" -Dbuild_tests=ON -DCMAKE_CXX_COMPILER=clang++

‎btree_bench.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void BenchmarkRun::Reset() {
133133
void BenchmarkRun::Run() {
134134
assert(current_benchmark == NULL);
135135
current_benchmark = this;
136-
int iters = FLAGS_benchmark_min_iters;
136+
int64_t iters = FLAGS_benchmark_min_iters;
137137
for (;;) {
138138
Reset();
139139
Start();
@@ -152,7 +152,7 @@ void BenchmarkRun::Run() {
152152
}
153153
fprintf(stdout, "%s\t%qu\t%qu\n",
154154
benchmark_name,
155-
accum_micros * 1000 / iters,
155+
accum_micros * 1000ULL / iters,
156156
iters);
157157
current_benchmark = NULL;
158158
}

0 commit comments

Comments
 (0)