Skip to content

Commit aec6a04

Browse files
committed
Revert "Update Benchmark (#83488)"
This reverts commit 2e93ee6. buildbot failures, e.g. `/third-party/benchmark/cmake/pthread_affinity.cpp`
1 parent 922a431 commit aec6a04

File tree

107 files changed

+1622
-3773
lines changed

Some content is hidden

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

107 files changed

+1622
-3773
lines changed

third-party/benchmark/.ycm_extra_conf.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
32
import ycm_core
43

54
# These are the compilation flags that will be used in case there's no
@@ -92,9 +91,7 @@ def GetCompilationInfoForFile(filename):
9291
for extension in SOURCE_EXTENSIONS:
9392
replacement_file = basename + extension
9493
if os.path.exists(replacement_file):
95-
compilation_info = database.GetCompilationInfoForFile(
96-
replacement_file
97-
)
94+
compilation_info = database.GetCompilationInfoForFile(replacement_file)
9895
if compilation_info.compiler_flags_:
9996
return compilation_info
10097
return None
@@ -110,8 +107,7 @@ def FlagsForFile(filename, **kwargs):
110107
return None
111108

112109
final_flags = MakeRelativePathsInFlagsAbsolute(
113-
compilation_info.compiler_flags_,
114-
compilation_info.compiler_working_dir_,
110+
compilation_info.compiler_flags_, compilation_info.compiler_working_dir_
115111
)
116112
else:
117113
relative_to = DirectoryOfThisScript()

third-party/benchmark/AUTHORS

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Alex Steele <[email protected]>
1313
Andriy Berestovskyy <[email protected]>
1414
Arne Beer <[email protected]>
1515
Carto
16-
Cezary Skrzyński <[email protected]>
1716
Christian Wassermann <[email protected]>
1817
Christopher Seymour <[email protected]>
1918
Colin Braley <[email protected]>
@@ -28,13 +27,10 @@ Eric Backus <[email protected]>
2827
Eric Fiselier <[email protected]>
2928
Eugene Zhuk <[email protected]>
3029
Evgeny Safronov <[email protected]>
31-
Fabien Pichot <[email protected]>
3230
Federico Ficarelli <[email protected]>
3331
Felix Homann <[email protected]>
34-
Gergely Meszaros <[email protected]>
3532
Gergő Szitár <[email protected]>
3633
Google Inc.
37-
Henrique Bucher <[email protected]>
3834
International Business Machines Corporation
3935
Ismael Jimenez Martinez <[email protected]>
4036
Jern-Kuan Leong <[email protected]>
@@ -45,28 +41,22 @@ Jussi Knuuttila <[email protected]>
4541
Kaito Udagawa <[email protected]>
4642
Kishan Kumar <[email protected]>
4743
48-
Marcel Jacobse <[email protected]>
4944
Matt Clarkson <[email protected]>
5045
Maxim Vafin <[email protected]>
51-
Mike Apodaca <[email protected]>
52-
Min-Yih Hsu <[email protected]>
5346
MongoDB Inc.
5447
Nick Hutchinson <[email protected]>
5548
Norman Heino <[email protected]>
5649
Oleksandr Sochka <[email protected]>
5750
Ori Livneh <[email protected]>
5851
Paul Redmond <[email protected]>
5952
Radoslav Yovchev <[email protected]>
60-
Raghu Raja <[email protected]>
61-
Rainer Orth <[email protected]>
6253
Roman Lebedev <[email protected]>
6354
Sayan Bhattacharjee <[email protected]>
64-
6555
Shuo Chen <[email protected]>
66-
Staffan Tjernstrom <[email protected]>
6756
Steinar H. Gunderson <[email protected]>
6857
Stripe, Inc.
6958
Tobias Schmidt <[email protected]>
7059
Yixuan Qiu <[email protected]>
7160
Yusuke Suzuki <[email protected]>
7261
Zbigniew Skowron <[email protected]>
62+
Min-Yih Hsu <[email protected]>

third-party/benchmark/CMakeLists.txt

