Skip to content

Commit ed008d5

Browse files
committed
upgrading to google benchmark v1.5.1; adding google benchmark
1 parent 8be2545 commit ed008d5

File tree

139 files changed

+18947
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+18947
-0
lines changed

lib/benchmark_1.5.1/.clang-format

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
PointerAlignment: Left
5+
...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**System**
14+
Which OS, compiler, and compiler version are you using:
15+
- OS:
16+
- Compiler and version:
17+
18+
**To reproduce**
19+
Steps to reproduce the behavior:
20+
1. sync to commit ...
21+
2. cmake/bazel...
22+
3. make ...
23+
4. See error
24+
25+
**Expected behavior**
26+
A clear and concise description of what you expected to happen.
27+
28+
**Screenshots**
29+
If applicable, add screenshots to help explain your problem.
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[FR]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

lib/benchmark_1.5.1/.gitignore

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
*.a
2+
*.so
3+
*.so.?*
4+
*.dll
5+
*.exe
6+
*.dylib
7+
*.cmake
8+
!/cmake/*.cmake
9+
!/test/AssemblyTests.cmake
10+
*~
11+
*.swp
12+
*.pyc
13+
__pycache__
14+
15+
# lcov
16+
*.lcov
17+
/lcov
18+
19+
# cmake files.
20+
/Testing
21+
CMakeCache.txt
22+
CMakeFiles/
23+
cmake_install.cmake
24+
25+
# makefiles.
26+
Makefile
27+
28+
# in-source build.
29+
bin/
30+
lib/
31+
/test/*_test
32+
33+
# exuberant ctags.
34+
tags
35+
36+
# YouCompleteMe configuration.
37+
.ycm_extra_conf.pyc
38+
39+
# ninja generated files.
40+
.ninja_deps
41+
.ninja_log
42+
build.ninja
43+
install_manifest.txt
44+
rules.ninja
45+
46+
# bazel output symlinks.
47+
bazel-*
48+
49+
# out-of-source build top-level folders.
50+
build/
51+
_build/
52+
build*/
53+
54+
# in-source dependencies
55+
/googletest/
56+
57+
# Visual Studio 2015/2017 cache/options directory
58+
.vs/
59+
CMakeSettings.json
60+
61+
# Visual Studio Code cache/options directory
62+
.vscode/
63+
64+
# Python build stuff
65+
dist/
66+
*.egg-info*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
# Install a newer CMake version
4+
curl -sSL https://cmake.org/files/v3.6/cmake-3.6.1-Linux-x86_64.sh -o install-cmake.sh
5+
chmod +x install-cmake.sh
6+
sudo ./install-cmake.sh --prefix=/usr/local --skip-license
7+
8+
# Checkout LLVM sources
9+
git clone --depth=1 https://github.com/llvm-mirror/llvm.git llvm-source
10+
git clone --depth=1 https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx
11+
git clone --depth=1 https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi
12+
13+
# Setup libc++ options
14+
if [ -z "$BUILD_32_BITS" ]; then
15+
export BUILD_32_BITS=OFF && echo disabling 32 bit build
16+
fi
17+
18+
# Build and install libc++ (Use unstable ABI for better sanitizer coverage)
19+
mkdir llvm-build && cd llvm-build
20+
cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} \
21+
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr \
22+
-DLIBCXX_ABI_UNSTABLE=ON \
23+
-DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \
24+
-DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \
25+
../llvm-source
26+
make cxx -j2
27+
sudo make install-cxxabi install-cxx
28+
cd ../

lib/benchmark_1.5.1/.travis.yml

