diff --git a/.github/workflows/daily_benchmark.yaml b/.github/workflows/daily_benchmark.yaml index cc77e2395..4a27241b4 100644 --- a/.github/workflows/daily_benchmark.yaml +++ b/.github/workflows/daily_benchmark.yaml @@ -25,7 +25,7 @@ jobs: - name: Build release binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init diff --git a/.github/workflows/diff.yaml b/.github/workflows/diff.yaml index e161af297..432660846 100644 --- a/.github/workflows/diff.yaml +++ b/.github/workflows/diff.yaml @@ -32,7 +32,7 @@ jobs: - name: Build community binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -45,7 +45,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build @@ -70,7 +70,7 @@ jobs: - name: Build combined ASAN, UBSAN and coverage binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -82,7 +82,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. It is restricted to 2 threads intentionally, because higher concurrency makes the timing related tests unstable. cd build @@ -91,7 +91,7 @@ jobs: - name: Compute code coverage run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Compute code coverage. cd tools/github @@ -109,7 +109,7 @@ jobs: - name: Run clang-tidy run: | - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Restrict clang-tidy results only to the modified parts git diff -U0 master... -- src ':!*.hpp' | ./tools/github/clang-tidy/clang-tidy-diff.py -p 1 -j $THREADS -path build | tee ./build/clang_tidy_output.txt @@ -136,7 +136,7 @@ jobs: - name: Build debug binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -149,7 +149,7 @@ jobs: - name: Run leftover CTest tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run leftover CTest tests (all except unit and benchmark tests). cd build @@ -181,7 +181,7 @@ jobs: - name: Run cppcheck and clang-format run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run cppcheck and clang-format. cd tools/github @@ -212,7 +212,7 @@ jobs: - name: Build release binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -238,7 +238,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build @@ -272,7 +272,7 @@ jobs: - name: Create enterprise DEB package run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate cd build @@ -319,7 +319,7 @@ jobs: - name: Build release binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -360,7 +360,7 @@ jobs: - name: Build release binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init diff --git a/.github/workflows/full_clang_tidy.yaml b/.github/workflows/full_clang_tidy.yaml index a556a5866..5ce7cd0af 100644 --- a/.github/workflows/full_clang_tidy.yaml +++ b/.github/workflows/full_clang_tidy.yaml @@ -23,7 +23,7 @@ jobs: - name: Build debug binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -36,10 +36,10 @@ jobs: - name: Run clang-tidy run: | - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # The results are also written to standard output in order to retain them in the logs - ./tools/github/clang-tidy/run-clang-tidy.py -p build -j $THREADS -clang-tidy-binary=/opt/toolchain-v3/bin/clang-tidy "$PWD/src/*" | + ./tools/github/clang-tidy/run-clang-tidy.py -p build -j $THREADS -clang-tidy-binary=/opt/toolchain-v4/bin/clang-tidy "$PWD/src/*" | tee ./build/full_clang_tidy_output.txt - name: Summarize clang-tidy results diff --git a/.github/workflows/release_centos8.yaml b/.github/workflows/release_centos8.yaml index cd84592eb..b3a678a60 100644 --- a/.github/workflows/release_centos8.yaml +++ b/.github/workflows/release_centos8.yaml @@ -26,7 +26,7 @@ jobs: - name: Build community binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -39,7 +39,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build @@ -64,7 +64,7 @@ jobs: - name: Build coverage binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -77,7 +77,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build @@ -86,7 +86,7 @@ jobs: - name: Compute code coverage run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Compute code coverage. cd tools/github @@ -121,7 +121,7 @@ jobs: - name: Build debug binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -134,7 +134,7 @@ jobs: - name: Run leftover CTest tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run leftover CTest tests (all except unit and benchmark tests). cd build @@ -166,7 +166,7 @@ jobs: - name: Run cppcheck and clang-format run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run cppcheck and clang-format. cd tools/github @@ -198,7 +198,7 @@ jobs: - name: Build release binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -211,7 +211,7 @@ jobs: - name: Create enterprise RPM package run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate cd build @@ -233,7 +233,7 @@ jobs: - name: Run micro benchmark tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run micro benchmark tests. cd build @@ -272,7 +272,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build diff --git a/.github/workflows/release_debian10.yaml b/.github/workflows/release_debian10.yaml index bc5672ef2..64d0e7f9a 100644 --- a/.github/workflows/release_debian10.yaml +++ b/.github/workflows/release_debian10.yaml @@ -26,7 +26,7 @@ jobs: - name: Build community binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -39,7 +39,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build @@ -64,7 +64,7 @@ jobs: - name: Build coverage binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -77,7 +77,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build @@ -86,7 +86,7 @@ jobs: - name: Compute code coverage run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Compute code coverage. cd tools/github @@ -121,7 +121,7 @@ jobs: - name: Build debug binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -134,7 +134,7 @@ jobs: - name: Run leftover CTest tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run leftover CTest tests (all except unit and benchmark tests). cd build @@ -166,7 +166,7 @@ jobs: - name: Run cppcheck and clang-format run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run cppcheck and clang-format. cd tools/github @@ -198,7 +198,7 @@ jobs: - name: Build release binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -211,7 +211,7 @@ jobs: - name: Create enterprise DEB package run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate cd build @@ -232,7 +232,7 @@ jobs: - name: Run micro benchmark tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run micro benchmark tests. cd build @@ -271,7 +271,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build @@ -333,7 +333,7 @@ jobs: - name: Build release binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init diff --git a/.github/workflows/release_ubuntu2004.yaml b/.github/workflows/release_ubuntu2004.yaml index b31a691ea..4f8b94586 100644 --- a/.github/workflows/release_ubuntu2004.yaml +++ b/.github/workflows/release_ubuntu2004.yaml @@ -26,7 +26,7 @@ jobs: - name: Build community binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -39,7 +39,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build @@ -64,7 +64,7 @@ jobs: - name: Build coverage binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -77,7 +77,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build @@ -86,7 +86,7 @@ jobs: - name: Compute code coverage run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Compute code coverage. cd tools/github @@ -121,7 +121,7 @@ jobs: - name: Build debug binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -134,7 +134,7 @@ jobs: - name: Run leftover CTest tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run leftover CTest tests (all except unit and benchmark tests). cd build @@ -166,7 +166,7 @@ jobs: - name: Run cppcheck and clang-format run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run cppcheck and clang-format. cd tools/github @@ -198,7 +198,7 @@ jobs: - name: Build release binaries run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Initialize dependencies. ./init @@ -211,7 +211,7 @@ jobs: - name: Create enterprise DEB package run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate cd build @@ -232,7 +232,7 @@ jobs: - name: Run micro benchmark tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run micro benchmark tests. cd build @@ -271,7 +271,7 @@ jobs: - name: Run unit tests run: | # Activate toolchain. - source /opt/toolchain-v3/activate + source /opt/toolchain-v4/activate # Run unit tests. cd build diff --git a/cmake/FindJemalloc.cmake b/cmake/FindJemalloc.cmake new file mode 100644 index 000000000..1f336fd10 --- /dev/null +++ b/cmake/FindJemalloc.cmake @@ -0,0 +1,55 @@ +# Try to find jemalloc library +# +# Use this module as: +# find_package(Jemalloc) +# +# or: +# find_package(Jemalloc REQUIRED) +# +# This will define the following variables: +# +# Jemalloc_FOUND True if the system has the jemalloc library. +# Jemalloc_INCLUDE_DIRS Include directories needed to use jemalloc. +# Jemalloc_LIBRARIES Libraries needed to link to jemalloc. +# +# The following cache variables may also be set: +# +# Jemalloc_INCLUDE_DIR The directory containing jemalloc/jemalloc.h. +# Jemalloc_LIBRARY The path to the jemalloc static library. + +find_path(Jemalloc_INCLUDE_DIR NAMES jemalloc/jemalloc.h PATH_SUFFIXES include) + +find_library(Jemalloc_LIBRARY NAMES libjemalloc.a PATH_SUFFIXES lib) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Jemalloc + FOUND_VAR Jemalloc_FOUND + REQUIRED_VARS + Jemalloc_LIBRARY + Jemalloc_INCLUDE_DIR +) + +if(Jemalloc_FOUND) + set(Jemalloc_LIBRARIES ${Jemalloc_LIBRARY}) + set(Jemalloc_INCLUDE_DIRS ${Jemalloc_INCLUDE_DIR}) +else() + if(Jemalloc_FIND_REQUIRED) + message(FATAL_ERROR "Cannot find jemalloc!") + else() + message(WARNING "jemalloc is not found!") + endif() +endif() + +if(Jemalloc_FOUND AND NOT TARGET Jemalloc::Jemalloc) + add_library(Jemalloc::Jemalloc UNKNOWN IMPORTED) + set_target_properties(Jemalloc::Jemalloc + PROPERTIES + IMPORTED_LOCATION "${Jemalloc_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${Jemalloc_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced( + Jemalloc_INCLUDE_DIR + Jemalloc_LIBRARY +) \ No newline at end of file diff --git a/environment/os/centos-7.sh b/environment/os/centos-7.sh index b8ffede4a..fa9aff2f7 100755 --- a/environment/os/centos-7.sh +++ b/environment/os/centos-7.sh @@ -14,9 +14,14 @@ TOOLCHAIN_BUILD_DEPS=( expat-devel libipt-devel libbabeltrace-devel xz-devel python3-devel # gdb texinfo # gdb libcurl-devel # cmake + curl # snappy readline-devel # cmake and llvm libffi-devel libxml2-devel perl-Digest-MD5 # llvm libedit-devel pcre-devel automake bison # swig + file + openssl-devel + gmp-devel + gperf ) TOOLCHAIN_RUN_DEPS=( @@ -26,10 +31,10 @@ TOOLCHAIN_RUN_DEPS=( expat libipt libbabeltrace xz-libs python3 # for gdb readline # for cmake and llvm libffi libxml2 # for llvm + openssl-devel ) MEMGRAPH_BUILD_DEPS=( - git # source code control make pkgconfig # build system curl wget # for downloading libs libuuid-devel java-11-openjdk # required by antlr @@ -95,8 +100,12 @@ install() { echo "NOTE: export LANG=en_US.utf8" fi yum install -y epel-release + yum remove -y ius-release + yum install -y \ + https://repo.ius.io/ius-release-el7.rpm yum update -y - yum install -y wget git python3 python3-pip + yum install -y wget python3 python3-pip + yum install -y git224 for pkg in $1; do if [ "$pkg" == libipt ]; then if ! yum list installed libipt >/dev/null 2>/dev/null; then diff --git a/environment/os/centos-8.sh b/environment/os/centos-8.sh index 994fc0e88..61de17039 100755 --- a/environment/os/centos-8.sh +++ b/environment/os/centos-8.sh @@ -13,9 +13,14 @@ TOOLCHAIN_BUILD_DEPS=( zlib-devel # zlib library used for all builds expat-devel libipt-devel libbabeltrace-devel xz-devel python36-devel texinfo # for gdb libcurl-devel # for cmake + curl # snappy readline-devel # for cmake and llvm libffi-devel libxml2-devel # for llvm libedit-devel pcre-devel automake bison # for swig + file + openssl-devel + gmp-devel + gperf ) TOOLCHAIN_RUN_DEPS=( @@ -25,6 +30,7 @@ TOOLCHAIN_RUN_DEPS=( expat libipt libbabeltrace xz-libs python36 # for gdb readline # for cmake and llvm libffi libxml2 # for llvm + openssl-devel ) MEMGRAPH_BUILD_DEPS=( diff --git a/environment/os/debian-10.sh b/environment/os/debian-10.sh index 50ca5e8cd..bb0c3affa 100755 --- a/environment/os/debian-10.sh +++ b/environment/os/debian-10.sh @@ -15,6 +15,12 @@ TOOLCHAIN_BUILD_DEPS=( libcurl4-openssl-dev # for cmake libreadline-dev # for cmake and llvm libffi-dev libxml2-dev # for llvm + curl # snappy + file # for libunwind + libssl-dev # for libevent + libgmp-dev # for gdb + gperf # for proxygen + git # for fbthrift libedit-dev libpcre3-dev automake bison # for swig ) @@ -26,6 +32,7 @@ TOOLCHAIN_RUN_DEPS=( libcurl4 # for cmake libreadline7 # for cmake and llvm libffi6 libxml2 # for llvm + libssl-dev # for libevent ) MEMGRAPH_BUILD_DEPS=( diff --git a/environment/os/debian-11.sh b/environment/os/debian-11.sh index 8e73688e5..1e361faf0 100755 --- a/environment/os/debian-11.sh +++ b/environment/os/debian-11.sh @@ -16,6 +16,12 @@ TOOLCHAIN_BUILD_DEPS=( libreadline-dev # for cmake and llvm libffi-dev libxml2-dev # for llvm libedit-dev libpcre3-dev automake bison # for swig + curl # snappy + file # for libunwind + libssl-dev # for libevent + libgmp-dev + gperf # for proxygen + git # for fbthrift ) TOOLCHAIN_RUN_DEPS=( @@ -27,6 +33,7 @@ TOOLCHAIN_RUN_DEPS=( file # for CPack libreadline8 # for cmake and llvm libffi7 libxml2 # for llvm + libssl-dev # for libevent ) MEMGRAPH_BUILD_DEPS=( diff --git a/environment/os/debian-9.sh b/environment/os/debian-9.sh deleted file mode 100755 index 1f94adcee..000000000 --- a/environment/os/debian-9.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -set -Eeuo pipefail - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source "$DIR/../util.sh" - -TOOLCHAIN_BUILD_DEPS=( - coreutils gcc g++ build-essential make # generic build tools - wget # used for archive download - gnupg # used for archive signature verification - tar gzip bzip2 xz-utils unzip # used for archive unpacking - zlib1g-dev # zlib library used for all builds - libexpat1-dev libipt-dev libbabeltrace-dev libbabeltrace-ctf-dev liblzma-dev python3-dev texinfo # for gdb - libcurl4-openssl-dev # for cmake - libreadline-dev # for cmake and llvm - libffi-dev libxml2-dev # for llvm - libedit-dev libpcre3-dev automake bison # for swig -) - -TOOLCHAIN_RUN_DEPS=( - make # generic build tools - tar gzip bzip2 xz-utils # used for archive unpacking - zlib1g # zlib library used for all builds - libexpat1 libipt1 libbabeltrace1 libbabeltrace-ctf1 liblzma5 python3 # for gdb - libcurl3 # for cmake - libreadline7 # for cmake and llvm - libffi6 libxml2 # for llvm -) - -MEMGRAPH_BUILD_DEPS=( - git # source code control - make pkg-config # build system - curl wget # for downloading libs - uuid-dev default-jre-headless # required by antlr - libreadline-dev # for memgraph console - libpython3-dev python3-dev # for query modules - libssl-dev - libseccomp-dev - python3 python-virtualenv python3-pip # for qa, macro_benchmark and stress tests - python3-yaml # for the configuration generator - libcurl4-openssl-dev # mg-requests - sbcl # for custom Lisp C++ preprocessing - doxygen graphviz # source documentation generators - mono-runtime mono-mcs nodejs zip unzip default-jdk-headless # for driver tests - autoconf # for jemalloc code generation - libtool # for protobuf code generation -) - -list() { - echo "$1" -} - -check() { - check_all_dpkg "$1" -} - -install() { - install_all_apt "$1" -} - -deps=$2"[*]" -"$1" "${!deps}" diff --git a/environment/os/ubuntu-18.04.sh b/environment/os/ubuntu-18.04.sh index 6856039d1..2d571f922 100755 --- a/environment/os/ubuntu-18.04.sh +++ b/environment/os/ubuntu-18.04.sh @@ -16,6 +16,12 @@ TOOLCHAIN_BUILD_DEPS=( libcurl4-openssl-dev # cmake libreadline-dev # cmake and llvm libffi-dev libxml2-dev # llvm + curl # snappy + file + git # for thrift + libgmp-dev # for gdb + gperf # for proxygen + libssl-dev libedit-dev libpcre3-dev automake bison # swig ) @@ -27,6 +33,7 @@ TOOLCHAIN_RUN_DEPS=( libcurl4 # for cmake libreadline7 # for cmake and llvm libffi6 libxml2 # for llvm + libssl-dev # for libevent ) MEMGRAPH_BUILD_DEPS=( diff --git a/environment/os/ubuntu-20.04.sh b/environment/os/ubuntu-20.04.sh index 6b9e643cf..6519d5153 100755 --- a/environment/os/ubuntu-20.04.sh +++ b/environment/os/ubuntu-20.04.sh @@ -15,6 +15,12 @@ TOOLCHAIN_BUILD_DEPS=( libcurl4-openssl-dev # for cmake libreadline-dev # for cmake and llvm libffi-dev libxml2-dev # for llvm + curl # snappy + file + git # for thrift + libgmp-dev # for gdb + gperf # for proxygen + libssl-dev libedit-dev libpcre3-dev automake bison # for swig ) @@ -26,6 +32,7 @@ TOOLCHAIN_RUN_DEPS=( libcurl4 # for cmake libreadline8 # for cmake and llvm libffi7 libxml2 # for llvm + libssl-dev # for libevent ) MEMGRAPH_BUILD_DEPS=( diff --git a/environment/toolchain/proxygen.diff b/environment/toolchain/proxygen.diff new file mode 100644 index 000000000..f0790413e --- /dev/null +++ b/environment/toolchain/proxygen.diff @@ -0,0 +1,2 @@ +24d23 +< find_dependency(mvfst) diff --git a/environment/toolchain/snappy.diff b/environment/toolchain/snappy.diff new file mode 100644 index 000000000..4b8a9ba20 --- /dev/null +++ b/environment/toolchain/snappy.diff @@ -0,0 +1,16 @@ +55,57c55,57 +< # Disable RTTI. +< string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +< set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") +--- +> # # Disable RTTI. +> # string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +> # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") +80,82c80,82 +< # Disable RTTI. +< string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +< set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") +--- +> # # Disable RTTI. +> # string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +> # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") diff --git a/environment/toolchain/v4.sh b/environment/toolchain/v4.sh new file mode 100755 index 000000000..63f39f76d --- /dev/null +++ b/environment/toolchain/v4.sh @@ -0,0 +1,1089 @@ +#!/bin/bash -e + +# helpers +pushd () { command pushd "$@" > /dev/null; } +popd () { command popd "$@" > /dev/null; } +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +CPUS=$( grep -c processor < /proc/cpuinfo ) +cd "$DIR" + +source "$DIR/../util.sh" +DISTRO="$(operating_system)" + +# toolchain version +TOOLCHAIN_VERSION=4 + +# package versions used +GCC_VERSION=11.2.0 +BINUTILS_VERSION=2.37 +case "$DISTRO" in + centos-7) # because GDB >= 9 does NOT compile with readline6. + GDB_VERSION=8.3 + ;; + *) + GDB_VERSION=11.1 + ;; +esac +CMAKE_VERSION=3.22.1 +CPPCHECK_VERSION=2.6 +LLVM_VERSION=13.0.0 +SWIG_VERSION=4.0.2 # used only for LLVM compilation + +# Check for the dependencies. +echo "ALL BUILD PACKAGES: $($DIR/../os/$DISTRO.sh list TOOLCHAIN_BUILD_DEPS)" +$DIR/../os/$DISTRO.sh check TOOLCHAIN_BUILD_DEPS +echo "ALL RUN PACKAGES: $($DIR/../os/$DISTRO.sh list TOOLCHAIN_RUN_DEPS)" +$DIR/../os/$DISTRO.sh check TOOLCHAIN_RUN_DEPS + +# check installation directory +NAME=toolchain-v$TOOLCHAIN_VERSION +PREFIX=/opt/$NAME +mkdir -p $PREFIX >/dev/null 2>/dev/null || true +if [ ! -d $PREFIX ] || [ ! -w $PREFIX ]; then + echo "Please make sure that the directory '$PREFIX' exists and is writable by the current user!" + echo + echo "If unsure, execute these commands as root:" + echo " mkdir $PREFIX && chown $USER:$USER $PREFIX" + echo + echo "Press when you have created the directory and granted permissions." + # wait for the directory to be created + while true; do + read + if [ ! -d $PREFIX ] || [ ! -w $PREFIX ]; then + echo + echo "You can't continue before you have created the directory and granted permissions!" + echo + echo "Press when you have created the directory and granted permissions." + else + break + fi + done +fi + +# create archives directory +mkdir -p archives + +# download all archives +pushd archives +if [ ! -f gcc-$GCC_VERSION.tar.gz ]; then + wget https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.gz +fi +if [ ! -f binutils-$BINUTILS_VERSION.tar.gz ]; then + wget https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS_VERSION.tar.gz +fi +if [ ! -f gdb-$GDB_VERSION.tar.gz ]; then + wget https://ftp.gnu.org/gnu/gdb/gdb-$GDB_VERSION.tar.gz +fi +if [ ! -f cmake-$CMAKE_VERSION.tar.gz ]; then + wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION.tar.gz +fi +if [ ! -f cppcheck-$CPPCHECK_VERSION.tar.gz ]; then + wget https://github.com/danmar/cppcheck/archive/$CPPCHECK_VERSION.tar.gz -O cppcheck-$CPPCHECK_VERSION.tar.gz +fi +if [ ! -f llvm-$LLVM_VERSION.src.tar.xz ]; then + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.xz + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.xz + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/lld-$LLVM_VERSION.src.tar.xz + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/clang-tools-extra-$LLVM_VERSION.src.tar.xz + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/compiler-rt-$LLVM_VERSION.src.tar.xz + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/libunwind-$LLVM_VERSION.src.tar.xz +fi +if [ ! -f pahole-gdb-master.zip ]; then + wget https://github.com/PhilArmstrong/pahole-gdb/archive/master.zip -O pahole-gdb-master.zip +fi +if [ ! -f swig-$SWIG_VERSION.tar.gz ]; then + wget https://github.com/swig/swig/archive/rel-$SWIG_VERSION.tar.gz -O swig-$SWIG_VERSION.tar.gz +fi + + +# verify all archives +# NOTE: Verification can fail if the archive is signed by another developer. I +# haven't added commands to download all developer GnuPG keys because the +# download is very slow. If the verification fails for you, figure out who has +# signed the archive and download their public key instead. +GPG="gpg --homedir .gnupg" +KEYSERVER="hkp://keyserver.ubuntu.com" + +mkdir -p .gnupg +chmod 700 .gnupg +# verify gcc +if [ ! -f gcc-$GCC_VERSION.tar.gz.sig ]; then + wget https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.gz.sig +fi +# list of valid gcc gnupg keys: https://gcc.gnu.org/mirrors.html +$GPG --keyserver $KEYSERVER --recv-keys FC26A641 +$GPG --verify gcc-$GCC_VERSION.tar.gz.sig gcc-$GCC_VERSION.tar.gz +# verify binutils +if [ ! -f binutils-$BINUTILS_VERSION.tar.gz.sig ]; then + wget https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS_VERSION.tar.gz.sig +fi +$GPG --keyserver $KEYSERVER --recv-keys 0xDD9E3C4F +$GPG --verify binutils-$BINUTILS_VERSION.tar.gz.sig binutils-$BINUTILS_VERSION.tar.gz +# verify gdb +if [ ! -f gdb-$GDB_VERSION.tar.gz.sig ]; then + wget https://ftp.gnu.org/gnu/gdb/gdb-$GDB_VERSION.tar.gz.sig +fi +$GPG --keyserver $KEYSERVER --recv-keys 0xFF325CF3 +$GPG --verify gdb-$GDB_VERSION.tar.gz.sig gdb-$GDB_VERSION.tar.gz +# verify cmake +if [ ! -f cmake-$CMAKE_VERSION-SHA-256.txt ] || [ ! -f cmake-$CMAKE_VERSION-SHA-256.txt.asc ]; then + wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt + wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt.asc + # Because CentOS 7 doesn't have the `--ignore-missing` flag for `sha256sum` + # we filter out the missing files from the sums here manually. + cat cmake-$CMAKE_VERSION-SHA-256.txt | grep "cmake-$CMAKE_VERSION.tar.gz" > cmake-$CMAKE_VERSION-SHA-256-filtered.txt +fi +$GPG --keyserver $KEYSERVER --recv-keys 0xC6C265324BBEBDC350B513D02D2CEF1034921684 +sha256sum -c cmake-$CMAKE_VERSION-SHA-256-filtered.txt +$GPG --verify cmake-$CMAKE_VERSION-SHA-256.txt.asc cmake-$CMAKE_VERSION-SHA-256.txt +# verify llvm, cfe, lld, clang-tools-extra +if [ ! -f llvm-$LLVM_VERSION.src.tar.xz.sig ]; then + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.xz.sig + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.xz.sig + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/lld-$LLVM_VERSION.src.tar.xz.sig + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/clang-tools-extra-$LLVM_VERSION.src.tar.xz.sig + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/compiler-rt-$LLVM_VERSION.src.tar.xz.sig + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/libunwind-$LLVM_VERSION.src.tar.xz.sig +fi +# list of valid llvm gnupg keys: https://releases.llvm.org/download.html +$GPG --keyserver $KEYSERVER --recv-keys 0x474E22316ABF4785A88C6E8EA2C794A986419D8A +$GPG --verify llvm-$LLVM_VERSION.src.tar.xz.sig llvm-$LLVM_VERSION.src.tar.xz +$GPG --verify clang-$LLVM_VERSION.src.tar.xz.sig clang-$LLVM_VERSION.src.tar.xz +$GPG --verify lld-$LLVM_VERSION.src.tar.xz.sig lld-$LLVM_VERSION.src.tar.xz +$GPG --verify clang-tools-extra-$LLVM_VERSION.src.tar.xz.sig clang-tools-extra-$LLVM_VERSION.src.tar.xz +$GPG --verify compiler-rt-$LLVM_VERSION.src.tar.xz.sig compiler-rt-$LLVM_VERSION.src.tar.xz +$GPG --verify libunwind-$LLVM_VERSION.src.tar.xz.sig libunwind-$LLVM_VERSION.src.tar.xz + +popd + +# create build directory +mkdir -p build +pushd build + +# compile gcc +if [ ! -f $PREFIX/bin/gcc ]; then + if [ -d gcc-$GCC_VERSION ]; then + rm -rf gcc-$GCC_VERSION + fi + tar -xvf ../archives/gcc-$GCC_VERSION.tar.gz + pushd gcc-$GCC_VERSION + ./contrib/download_prerequisites + mkdir build && pushd build + # influenced by: https://buildd.debian.org/status/fetch.php?pkg=gcc-8&arch=amd64&ver=8.3.0-6&stamp=1554588545 + ../configure -v \ + --build=x86_64-linux-gnu \ + --host=x86_64-linux-gnu \ + --target=x86_64-linux-gnu \ + --prefix=$PREFIX \ + --disable-multilib \ + --with-system-zlib \ + --enable-checking=release \ + --enable-languages=c,c++,fortran \ + --enable-gold=yes \ + --enable-ld=yes \ + --enable-lto \ + --enable-bootstrap \ + --disable-vtable-verify \ + --disable-werror \ + --without-included-gettext \ + --enable-threads=posix \ + --enable-nls \ + --enable-clocale=gnu \ + --enable-libstdcxx-debug \ + --enable-libstdcxx-time=yes \ + --enable-gnu-unique-object \ + --enable-libmpx \ + --enable-plugin \ + --enable-default-pie \ + --with-target-system-zlib \ + --with-tune=generic \ + --without-cuda-driver + #--program-suffix=$( printf "$GCC_VERSION" | cut -d '.' -f 1,2 ) \ + make -j$CPUS + # make -k check # run test suite + make install + popd && popd +fi + +# activate toolchain +export PATH=$PREFIX/bin:$PATH +export LD_LIBRARY_PATH=$PREFIX/lib64 + +# compile binutils +if [ ! -f $PREFIX/bin/ld.gold ]; then + if [ -d binutils-$BINUTILS_VERSION ]; then + rm -rf binutils-$BINUTILS_VERSION + fi + tar -xvf ../archives/binutils-$BINUTILS_VERSION.tar.gz + pushd binutils-$BINUTILS_VERSION + mkdir build && pushd build + # influenced by: https://buildd.debian.org/status/fetch.php?pkg=binutils&arch=amd64&ver=2.32-7&stamp=1553247092 + env \ + CC=gcc \ + CXX=g++ \ + CFLAGS="-g -O2" \ + CXXFLAGS="-g -O2" \ + LDFLAGS="" \ + ../configure \ + --build=x86_64-linux-gnu \ + --host=x86_64-linux-gnu \ + --prefix=$PREFIX \ + --enable-ld=default \ + --enable-gold \ + --enable-lto \ + --enable-plugins \ + --enable-shared \ + --enable-threads \ + --with-system-zlib \ + --enable-deterministic-archives \ + --disable-compressed-debug-sections \ + --enable-new-dtags \ + --disable-werror + make -j$CPUS + # make -k check # run test suite + make install + popd && popd +fi + +# compile gdb +if [ ! -f $PREFIX/bin/gdb ]; then + if [ -d gdb-$GDB_VERSION ]; then + rm -rf gdb-$GDB_VERSION + fi + tar -xvf ../archives/gdb-$GDB_VERSION.tar.gz + pushd gdb-$GDB_VERSION + mkdir build && pushd build + # https://buildd.debian.org/status/fetch.php?pkg=gdb&arch=amd64&ver=8.2.1-2&stamp=1550831554&raw=0 + env \ + CC=gcc \ + CXX=g++ \ + CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" \ + CXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" \ + CPPFLAGS="-Wdate-time -D_FORTIFY_SOURCE=2 -fPIC" \ + LDFLAGS="-Wl,-z,relro" \ + PYTHON="" \ + ../configure \ + --build=x86_64-linux-gnu \ + --host=x86_64-linux-gnu \ + --prefix=$PREFIX \ + --disable-maintainer-mode \ + --disable-dependency-tracking \ + --disable-silent-rules \ + --disable-gdbtk \ + --disable-shared \ + --without-guile \ + --with-system-gdbinit=$PREFIX/etc/gdb/gdbinit \ + --with-system-readline \ + --with-expat \ + --with-system-zlib \ + --with-lzma \ + --with-babeltrace \ + --with-intel-pt \ + --enable-tui \ + --with-python=python3 + make -j$CPUS + make install + popd && popd +fi + +# install pahole +if [ ! -d $PREFIX/share/pahole-gdb ]; then + unzip ../archives/pahole-gdb-master.zip + mv pahole-gdb-master $PREFIX/share/pahole-gdb +fi + +# setup system gdbinit +if [ ! -f $PREFIX/etc/gdb/gdbinit ]; then + mkdir -p $PREFIX/etc/gdb + cat >$PREFIX/etc/gdb/gdbinit <> build-flags.cmake + echo 'set(CMAKE_USE_RELATIVE_PATHS ON CACHE BOOL "Use relative paths" FORCE)' >> build-flags.cmake + echo 'set(CMAKE_C_FLAGS "-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" CACHE STRING "C flags" FORCE)' >> build-flags.cmake + echo 'set(CMAKE_CXX_FLAGS "-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" CACHE STRING "C++ flags" FORCE)' >> build-flags.cmake + echo 'set(CMAKE_SKIP_BOOTSTRAP_TEST ON CACHE BOOL "Skip BootstrapTest" FORCE)' >> build-flags.cmake + echo 'set(BUILD_CursesDialog ON CACHE BOOL "Build curses GUI" FORCE)' >> build-flags.cmake + mkdir build && pushd build + ../bootstrap \ + --prefix=$PREFIX \ + --init=../build-flags.cmake \ + --parallel=$CPUS \ + --system-curl + make -j$CPUS + # make test # run test suite + make install + popd && popd +fi + +# compile cppcheck +if [ ! -f $PREFIX/bin/cppcheck ]; then + if [ -d cppcheck-$CPPCHECK_VERSION ]; then + rm -rf cppcheck-$CPPCHECK_VERSION + fi + tar -xvf ../archives/cppcheck-$CPPCHECK_VERSION.tar.gz + pushd cppcheck-$CPPCHECK_VERSION + env \ + CC=gcc \ + CXX=g++ \ + PREFIX=$PREFIX \ + FILESDIR=$PREFIX/share/cppcheck \ + CFGDIR=$PREFIX/share/cppcheck/cfg \ + make -j$CPUS + env \ + CC=gcc \ + CXX=g++ \ + PREFIX=$PREFIX \ + FILESDIR=$PREFIX/share/cppcheck \ + CFGDIR=$PREFIX/share/cppcheck/cfg \ + make install + popd +fi + +# compile swig +if [ ! -d swig-$SWIG_VERSION/install ]; then + if [ -d swig-$SWIG_VERSION ]; then + rm -rf swig-$SWIG_VERSION + fi + tar -xvf ../archives/swig-$SWIG_VERSION.tar.gz + mv swig-rel-$SWIG_VERSION swig-$SWIG_VERSION + pushd swig-$SWIG_VERSION + ./autogen.sh + mkdir build && pushd build + ../configure --prefix=$DIR/build/swig-$SWIG_VERSION/install + make -j$CPUS + make install + popd && popd +fi + +# compile llvm +if [ ! -f $PREFIX/bin/clang ]; then + if [ -d llvm-$LLVM_VERSION ]; then + rm -rf llvm-$LLVM_VERSION + fi + tar -xvf ../archives/llvm-$LLVM_VERSION.src.tar.xz + mv llvm-$LLVM_VERSION.src llvm-$LLVM_VERSION + tar -xvf ../archives/clang-$LLVM_VERSION.src.tar.xz + mv clang-$LLVM_VERSION.src llvm-$LLVM_VERSION/tools/clang + tar -xvf ../archives/lld-$LLVM_VERSION.src.tar.xz + mv lld-$LLVM_VERSION.src/ llvm-$LLVM_VERSION/tools/lld + tar -xvf ../archives/clang-tools-extra-$LLVM_VERSION.src.tar.xz + mv clang-tools-extra-$LLVM_VERSION.src/ llvm-$LLVM_VERSION/tools/clang/tools/extra + tar -xvf ../archives/compiler-rt-$LLVM_VERSION.src.tar.xz + mv compiler-rt-$LLVM_VERSION.src/ llvm-$LLVM_VERSION/projects/compiler-rt + tar -xvf ../archives/libunwind-$LLVM_VERSION.src.tar.xz + mv libunwind-$LLVM_VERSION.src/include/mach-o llvm-$LLVM_VERSION/tools/lld/include + pushd llvm-$LLVM_VERSION + mkdir build && pushd build + # activate swig + export PATH=$DIR/build/swig-$SWIG_VERSION/install/bin:$PATH + # influenced by: https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-7&arch=amd64&ver=1%3A7.0.1%7E%2Brc2-1%7Eexp1&stamp=1541506173&raw=0 + cmake .. \ + -DCMAKE_C_COMPILER=$PREFIX/bin/gcc \ + -DCMAKE_CXX_COMPILER=$PREFIX/bin/g++ \ + -DCMAKE_CXX_LINK_FLAGS="-L$PREFIX/lib64 -Wl,-rpath,$PREFIX/lib64" \ + -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -DNDEBUG" \ + -DCMAKE_CXX_FLAGS=' -fuse-ld=gold -fPIC -Wno-unused-command-line-argument -Wno-unknown-warning-option' \ + -DCMAKE_C_FLAGS=' -fuse-ld=gold -fPIC -Wno-unused-command-line-argument -Wno-unknown-warning-option' \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DLLVM_INSTALL_UTILS=ON \ + -DLLVM_VERSION_SUFFIX= \ + -DLLVM_BUILD_LLVM_DYLIB=ON \ + -DLLVM_ENABLE_RTTI=ON \ + -DLLVM_ENABLE_FFI=ON \ + -DLLVM_BINUTILS_INCDIR=$PREFIX/include/ \ + -DLLVM_USE_PERF=yes + make -j$CPUS + make -j$CPUS check-clang # run clang test suite + make -j$CPUS check-lld # run lld test suite + make install + popd && popd +fi + +popd + +# create README +if [ ! -f $PREFIX/README.md ]; then + cat >$PREFIX/README.md <$PREFIX/activate <{}, std::optional{}, ConsumerFunction{}) } -> std::same_as; - { typename TStream::StreamInfo{}.common_info } -> std::same_as; + requires std::same_as().common_info)>, + CommonStreamInfo>; requires ConvertableToMgpMessage; requires ConvertableToJson; diff --git a/tests/benchmark/data_structures/ring_buffer.cpp b/tests/benchmark/data_structures/ring_buffer.cpp index 8635c46d1..6203b29b3 100644 --- a/tests/benchmark/data_structures/ring_buffer.cpp +++ b/tests/benchmark/data_structures/ring_buffer.cpp @@ -10,7 +10,6 @@ // licenses/APL.txt. #include -#include #include #include "data_structures/ring_buffer.hpp" diff --git a/tests/benchmark/expansion.cpp b/tests/benchmark/expansion.cpp index f35b99640..8a0871d83 100644 --- a/tests/benchmark/expansion.cpp +++ b/tests/benchmark/expansion.cpp @@ -10,7 +10,6 @@ // licenses/APL.txt. #include -#include #include "communication/result_stream_faker.hpp" #include "query/config.hpp" diff --git a/tests/benchmark/query/planner.cpp b/tests/benchmark/query/planner.cpp index d8922c238..cecb72c13 100644 --- a/tests/benchmark/query/planner.cpp +++ b/tests/benchmark/query/planner.cpp @@ -9,7 +9,7 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -#include +#include #include #include diff --git a/tests/benchmark/query/profile.cpp b/tests/benchmark/query/profile.cpp index 89a1320d0..49e912a95 100644 --- a/tests/benchmark/query/profile.cpp +++ b/tests/benchmark/query/profile.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include "query/context.hpp" #include "utils/tsc.hpp" diff --git a/tests/benchmark/query/stripped.cpp b/tests/benchmark/query/stripped.cpp index c52537bd9..3a6698ebc 100644 --- a/tests/benchmark/query/stripped.cpp +++ b/tests/benchmark/query/stripped.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include "query/frontend/stripped.hpp" diff --git a/tests/benchmark/rpc.cpp b/tests/benchmark/rpc.cpp index b6a17e0e2..95e0709c1 100644 --- a/tests/benchmark/rpc.cpp +++ b/tests/benchmark/rpc.cpp @@ -64,7 +64,7 @@ std::optional client_pool; static void BenchmarkRpc(benchmark::State &state) { std::string data(state.range(0), 'a'); while (state.KeepRunning()) { - clients[state.thread_index]->Call(data); + clients[state.thread_index()]->Call(data); } state.SetItemsProcessed(state.iterations()); } diff --git a/tests/benchmark/skip_list_vs_stl.cpp b/tests/benchmark/skip_list_vs_stl.cpp index 287bc8c20..67674f685 100644 --- a/tests/benchmark/skip_list_vs_stl.cpp +++ b/tests/benchmark/skip_list_vs_stl.cpp @@ -30,7 +30,7 @@ const uint64_t kMaxNum = 10000000; class SkipListSetInsertFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0) { + if (state.thread_index() == 0) { list = utils::SkipList(); } } @@ -40,7 +40,7 @@ class SkipListSetInsertFixture : public benchmark::Fixture { }; BENCHMARK_DEFINE_F(SkipListSetInsertFixture, Insert)(benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -64,7 +64,7 @@ BENCHMARK_REGISTER_F(SkipListSetInsertFixture, Insert) class StdSetInsertFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0) { + if (state.thread_index() == 0) { container = {}; } } @@ -75,7 +75,7 @@ class StdSetInsertFixture : public benchmark::Fixture { }; BENCHMARK_DEFINE_F(StdSetInsertFixture, Insert)(benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -95,7 +95,7 @@ BENCHMARK_REGISTER_F(StdSetInsertFixture, Insert) class StdSetWithPoolAllocatorInsertFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0) { + if (state.thread_index() == 0) { container.clear(); } } @@ -108,7 +108,7 @@ class StdSetWithPoolAllocatorInsertFixture : public benchmark::Fixture { BENCHMARK_DEFINE_F(StdSetWithPoolAllocatorInsertFixture, Insert) (benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -132,7 +132,7 @@ BENCHMARK_REGISTER_F(StdSetWithPoolAllocatorInsertFixture, Insert) class SkipListSetFindFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0 && list.size() == 0) { + if (state.thread_index() == 0 && list.size() == 0) { auto acc = list.access(); for (uint64_t i = 0; i < kMaxNum; ++i) { acc.insert(i); @@ -145,7 +145,7 @@ class SkipListSetFindFixture : public benchmark::Fixture { }; BENCHMARK_DEFINE_F(SkipListSetFindFixture, Find)(benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -169,7 +169,7 @@ BENCHMARK_REGISTER_F(SkipListSetFindFixture, Find) class StdSetFindFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0 && container.size() == 0) { + if (state.thread_index() == 0 && container.size() == 0) { for (uint64_t i = 0; i < kMaxNum; ++i) { container.insert(i); } @@ -182,7 +182,7 @@ class StdSetFindFixture : public benchmark::Fixture { }; BENCHMARK_DEFINE_F(StdSetFindFixture, Find)(benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -199,7 +199,7 @@ BENCHMARK_REGISTER_F(StdSetFindFixture, Find)->ThreadRange(1, kThreadsNum)->Unit class StdSetWithPoolAllocatorFindFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0 && container.size() == 0) { + if (state.thread_index() == 0 && container.size() == 0) { for (uint64_t i = 0; i < kMaxNum; ++i) { container.insert(i); } @@ -214,7 +214,7 @@ class StdSetWithPoolAllocatorFindFixture : public benchmark::Fixture { BENCHMARK_DEFINE_F(StdSetWithPoolAllocatorFindFixture, Find) (benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -252,7 +252,7 @@ bool operator<(const MapObject &a, uint64_t b) { return a.key < b; } class SkipListMapInsertFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0) { + if (state.thread_index() == 0) { list = utils::SkipList(); } } @@ -262,7 +262,7 @@ class SkipListMapInsertFixture : public benchmark::Fixture { }; BENCHMARK_DEFINE_F(SkipListMapInsertFixture, Insert)(benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -286,7 +286,7 @@ BENCHMARK_REGISTER_F(SkipListMapInsertFixture, Insert) class StdMapInsertFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0) { + if (state.thread_index() == 0) { container = {}; } } @@ -297,7 +297,7 @@ class StdMapInsertFixture : public benchmark::Fixture { }; BENCHMARK_DEFINE_F(StdMapInsertFixture, Insert)(benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -317,7 +317,7 @@ BENCHMARK_REGISTER_F(StdMapInsertFixture, Insert) class StdMapWithPoolAllocatorInsertFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0) { + if (state.thread_index() == 0) { container = {}; } } @@ -330,7 +330,7 @@ class StdMapWithPoolAllocatorInsertFixture : public benchmark::Fixture { BENCHMARK_DEFINE_F(StdMapWithPoolAllocatorInsertFixture, Insert) (benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -354,7 +354,7 @@ BENCHMARK_REGISTER_F(StdMapWithPoolAllocatorInsertFixture, Insert) class SkipListMapFindFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0 && list.size() == 0) { + if (state.thread_index() == 0 && list.size() == 0) { auto acc = list.access(); for (uint64_t i = 0; i < kMaxNum; ++i) { acc.insert({i, 0}); @@ -367,7 +367,7 @@ class SkipListMapFindFixture : public benchmark::Fixture { }; BENCHMARK_DEFINE_F(SkipListMapFindFixture, Find)(benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -391,7 +391,7 @@ BENCHMARK_REGISTER_F(SkipListMapFindFixture, Find) class StdMapFindFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0 && container.size() == 0) { + if (state.thread_index() == 0 && container.size() == 0) { for (uint64_t i = 0; i < kMaxNum; ++i) { container.insert({i, 0}); } @@ -404,7 +404,7 @@ class StdMapFindFixture : public benchmark::Fixture { }; BENCHMARK_DEFINE_F(StdMapFindFixture, Find)(benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { @@ -421,7 +421,7 @@ BENCHMARK_REGISTER_F(StdMapFindFixture, Find)->ThreadRange(1, kThreadsNum)->Unit class StdMapWithPoolAllocatorFindFixture : public benchmark::Fixture { protected: void SetUp(const benchmark::State &state) override { - if (state.thread_index == 0 && container.size() == 0) { + if (state.thread_index() == 0 && container.size() == 0) { for (uint64_t i = 0; i < kMaxNum; ++i) { container.insert({i, 0}); } @@ -436,7 +436,7 @@ class StdMapWithPoolAllocatorFindFixture : public benchmark::Fixture { BENCHMARK_DEFINE_F(StdMapWithPoolAllocatorFindFixture, Find) (benchmark::State &state) { - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, kMaxNum); uint64_t counter = 0; while (state.KeepRunning()) { diff --git a/tests/benchmark/storage_v2_property_store.cpp b/tests/benchmark/storage_v2_property_store.cpp index e8f0b93e8..cced3b97b 100644 --- a/tests/benchmark/storage_v2_property_store.cpp +++ b/tests/benchmark/storage_v2_property_store.cpp @@ -25,7 +25,7 @@ // NOLINTNEXTLINE(google-runtime-references) static void PropertyStoreSet(benchmark::State &state) { storage::PropertyStore store; - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, state.range(0) - 1); uint64_t counter = 0; while (state.KeepRunning()) { @@ -45,7 +45,7 @@ BENCHMARK(PropertyStoreSet)->RangeMultiplier(2)->Range(1, 1024)->Unit(benchmark: // NOLINTNEXTLINE(google-runtime-references) static void StdMapSet(benchmark::State &state) { std::map store; - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, state.range(0) - 1); uint64_t counter = 0; while (state.KeepRunning()) { @@ -69,7 +69,7 @@ static void PropertyStoreGet(benchmark::State &state) { auto prop = storage::PropertyId::FromUint(i); store.SetProperty(prop, storage::PropertyValue(0)); } - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, state.range(0) - 1); uint64_t counter = 0; while (state.KeepRunning()) { @@ -93,7 +93,7 @@ static void StdMapGet(benchmark::State &state) { auto prop = storage::PropertyId::FromUint(i); store.emplace(prop, storage::PropertyValue(0)); } - std::mt19937 gen(state.thread_index); + std::mt19937 gen(state.thread_index()); std::uniform_int_distribution dist(0, state.range(0) - 1); uint64_t counter = 0; while (state.KeepRunning()) {