Lines changed: 44 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
# Require CMake 3.10. If available, use the policies up to CMake 3.22.
2-
cmake_minimum_required (VERSION 3.10...3.22)
1+
cmake_minimum_required (VERSION 3.5.1)
2+
3+
foreach(p
4+
CMP0048 # OK to clear PROJECT_VERSION on project()
5+
CMP0054 # CMake 3.1
6+
CMP0056 # export EXE_LINKER_FLAGS to try_run
7+
CMP0057 # Support no if() IN_LIST operator
8+
CMP0063 # Honor visibility properties for all targets
9+
CMP0077 # Allow option() overrides in importing projects
10+
)
11+
if(POLICY ${p})
12+
cmake_policy(SET ${p} NEW)
13+
endif()
14+
endforeach()
315

4-
project (benchmark VERSION 1.8.3 LANGUAGES CXX)
16+
project (benchmark VERSION 1.6.0 LANGUAGES CXX)
517

618
option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON)
719
option(BENCHMARK_ENABLE_EXCEPTIONS "Enable the use of exceptions in the benchmark library." ON)
@@ -14,14 +26,11 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI")
1426
# PGC++ maybe reporting false positives.
1527
set(BENCHMARK_ENABLE_WERROR OFF)
1628
endif()
17-
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "NVHPC")
18-
set(BENCHMARK_ENABLE_WERROR OFF)
19-
endif()
2029
if(BENCHMARK_FORCE_WERROR)
2130
set(BENCHMARK_ENABLE_WERROR ON)
2231
endif(BENCHMARK_FORCE_WERROR)
2332

