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

Commit 5437e1a

Browse files
committed
Fix merge conflicts
2 parents 54a0607 + ff418e3 commit 5437e1a

File tree

75 files changed

+5586
-1008
lines changed

Some content is hidden

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

75 files changed

+5586
-1008
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pipeline {
119119
// sh 'sudo /bin/bash -c "source ./script/installation/packages.sh"'
120120
// sh 'python ./script/validators/source_validator.py'
121121
// sh 'mkdir build'
122-
// sh 'cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4'
122+
// 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'
123123
// }
124124
// }
125125

@@ -129,7 +129,7 @@ pipeline {
129129
// sh 'sudo /bin/bash -c "source ./script/installation/packages.sh"'
130130
// sh 'python ./script/validators/source_validator.py'
131131
// sh 'mkdir build'
132-
// sh 'cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4'
132+
// 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'
133133
// }
134134
// }
135135

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

0 commit comments

Comments
 (0)