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

Commit 6efe355

Browse files
committed
Merge branch 'master' into cleanup
Conflicts: src/network/peloton_server.cpp
2 parents 7529173 + 8a461bf commit 6efe355

File tree

89 files changed

+6477
-1653
lines changed

Some content is hidden

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

89 files changed

+6477
-1653
lines changed

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: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pipeline {
2222
sh 'cd build && make benchmark -j4'
2323
sh 'cd build && make install'
2424
sh 'cd build && bash ../script/testing/psql/psql_test.sh'
25+
sh 'sudo apt-get -qq update && sudo apt-get -qq -y --no-install-recommends install wget default-jdk default-jre' // prerequisites for jdbc_validator
2526
sh 'cd build && python ../script/validators/jdbc_validator.py'
2627
}
2728
}
@@ -48,6 +49,7 @@ pipeline {
4849
// sh 'cd build && make benchmark -j4'
4950
// sh 'cd build && make install'
5051
// sh 'cd build && bash ../script/testing/psql/psql_test.sh'
52+
// sh 'sudo apt-get -qq update && sudo apt-get -qq -y --no-install-recommends install wget default-jdk default-jre' // prerequisites for jdbc_validator
5153
// sh 'cd build && python ../script/validators/jdbc_validator.py'
5254
}
5355
}
@@ -64,6 +66,7 @@ pipeline {
6466
sh 'cd build && make benchmark -j4'
6567
sh 'cd build && make install'
6668
sh 'cd build && bash ../script/testing/psql/psql_test.sh'
69+
sh 'sudo apt-get -qq update && sudo apt-get -qq -y --no-install-recommends install wget default-jdk default-jre' // prerequisites for jdbc_validator
6770
sh 'cd build && python ../script/validators/jdbc_validator.py'
6871
}
6972
}
@@ -79,6 +82,7 @@ pipeline {
7982
// sh 'cd build && make benchmark -j4'
8083
// sh 'cd build && make install'
8184
// sh 'cd build && bash ../script/testing/psql/psql_test.sh'
85+
// sh 'sudo apt-get -qq update && sudo apt-get -qq -y --no-install-recommends install wget default-jdk default-jre' // prerequisites for jdbc_validator
8286
// sh 'cd build && python ../script/validators/jdbc_validator.py'
8387
// }
8488
// }
@@ -119,7 +123,7 @@ pipeline {
119123
// sh 'sudo /bin/bash -c "source ./script/installation/packages.sh"'
120124
// sh 'python ./script/validators/source_validator.py'
121125
// sh 'mkdir build'
122-
// sh 'cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4'
126+
// sh 'cd build && PATH=/usr/lib64/llvm4.0/bin:$PATH cmake -DCMAKE_CXX_FLAGS="-isystem /usr/include/llvm4.0" -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4'
123127
// }
124128
// }
125129

@@ -129,7 +133,7 @@ pipeline {
129133
// sh 'sudo /bin/bash -c "source ./script/installation/packages.sh"'
130134
// sh 'python ./script/validators/source_validator.py'
131135
// sh 'mkdir build'
132-
// sh 'cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4'
136+
// sh 'cd 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'
133137
// }
134138
// }
135139

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/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

script/docker/fedora27/Dockerfile-jenkins

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ RUN dnf -q -y install sudo 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 && PATH=/usr/lib64/llvm4.0/bin:$PATH cmake -DCMAKE_CXX_FLAGS="-isystem /usr/include/llvm4.0" -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 && 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
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 && PATH=/usr/lib64/llvm4.0/bin:$PATH CC=clang CXX=clang++ cmake -DCMAKE_CXX_FLAGS="-isystem /usr/include/llvm4.0" -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 && PATH=/usr/lib64/llvm4.0/bin:$PATH CC=clang CXX=clang++ cmake -DCMAKE_CXX_FLAGS="-isystem /usr/include/llvm4.0" -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install

script/git-hooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if [ -n "$FILES" ]; then
1919
echo "******* Peloton Pre-Commit Hook *******"
2020
echo "***************************************"
2121
echo "Use \"$FORMATTER_PATH -c -f\" to format all staged files."
22-
echo "Or use \"$FORMATTER_PATH --no-verify\" to temporarily bypass the pre-commit hook."
22+
echo "Or use \"git commit --no-verify\" to temporarily bypass the pre-commit hook."
2323
echo
2424
echo "Be aware that changed files have to be staged again!"
2525
echo "***************************************"

0 commit comments

Comments
 (0)