24-
if(NOT (MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"))
33+
if(NOT MSVC)
2534
option(BENCHMARK_BUILD_32_BITS "Build a 32 bit version of the library." OFF)
2635
else()
2736
set(BENCHMARK_BUILD_32_BITS OFF CACHE BOOL "Build a 32 bit version of the library - unsupported when using MSVC)" FORCE)
@@ -41,11 +50,8 @@ option(BENCHMARK_USE_BUNDLED_GTEST "Use bundled GoogleTest. If disabled, the fin
4150

4251
option(BENCHMARK_ENABLE_LIBPFM "Enable performance counters provided by libpfm" OFF)
4352

44-
# Export only public symbols
45-
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
46-
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
47-
48-
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
53+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
54+
if(MSVC)
4955
# As of CMake 3.18, CMAKE_SYSTEM_PROCESSOR is not set properly for MSVC and
5056
# cross-compilation (e.g. Host=x86_64, target=aarch64) requires using the
5157
# undocumented, but working variable.
@@ -66,7 +72,7 @@ function(should_enable_assembly_tests)
6672
return()
6773
endif()
6874
endif()
69-
if (MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
75+
if (MSVC)
7076
return()
7177
elseif(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
7278
return()
@@ -105,49 +111,29 @@ get_git_version(GIT_VERSION)
105111
# If no git version can be determined, use the version
106112
# from the project() command
107113
if ("${GIT_VERSION}" STREQUAL "0.0.0")
108-
set(VERSION "v${benchmark_VERSION}")
114+
set(VERSION "${benchmark_VERSION}")
109115
else()
110116
set(VERSION "${GIT_VERSION}")
111117
endif()
112-
113-
# Normalize version: drop "v" prefix, replace first "-" with ".",
114-
# drop everything after second "-" (including said "-").
115-
string(STRIP ${VERSION} VERSION)
116-
if(VERSION MATCHES v[^-]*-)
117-
string(REGEX REPLACE "v([^-]*)-([0-9]+)-.*" "\\1.\\2" NORMALIZED_VERSION ${VERSION})
118-
else()
119-
string(REGEX REPLACE "v(.*)" "\\1" NORMALIZED_VERSION ${VERSION})
120-
endif()
121-
122118
# Tell the user what versions we are using
123-
message(STATUS "Google Benchmark version: ${VERSION}, normalized to ${NORMALIZED_VERSION}")
119+
message(STATUS "Version: ${VERSION}")
124120

125121
# The version of the libraries
126-
set(GENERIC_LIB_VERSION ${NORMALIZED_VERSION})
127-
string(SUBSTRING ${NORMALIZED_VERSION} 0 1 GENERIC_LIB_SOVERSION)
122+
set(GENERIC_LIB_VERSION ${VERSION})
123+
string(SUBSTRING ${VERSION} 0 1 GENERIC_LIB_SOVERSION)
128124

129125
# Import our CMake modules
130-
include(AddCXXCompilerFlag)
131126
include(CheckCXXCompilerFlag)
132-
include(CheckLibraryExists)
127+
include(AddCXXCompilerFlag)
133128
include(CXXFeatureCheck)
129+
include(CheckLibraryExists)
134130

135131
check_library_exists(rt shm_open "" HAVE_LIB_RT)
136132

137133
if (BENCHMARK_BUILD_32_BITS)
138134
add_required_cxx_compiler_flag(-m32)
139135
endif()
140136

141-
if (MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
142-
set(BENCHMARK_CXX_STANDARD 14)
143-
else()
144-
set(BENCHMARK_CXX_STANDARD 11)
145-
endif()
146-
147-
set(CMAKE_CXX_STANDARD ${BENCHMARK_CXX_STANDARD})
148-
set(CMAKE_CXX_STANDARD_REQUIRED YES)
149-
set(CMAKE_CXX_EXTENSIONS OFF)
150-
151137
if (MSVC)
152138
# Turn compiler warnings up to 11
153139
string(REGEX REPLACE "[-/]W[1-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
@@ -180,18 +166,21 @@ if (MSVC)
180166
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /LTCG")
181167
endif()
182168
else()
183-
# Turn on Large-file Support
184-
add_definitions(-D_FILE_OFFSET_BITS=64)
185-
add_definitions(-D_LARGEFILE64_SOURCE)
186-
add_definitions(-D_LARGEFILE_SOURCE)
169+
# Try and enable C++11. Don't use C++14 because it doesn't work in some
170+
# configurations.
171+
add_cxx_compiler_flag(-std=c++11)
172+
if (NOT HAVE_CXX_FLAG_STD_CXX11)
173+
add_cxx_compiler_flag(-std=c++0x)
174+
endif()
175+
187176
# Turn compiler warnings up to 11
188177
add_cxx_compiler_flag(-Wall)
189178
add_cxx_compiler_flag(-Wextra)
190179
add_cxx_compiler_flag(-Wshadow)
191-
add_cxx_compiler_flag(-Wfloat-equal)
192-
add_cxx_compiler_flag(-Wold-style-cast)
193180
if(BENCHMARK_ENABLE_WERROR)
194-
add_cxx_compiler_flag(-Werror)
181+
add_cxx_compiler_flag(-Werror RELEASE)
182+
add_cxx_compiler_flag(-Werror RELWITHDEBINFO)
183+
add_cxx_compiler_flag(-Werror MINSIZEREL)
195184
endif()
196185
if (NOT BENCHMARK_ENABLE_TESTING)
197186
# Disable warning when compiling tests as gtest does not use 'override'.
@@ -204,23 +193,24 @@ else()
204193
# Disable warnings regarding deprecated parts of the library while building
205194
# and testing those parts of the library.
206195
add_cxx_compiler_flag(-Wno-deprecated-declarations)
207-
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
196+
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
208197
# Intel silently ignores '-Wno-deprecated-declarations',
209198
# warning no. 1786 must be explicitly disabled.
210199
# See #631 for rationale.
211200
add_cxx_compiler_flag(-wd1786)
212-
add_cxx_compiler_flag(-fno-finite-math-only)
213201
endif()
214202
# Disable deprecation warnings for release builds (when -Werror is enabled).
215203
if(BENCHMARK_ENABLE_WERROR)
216-
add_cxx_compiler_flag(-Wno-deprecated)
204+
add_cxx_compiler_flag(-Wno-deprecated RELEASE)
205+
add_cxx_compiler_flag(-Wno-deprecated RELWITHDEBINFO)
206+
add_cxx_compiler_flag(-Wno-deprecated MINSIZEREL)
217207
endif()
218208
if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
219209
add_cxx_compiler_flag(-fno-exceptions)
220210
endif()
221211

222212
if (HAVE_CXX_FLAG_FSTRICT_ALIASING)
223-
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") #ICC17u2: Many false positives for Wstrict-aliasing
213+
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel") #ICC17u2: Many false positives for Wstrict-aliasing
224214
add_cxx_compiler_flag(-Wstrict-aliasing)
225215
endif()
226216
endif()
@@ -229,12 +219,12 @@ else()
229219
add_cxx_compiler_flag(-wd654)
230220
add_cxx_compiler_flag(-Wthread-safety)
231221
if (HAVE_CXX_FLAG_WTHREAD_SAFETY)
232-
cxx_feature_check(THREAD_SAFETY_ATTRIBUTES "-DINCLUDE_DIRECTORIES=${PROJECT_SOURCE_DIR}/include")
222+
cxx_feature_check(THREAD_SAFETY_ATTRIBUTES)
233223
endif()
234224

235225
# On most UNIX like platforms g++ and clang++ define _GNU_SOURCE as a
236226
# predefined macro, which turns on all of the wonderful libc extensions.
237-
# However g++ doesn't do this in Cygwin so we have to define it ourselves
227+
# However g++ doesn't do this in Cygwin so we have to define it ourselfs
238228
# since we depend on GNU/POSIX/BSD extensions.
239229
if (CYGWIN)
240230
add_definitions(-D_GNU_SOURCE=1)
@@ -285,8 +275,7 @@ if (BENCHMARK_USE_LIBCXX)
285275
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
286276
add_cxx_compiler_flag(-stdlib=libc++)
287277
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
288-
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" OR
289-
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM")
278+
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
290279
add_cxx_compiler_flag(-nostdinc++)
291280
message(WARNING "libc++ header path must be manually specified using CMAKE_CXX_FLAGS")
292281
# Adding -nodefaultlibs directly to CMAKE_<TYPE>_LINKER_FLAGS will break
@@ -323,10 +312,9 @@ cxx_feature_check(STEADY_CLOCK)
323312
# Ensure we have pthreads
324313
set(THREADS_PREFER_PTHREAD_FLAG ON)
325314
find_package(Threads REQUIRED)
326-
cxx_feature_check(PTHREAD_AFFINITY)
327315

328316
if (BENCHMARK_ENABLE_LIBPFM)
329-
find_package(PFM REQUIRED)
317+
find_package(PFM)
330318
endif()
331319

332320
# Set up directories

third-party/benchmark/CONTRIBUTORS

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ Albert Pretorius <[email protected]>
2727
Alex Steele <[email protected]>
2828
Andriy Berestovskyy <[email protected]>
2929
Arne Beer <[email protected]>
30-
Bátor Tallér <[email protected]>
3130
Billy Robert O'Neal III <[email protected]> <[email protected]>
32-
Cezary Skrzyński <[email protected]>
3331
3432
Christian Wassermann <[email protected]>
3533
Christopher Seymour <[email protected]>
@@ -46,32 +44,25 @@ Eric Backus <[email protected]>
4644
Eric Fiselier <[email protected]>
4745
Eugene Zhuk <[email protected]>
4846
Evgeny Safronov <[email protected]>
49-
Fabien Pichot <[email protected]>
5047
Fanbo Meng <[email protected]>
5148
Federico Ficarelli <[email protected]>
5249
Felix Homann <[email protected]>
5350
Geoffrey Martin-Noble <[email protected]> <[email protected]>
54-
Gergely Meszaros <[email protected]>
5551
Gergő Szitár <[email protected]>
5652
Hannes Hauswedell <[email protected]>
57-
Henrique Bucher <[email protected]>
5853
Ismael Jimenez Martinez <[email protected]>
59-
Iakov Sergeev <[email protected]>
6054
Jern-Kuan Leong <[email protected]>
6155
JianXiong Zhou <[email protected]>
6256
Joao Paulo Magalhaes <[email protected]>
6357
John Millikin <[email protected]>
6458
Jordan Williams <[email protected]>
6559
Jussi Knuuttila <[email protected]>
66-
Kaito Udagawa <[email protected]>
6760
61+
Kaito Udagawa <[email protected]>
6862
Kishan Kumar <[email protected]>
6963
70-
Marcel Jacobse <[email protected]>
7164
Matt Clarkson <[email protected]>
7265
Maxim Vafin <[email protected]>
73-
Mike Apodaca <[email protected]>
74-
Min-Yih Hsu <[email protected]>
7566
Nick Hutchinson <[email protected]>
7667
Norman Heino <[email protected]>
7768
Oleksandr Sochka <[email protected]>
@@ -80,8 +71,6 @@ Pascal Leroy <[email protected]>
8071
Paul Redmond <[email protected]>
8172
Pierre Phaneuf <[email protected]>
8273
Radoslav Yovchev <[email protected]>
83-
Raghu Raja <[email protected]>
84-
Rainer Orth <[email protected]>
8574
Raul Marin <[email protected]>
8675
Ray Glover <[email protected]>
8776
Robert Guo <[email protected]>
@@ -95,3 +84,4 @@ Tom Madams <[email protected]> <[email protected]>
9584
Yixuan Qiu <[email protected]>
9685
Yusuke Suzuki <[email protected]>
9786
Zbigniew Skowron <[email protected]>
87+
Min-Yih Hsu <[email protected]>

third-party/benchmark/README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
[![bazel](https://github.com/google/benchmark/actions/workflows/bazel.yml/badge.svg)](https://github.com/google/benchmark/actions/workflows/bazel.yml)
55
[![pylint](https://github.com/google/benchmark/workflows/pylint/badge.svg)](https://github.com/google/benchmark/actions?query=workflow%3Apylint)
66
[![test-bindings](https://github.com/google/benchmark/workflows/test-bindings/badge.svg)](https://github.com/google/benchmark/actions?query=workflow%3Atest-bindings)
7+
8+
[![Build Status](https://travis-ci.org/google/benchmark.svg?branch=master)](https://travis-ci.org/google/benchmark)
79
[![Coverage Status](https://coveralls.io/repos/google/benchmark/badge.svg)](https://coveralls.io/r/google/benchmark)
810

9-
[![Discord](https://discordapp.com/api/guilds/1125694995928719494/widget.png?style=shield)](https://discord.gg/cz7UX7wKC2)
1011

1112
A library to benchmark code snippets, similar to unit tests. Example:
1213

@@ -32,7 +33,7 @@ To get started, see [Requirements](#requirements) and
3233
[Installation](#installation). See [Usage](#usage) for a full example and the
3334
[User Guide](docs/user_guide.md) for a more comprehensive feature overview.
3435
35-
It may also help to read the [Google Test documentation](https://github.com/google/googletest/blob/main/docs/primer.md)
36+
It may also help to read the [Google Test documentation](https://github.com/google/googletest/blob/master/docs/primer.md)
3637
as some of the structural aspects of the APIs are similar.
3738
3839
## Resources
@@ -46,8 +47,6 @@ IRC channels:
4647
4748
[Assembly Testing Documentation](docs/AssemblyTests.md)
4849
49-
[Building and installing Python bindings](docs/python_bindings.md)
50-
5150
## Requirements
5251
5352
The library can be used with C++03. However, it requires C++11 to build,
@@ -138,12 +137,6 @@ cache variables, if autodetection fails.
138137
If you are using clang, you may need to set `LLVMAR_EXECUTABLE`,
139138
`LLVMNM_EXECUTABLE` and `LLVMRANLIB_EXECUTABLE` cmake cache variables.
140139

141-
To enable sanitizer checks (eg., `asan` and `tsan`), add:
142-
```
143-
-DCMAKE_C_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=address -fsanitize=thread -fno-sanitize-recover=all"
144-
-DCMAKE_CXX_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=address -fsanitize=thread -fno-sanitize-recover=all "
145-
```
146-
147140
### Stable and Experimental Library Versions
148141

149142
The main branch contains the latest stable version of the benchmarking library;

0 commit comments

Comments
 (0)