diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c49ad2..d005e15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,8 @@ if(build_tests) enable_testing() include_directories($ENV{GTEST_ROOT}/include) link_directories($ENV{GTEST_ROOT}) + include_directories($ENV{GFLAGS_ROOT}/include) + link_directories($ENV{GFLAGS_ROOT}/lib) add_executable(btree_test btree_test.cc btree_test_flags.cc) add_executable(safe_btree_test safe_btree_test.cc btree_test_flags.cc) add_executable(btree_bench btree_bench.cc btree_test_flags.cc) diff --git a/README b/README index 0e8674c..319fe9b 100644 --- a/README +++ b/README @@ -11,10 +11,21 @@ CMake, the Google C++ Test framework, and the Google flags package. Download and install CMake from http://www.cmake.org -Download and build the GoogleTest framework from http://code.google.com/p/googletest +Download and build the GoogleTest framework from +http://code.google.com/p/googletest Download and install gflags from https://code.google.com/p/gflags +Set GTEST_ROOT to the directory where GTEST was built. +Set GFLAGS_ROOT to the directory prefix where GFLAGS is installed. + export GTEST_ROOT=/path/for/gtest-x.y +export GFLAGS_ROOT=/opt cmake . -Dbuild_tests=ON + +For example, to build on a Unix system with the clang++ compiler, + +export GTEST_ROOT=$(HOME)/src/googletest +export GFLAGS_ROOT=/opt +cmake . -G "Unix Makefiles" -Dbuild_tests=ON -DCMAKE_CXX_COMPILER=clang++ diff --git a/btree_bench.cc b/btree_bench.cc index d5495c5..900c5e6 100644 --- a/btree_bench.cc +++ b/btree_bench.cc @@ -133,7 +133,7 @@ void BenchmarkRun::Reset() { void BenchmarkRun::Run() { assert(current_benchmark == NULL); current_benchmark = this; - int iters = FLAGS_benchmark_min_iters; + int64_t iters = FLAGS_benchmark_min_iters; for (;;) { Reset(); Start(); @@ -152,7 +152,7 @@ void BenchmarkRun::Run() { } fprintf(stdout, "%s\t%qu\t%qu\n", benchmark_name, - accum_micros * 1000 / iters, + accum_micros * 1000ULL / iters, iters); current_benchmark = NULL; }