Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 546c51a

Browse files
authored
Merge branch 'master' into cuckoohash
2 parents 0330e01 + f371356 commit 546c51a

File tree

162 files changed

+9135
-2702
lines changed

Some content is hidden

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

162 files changed

+9135
-2702
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: c++
2+
python: 3.6
23
matrix:
34
fast_finish: true
45

@@ -141,7 +142,7 @@ install:
141142

142143
before_script:
143144
# first, run source_validator
144-
- python ./script/validators/source_validator.py
145+
- python script/validators/source_validator.py
145146

146147
# build peloton (override this value to execute tests)
147148
script:

CMakeLists.txt

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ else()
5050
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++1Y support. Please use a different C++ compiler.")
5151
endif()
5252

53-
# Create a new pre-processor macro __PELOTONFILE__ that has a truncated
53+
# Create a new pre-processor macro __PELOTONFILE__ that has a truncated
5454
# path to reduce the size of the debug log messages.
5555
# Source: http://stackoverflow.com/a/16658858
5656
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__PELOTONFILE__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
@@ -62,7 +62,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
6262
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
6363
endif()
6464

65-
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
65+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
6666
(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9))
6767
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=auto")
6868
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=auto")
@@ -79,10 +79,38 @@ if(UNIX OR APPLE)
7979
endif()
8080
endif()
8181

82+
# There is a problem with building on g++5.4 on Ubuntu 17.10 where
83+
# the compiler will not support a bunch of stuff in std for some reason.
84+
# For example, it would say that 'to_string' is not part of 'std'.
85+
# These flags fix these problems. I don't know whether g++5.5 has the same
86+
# problem, so I am only making this fix target all variants of 5.4.
87+
#
88+
# More Info: https://stackoverflow.com/a/38034394
89+
# https://github.com/opencv/opencv/issues/10032#issuecomment-342347482
90+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
91+
(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.4 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.4) AND
92+
(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.5))
93+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GLIBCXX_USE_C99=1 -D_GLIBCXX_USE_C99_MATH=1")
94+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_C99=1 -D_GLIBCXX_USE_C99_MATH=1")
95+
endif()
96+
8297
# ---[ Warnings
8398
peloton_warnings_disable(CMAKE_CXX_FLAGS -Wno-strict-aliasing -Wno-implicit-fallthrough)
8499

85-
# Turn on sanitizers if necessary.
100+
# ---[ Check if we should use the GNU Gold linker
101+
set(USE_GOLD true CACHE BOOL "Use the GNU Gold linker if available")
102+
if (USE_GOLD)
103+
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
104+
if ("${LD_VERSION}" MATCHES "GNU gold")
105+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
106+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
107+
else ()
108+
message(WARNING "GNU gold linker isn't available, using the default system linker.")
109+
set(USE_LD_GOLD OFF)
110+
endif ()
111+
endif()
112+
113+
# ---[ Turn on sanitizers if necessary.
86114
if(USE_SANITIZER)
87115
if (USE_SANITIZER STREQUAL "Address")
88116
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
@@ -102,9 +130,6 @@ if(USE_SANITIZER)
102130
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-address-use-after-scope")
103131
endif()
104132
endif()
105-
if (CMAKE_COMPILER_IS_GNUCC)
106-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
107-
endif()
108133
endif()
109134

110135
# -- [ Coverage

Jenkinsfile

Lines changed: 110 additions & 62 deletions
Large diffs are not rendered by default.

cmake/External/capnproto.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ if (NOT __CAPNP_INCLUDED) # guard against multiple includes
2020
set(CAPNP_EXTRA_COMPILER_FLAGS "-fPIC")
2121
endif()
2222

23-
set(CAPNP_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${CAPNP_EXTRA_COMPILER_FLAGS})
24-
set(CAPNP_C_FLAGS ${CMAKE_C_FLAGS} ${CAPNP_EXTRA_COMPILER_FLAGS})
23+
set(CAPNP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CAPNP_EXTRA_COMPILER_FLAGS}")
24+
set(CAPNP_C_FLAGS "${CMAKE_C_FLAGS} ${CAPNP_EXTRA_COMPILER_FLAGS}")
2525