+231
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
sudo: required
2+
dist: trusty
3+
language: cpp
4+
5+
matrix:
6+
include:
7+
- compiler: gcc
8+
addons:
9+
apt:
10+
packages:
11+
- lcov
12+
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Coverage
13+
- compiler: gcc
14+
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Debug
15+
- compiler: gcc
16+
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Release
17+
- compiler: gcc
18+
addons:
19+
apt:
20+
packages:
21+
- g++-multilib
22+
- libc6:i386
23+
env:
24+
- COMPILER=g++
25+
- C_COMPILER=gcc
26+
- BUILD_TYPE=Debug
27+
- BUILD_32_BITS=ON
28+
- EXTRA_FLAGS="-m32"
29+
- compiler: gcc
30+
addons:
31+
apt:
32+
packages:
33+
- g++-multilib
34+
- libc6:i386
35+
env:
36+
- COMPILER=g++
37+
- C_COMPILER=gcc
38+
- BUILD_TYPE=Release
39+
- BUILD_32_BITS=ON
40+
- EXTRA_FLAGS="-m32"
41+
- compiler: gcc
42+
env:
43+
- INSTALL_GCC6_FROM_PPA=1
44+
- COMPILER=g++-6 C_COMPILER=gcc-6 BUILD_TYPE=Debug
45+
- ENABLE_SANITIZER=1
46+
- EXTRA_FLAGS="-fno-omit-frame-pointer -g -O2 -fsanitize=undefined,address -fuse-ld=gold"
47+
- compiler: clang
48+
env: COMPILER=clang++ C_COMPILER=clang BUILD_TYPE=Debug
49+
- compiler: clang
50+
env: COMPILER=clang++ C_COMPILER=clang BUILD_TYPE=Release
51+
# Clang w/ libc++
52+
- compiler: clang
53+
dist: xenial
54+
addons:
55+
apt:
56+
packages:
57+
clang-3.8
58+
env:
59+
- INSTALL_GCC6_FROM_PPA=1
60+
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
61+
- LIBCXX_BUILD=1
62+
- EXTRA_CXX_FLAGS="-stdlib=libc++"
63+
- compiler: clang
64+
dist: xenial
65+
addons:
66+
apt:
67+
packages:
68+
clang-3.8
69+
env:
70+
- INSTALL_GCC6_FROM_PPA=1
71+
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release
72+
- LIBCXX_BUILD=1
73+
- EXTRA_CXX_FLAGS="-stdlib=libc++"
74+
# Clang w/ 32bit libc++
75+
- compiler: clang
76+
dist: xenial
77+
addons:
78+
apt:
79+
packages:
80+
- clang-3.8
81+
- g++-multilib
82+
- libc6:i386
83+
env:
84+
- INSTALL_GCC6_FROM_PPA=1
85+
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
86+
- LIBCXX_BUILD=1
87+
- BUILD_32_BITS=ON
88+
- EXTRA_FLAGS="-m32"
89+
- EXTRA_CXX_FLAGS="-stdlib=libc++"
90+
# Clang w/ 32bit libc++
91+
- compiler: clang
92+
dist: xenial
93+
addons:
94+
apt:
95+
packages:
96+
- clang-3.8
97+
- g++-multilib
98+
- libc6:i386
99+
env:
100+
- INSTALL_GCC6_FROM_PPA=1
101+
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release
102+
- LIBCXX_BUILD=1
103+
- BUILD_32_BITS=ON
104+
- EXTRA_FLAGS="-m32"
105+
- EXTRA_CXX_FLAGS="-stdlib=libc++"
106+
# Clang w/ libc++, ASAN, UBSAN
107+
- compiler: clang
108+
dist: xenial
109+
addons:
110+
apt:
111+
packages:
112+
clang-3.8
113+
env:
114+
- INSTALL_GCC6_FROM_PPA=1
115+
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
116+
- LIBCXX_BUILD=1 LIBCXX_SANITIZER="Undefined;Address"
117+
- ENABLE_SANITIZER=1
118+
- EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=undefined,address -fno-sanitize-recover=all"
119+
- EXTRA_CXX_FLAGS="-stdlib=libc++"
120+
- UBSAN_OPTIONS=print_stacktrace=1
121+
# Clang w/ libc++ and MSAN
122+
- compiler: clang
123+
dist: xenial
124+
addons:
125+
apt:
126+
packages:
127+
clang-3.8
128+
env:
129+
- INSTALL_GCC6_FROM_PPA=1
130+
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
131+
- LIBCXX_BUILD=1 LIBCXX_SANITIZER=MemoryWithOrigins
132+
- ENABLE_SANITIZER=1
133+
- EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins"
134+
- EXTRA_CXX_FLAGS="-stdlib=libc++"
135+
# Clang w/ libc++ and MSAN
136+
- compiler: clang
137+
dist: xenial
138+
addons:
139+
apt:
140+
packages:
141+
clang-3.8
142+
env:
143+
- INSTALL_GCC6_FROM_PPA=1
144+
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=RelWithDebInfo
145+
- LIBCXX_BUILD=1 LIBCXX_SANITIZER=Thread
146+
- ENABLE_SANITIZER=1
147+
- EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=thread -fno-sanitize-recover=all"
148+
- EXTRA_CXX_FLAGS="-stdlib=libc++"
149+
- os: osx
150+
osx_image: xcode8.3
151+
compiler: clang
152+
env:
153+
- COMPILER=clang++ BUILD_TYPE=Debug
154+
- os: osx
155+
osx_image: xcode8.3
156+
compiler: clang
157+
env:
158+
- COMPILER=clang++ BUILD_TYPE=Release
159+
- os: osx
160+
osx_image: xcode8.3
161+
compiler: clang
162+
env:
163+
- COMPILER=clang++
164+
- BUILD_TYPE=Release
165+
- BUILD_32_BITS=ON
166+
- EXTRA_FLAGS="-m32"
167+
- os: osx
168+
osx_image: xcode9.4
169+
compiler: gcc
170+
env:
171+
- COMPILER=g++-7 C_COMPILER=gcc-7 BUILD_TYPE=Debug
172+
173+
before_script:
174+
- if [ -n "${LIBCXX_BUILD}" ]; then
175+
source .travis-libcxx-setup.sh;
176+
fi
177+
- if [ -n "${ENABLE_SANITIZER}" ]; then
178+
export EXTRA_OPTIONS="-DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF";
179+
else
180+
export EXTRA_OPTIONS="";
181+
fi
182+
- mkdir -p build && cd build
183+
184+
before_install:
185+
- if [ -z "$BUILD_32_BITS" ]; then
186+
export BUILD_32_BITS=OFF && echo disabling 32 bit build;
187+
fi
188+
- if [ -n "${INSTALL_GCC6_FROM_PPA}" ]; then
189+
sudo add-apt-repository -y "ppa:ubuntu-toolchain-r/test";
190+
sudo apt-get update --option Acquire::Retries=100 --option Acquire::http::Timeout="60";
191+
fi
192+
193+
install:
194+
- if [ -n "${INSTALL_GCC6_FROM_PPA}" ]; then
195+
travis_wait sudo -E apt-get -yq --no-install-suggests --no-install-recommends install g++-6;
196+
fi
197+
- if [ "${TRAVIS_OS_NAME}" == "linux" -a "${BUILD_32_BITS}" == "OFF" ]; then
198+
travis_wait sudo -E apt-get -y --no-install-suggests --no-install-recommends install llvm-3.9-tools;
199+
sudo cp /usr/lib/llvm-3.9/bin/FileCheck /usr/local/bin/;
200+
fi
201+
- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
202+
PATH=~/.local/bin:${PATH};
203+
pip install --user --upgrade pip;
204+
travis_wait pip install --user cpp-coveralls;
205+
fi
206+
- if [ "${C_COMPILER}" == "gcc-7" -a "${TRAVIS_OS_NAME}" == "osx" ]; then
207+
rm -f /usr/local/include/c++;
208+
brew update;
209+
travis_wait brew install gcc@7;
210+
fi
211+
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
212+
sudo apt-get update -qq;
213+
sudo apt-get install -qq unzip cmake3;
214+
wget https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-installer-linux-x86_64.sh --output-document bazel-installer.sh;
215+
travis_wait sudo bash bazel-installer.sh;
216+
fi
217+
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
218+
curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-installer-darwin-x86_64.sh;
219+
travis_wait sudo bash bazel-installer.sh;
220+
fi
221+
222+
script:
223+
- cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_C_FLAGS="${EXTRA_FLAGS}" -DCMAKE_CXX_FLAGS="${EXTRA_FLAGS} ${EXTRA_CXX_FLAGS}" -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON -DBENCHMARK_BUILD_32_BITS=${BUILD_32_BITS} ${EXTRA_OPTIONS} ..
224+
- make
225+
- ctest -C ${BUILD_TYPE} --output-on-failure
226+
- bazel test -c dbg --define google_benchmark.have_regex=posix --announce_rc --verbose_failures --test_output=errors --keep_going //test/...
227+
228+
after_success:
229+
- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
230+
coveralls --include src --include include --gcov-options '\-lp' --root .. --build-root .;
231+
fi

0 commit comments

Comments
 (0)