2626
ExternalProject_Add(capnp
2727
PREFIX ${capnp_PREFIX}

cmake/External/gflags.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ if (NOT __GFLAGS_INCLUDED) # guard against multiple includes
2020
set(GFLAGS_EXTRA_COMPILER_FLAGS "-fPIC")
2121
endif()
2222

23-
set(GFLAGS_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${GFLAGS_EXTRA_COMPILER_FLAGS})
24-
set(GFLAGS_C_FLAGS ${CMAKE_C_FLAGS} ${GFLAGS_EXTRA_COMPILER_FLAGS})
23+
set(GFLAGS_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GFLAGS_EXTRA_COMPILER_FLAGS}")
24+
set(GFLAGS_C_FLAGS "${CMAKE_C_FLAGS} ${GFLAGS_EXTRA_COMPILER_FLAGS}")
2525

2626
ExternalProject_Add(gflags
2727
PREFIX ${gflags_PREFIX}

cmake/External/glog.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ if (NOT __GLOG_INCLUDED)
2222
set(GLOG_EXTRA_COMPILER_FLAGS "-fPIC")
2323
endif()
2424

25-
set(GLOG_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${GLOG_EXTRA_COMPILER_FLAGS})
26-
set(GLOG_C_FLAGS ${CMAKE_C_FLAGS} ${GLOG_EXTRA_COMPILER_FLAGS})
25+
set(GLOG_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GLOG_EXTRA_COMPILER_FLAGS}")
26+
set(GLOG_C_FLAGS "${CMAKE_C_FLAGS} ${GLOG_EXTRA_COMPILER_FLAGS}")
2727

2828
# depend on gflags if we're also building it
2929
if (GFLAGS_EXTERNAL)

cmake/Targets.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ function(peloton_pickup_peloton_sources root)
8888
# jsoncpp
8989
file(GLOB_RECURSE jsoncpp_srcs ${root}/third_party/jsoncpp/*.cpp)
9090

91+
# ART
92+
file(GLOB_RECURSE art_srcs ${root}/third_party/adaptive_radix_tree/*.cpp)
93+
9194
# date
9295
file(GLOB_RECURSE jsoncpp_srcs ${root}/third_party/date/*.cpp)
9396
set(date_hdrs ${root}/third_party/date/)
@@ -99,7 +102,7 @@ function(peloton_pickup_peloton_sources root)
99102

100103
# add proto to make them editable in IDEs too
101104
file(GLOB_RECURSE proto_files ${root}/src/peloton/*.proto)
102-
list(APPEND srcs ${proto_files} ${murmur_srcs} ${libcount_srcs} ${libcds_srcs} ${jsoncpp_srcs})
105+
list(APPEND srcs ${proto_files} ${murmur_srcs} ${libcount_srcs} ${art_srcs} ${jsoncpp_srcs})
103106

104107
# propogate to parent scope
105108
set(srcs ${srcs} PARENT_SCOPE)

script/docker/centos7/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN yum -q -y install sudo wget
66

77
RUN /bin/bash -c "source ./peloton/script/installation/packages.sh"
88

9-
RUN mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install
9+
RUN mkdir /peloton/build && cd /peloton/build && cmake3 -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install
1010

1111
ENV PATH=$(BUILD_DIR)/bin:$PATH
1212
ENV LD_LIBRARY_PATH=$(BUILD_DIR)/lib:$LD_LIBRARY_PATH

script/docker/centos7/Dockerfile-jenkins

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ RUN yum -q -y install sudo wget clang
77
RUN /bin/bash -c "source ./peloton/script/installation/packages.sh"
88

99
RUN echo -n "Peloton Debug build with "; g++ --version | head -1
10-
RUN mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4 && make install
10+
RUN mkdir /peloton/build && cd /peloton/build && cmake3 -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4 && make install
1111

1212
RUN echo -n "Peloton Release build with "; g++ --version | head -1
13-
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install
13+
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && cmake3 -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install
1414

1515
RUN echo -n "Peloton Debug build with "; clang++ --version | head -1
16-
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4 && make install
16+
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang CXX=clang++ cmake3 -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4 && make install
1717

1818
RUN echo -n "Peloton Release build with "; clang++ --version | head -1
19-
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install
19+
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang CXX=clang++ cmake3 -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install

script/docker/fedora27/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN dnf -q -y install sudo
66

77
RUN /bin/bash -c "source ./peloton/script/installation/packages.sh"
88

9-
RUN mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install
9+
RUN mkdir /peloton/build && cd /peloton/build && PATH=/usr/lib64/llvm4.0/bin:$PATH cmake -DCMAKE_CXX_FLAGS="-isystem /usr/include/llvm4.0" -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install
1010

1111
ENV PATH=$(BUILD_DIR)/bin:$PATH
1212
ENV LD_LIBRARY_PATH=$(BUILD_DIR)/lib:$LD_LIBRARY_PATH

0 commit comments

Comments
 (0)