Skip to content

Commit

Permalink
Merge master (0.70.2) into develop (0.80.0-rc2)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbougalis committed Sep 23, 2017
2 parents cd2d52a + 7a0fa31 commit dd52bdd
Show file tree
Hide file tree
Showing 736 changed files with 73,301 additions and 29,923 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ Release/*.*
*.gcda
*.gcov

# Ignore locally installed node_modules
/node_modules

# Ignore tmp directory.
tmp

Expand All @@ -50,7 +47,6 @@ debug_log.txt
# Ignore customized configs
rippled.cfg
validators.txt
test/config.js

# Doxygen generated documentation output
HtmlDocumentation
Expand Down
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ env:
# namepart must match the folder name internal
# to boost's .tar.gz.
- LCOV_ROOT=$HOME/lcov
- GDB_ROOT=$HOME/gdb
- BOOST_ROOT=$HOME/boost_1_60_0
- BOOST_URL='http://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.gz'

# Travis is timing out on Trusty. So, for now, use Precise. July 2017
dist: precise

addons:
apt:
sources: ['ubuntu-toolchain-r-test']
Expand All @@ -27,6 +31,8 @@ addons:
- binutils-gold
# Provides a backtrace if the unittests crash
- gdb
# needed to build gdb
- texinfo

matrix:
include:
Expand All @@ -40,6 +46,9 @@ matrix:

- compiler: clang
env: GCC_VER=5 TARGET=debug CLANG_VER=3.8 PATH=$PWD/llvm-$LLVM_VERSION/bin:$PATH
cache:
directories:
- $GDB_ROOT

- compiler: clang
env: GCC_VER=5 TARGET=debug.nounity CLANG_VER=3.8 PATH=$PWD/llvm-$LLVM_VERSION/bin:$PATH
Expand All @@ -56,6 +65,7 @@ cache:
- $BOOST_ROOT
- llvm-$LLVM_VERSION
- cmake
- $GDB_ROOT

before_install:
- bin/ci/ubuntu/install-dependencies.sh
Expand All @@ -69,3 +79,5 @@ notifications:
irc:
channels:
- "chat.freenode.net#ripple-dev"

dist: precise
115 changes: 82 additions & 33 deletions Builds/CMake/CMakeFuncs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif()

macro(parse_target)

if (NOT target)
if (NOT target OR target STREQUAL "default")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
Expand Down Expand Up @@ -110,14 +110,27 @@ macro(parse_target)

endwhile()
endif()
# Promote these values to the CACHE, then unset the locals
# to prevent shadowing.
set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER} CACHE FILEPATH
"Path to a program" FORCE)
unset(CMAKE_C_COMPILER)
set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE FILEPATH
"Path to a program" FORCE)
unset(CMAKE_CXX_COMPILER)

if(CMAKE_C_COMPILER MATCHES "-NOTFOUND$" OR
CMAKE_CXX_COMPILER MATCHES "-NOTFOUND$")
message(FATAL_ERROR "Can not find appropriate compiler for target ${target}")
endif()

# If defined, promote the compiler path values to the CACHE, then
# unset the locals to prevent shadowing. Some scenarios do not
# need or want to find a compiler, such as -GNinja under Windows.
# Setting these values in those case may prevent CMake from finding
# a valid compiler.
if (CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER} CACHE FILEPATH
"Path to a program" FORCE)
unset(CMAKE_C_COMPILER)
endif (CMAKE_C_COMPILER)
if (CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE FILEPATH
"Path to a program" FORCE)
unset(CMAKE_CXX_COMPILER)
endif (CMAKE_CXX_COMPILER)

if (release)
set(CMAKE_BUILD_TYPE Release)
Expand Down Expand Up @@ -156,11 +169,17 @@ macro(setup_build_cache)
set(assert false CACHE BOOL "Enables asserts, even in release builds")
set(static false CACHE BOOL
"On linux, link protobuf, openssl, libc++, and boost statically")
set(jemalloc false CACHE BOOL "Enables jemalloc for heap profiling")
set(perf false CACHE BOOL "Enables flags that assist with perf recording")

if (static AND (WIN32 OR APPLE))
message(FATAL_ERROR "Static linking is only supported on linux.")
endif()

if (perf AND (WIN32 OR APPLE))
message(FATAL_ERROR "perf flags are only supported on linux.")
endif()

if (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
Expand Down Expand Up @@ -302,6 +321,7 @@ macro(use_boost)
if ((NOT DEFINED BOOST_ROOT) AND (DEFINED ENV{BOOST_ROOT}))
set(BOOST_ROOT $ENV{BOOST_ROOT})
endif()
file(TO_CMAKE_PATH "${BOOST_ROOT}" BOOST_ROOT)
if(WIN32 OR CYGWIN)
# Workaround for MSVC having two boost versions - x86 and x64 on same PC in stage folders
if(DEFINED BOOST_ROOT)
Expand Down Expand Up @@ -368,13 +388,19 @@ macro(use_openssl openssl_min)
endif()

find_package(OpenSSL)
# depending on how openssl is built, it might depend
# on zlib. In fact, the openssl find package should
# figure this out for us, but it does not currently...
# so let's add zlib ourselves to the lib list
find_package(ZLIB)

if (static)
set(CMAKE_FIND_LIBRARY_SUFFIXES tmp)
endif()

if (OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
list(APPEND OPENSSL_LIBRARIES ${ZLIB_LIBRARIES})
else()
message(FATAL_ERROR "OpenSSL not found")
endif()
Expand Down Expand Up @@ -507,6 +533,10 @@ macro(setup_build_boilerplate)
endif()
endif()

if (perf)
add_compile_options(-fno-omit-frame-pointer)
endif()

############################################################

add_definitions(
Expand All @@ -525,8 +555,18 @@ macro(setup_build_boilerplate)
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -fuse-ld=gold -Wl,--version
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if ("${LD_VERSION}" MATCHES "GNU gold")
append_flags(CMAKE_EXE_LINKER_FLAGS -fuse-ld=gold)
# NOTE: THE gold linker inserts -rpath as DT_RUNPATH by default
# intead of DT_RPATH, so you might have slightly unexpected
# runtime ld behavior if you were expecting DT_RPATH.
# Specify --disable-new-dtags to gold if you do not want
# the default DT_RUNPATH behavior. This rpath treatment as well
# as static/dynamic selection means that gold does not currently
# have ideal default behavior when we are using jemalloc. Thus
# for simplicity we don't use it when jemalloc is requested.
# An alternative to disabling would be to figure out all the settings
# required to make gold play nicely with jemalloc.
if (("${LD_VERSION}" MATCHES "GNU gold") AND (NOT jemalloc))
append_flags(CMAKE_EXE_LINKER_FLAGS -fuse-ld=gold)
endif ()
unset(LD_VERSION)
endif()
Expand Down Expand Up @@ -555,6 +595,15 @@ macro(setup_build_boilerplate)
STRING(REGEX REPLACE "[-/]DNDEBUG" "" CMAKE_C_FLAGS_RELEASECLASSIC "${CMAKE_C_FLAGS_RELEASECLASSIC}")
endif()

if (jemalloc)
find_package(jemalloc REQUIRED)
add_definitions(-DPROFILE_JEMALLOC)
include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIRS})
link_libraries(${JEMALLOC_LIBRARIES})
get_filename_component(JEMALLOC_LIB_PATH ${JEMALLOC_LIBRARIES} DIRECTORY)
set(CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${JEMALLOC_LIB_PATH})
endif()

if (NOT WIN32)
add_definitions(-D_FILE_OFFSET_BITS=64)
append_flags(CMAKE_CXX_FLAGS -frtti -std=c++14 -Wno-invalid-offsetof
Expand Down Expand Up @@ -585,7 +634,7 @@ macro(setup_build_boilerplate)
if (APPLE)
add_definitions(-DBEAST_COMPILE_OBJECTIVE_CPP=1)
add_compile_options(
-Wno-deprecated -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-function)
-Wno-deprecated -Wno-deprecated-declarations -Wno-unused-function)
endif()

if (is_gcc)
Expand All @@ -594,27 +643,27 @@ macro(setup_build_boilerplate)
endif (is_gcc)
else(NOT WIN32)
add_compile_options(
/bigobj # Increase object file max size
/EHa # ExceptionHandling all
/fp:precise # Floating point behavior
/Gd # __cdecl calling convention
/Gm- # Minimal rebuild: disabled
/GR # Enable RTTI
/Gy- # Function level linking: disabled
/bigobj # Increase object file max size
/EHa # ExceptionHandling all
/fp:precise # Floating point behavior
/Gd # __cdecl calling convention
/Gm- # Minimal rebuild: disabled
/GR # Enable RTTI
/Gy- # Function level linking: disabled
/FS
/MP # Multiprocessor compilation
/openmp- # pragma omp: disabled
/Zc:forScope # Language extension: for scope
/Zi # Generate complete debug info
/errorReport:none # No error reporting to Internet
/nologo # Suppress login banner
/W3 # Warning level 3
/WX- # Disable warnings as errors
/wd"4018"
/wd"4244"
/wd"4267"
/wd"4800" # Disable C4800(int to bool performance)
/wd"4503" # Decorated name length exceeded, name was truncated
/MP # Multiprocessor compilation
/openmp- # pragma omp: disabled
/Zc:forScope # Language conformance: for scope
/Zi # Generate complete debug info
/errorReport:none # No error reporting to Internet
/nologo # Suppress login banner
/W3 # Warning level 3
/WX- # Disable warnings as errors
/wd4018 # Disable signed/unsigned comparison warnings
/wd4244 # Disable float to int possible loss of data warnings
/wd4267 # Disable size_t to T possible loss of data warnings
/wd4800 # Disable C4800(int to bool performance)
/wd4503 # Decorated name length exceeded, name was truncated
)
add_definitions(
-D_WIN32_WINNT=0x6000
Expand Down Expand Up @@ -699,7 +748,7 @@ macro(link_common_libraries cur_project)
find_library(app_kit AppKit)
find_library(foundation Foundation)
target_link_libraries(${cur_project}
crypto ssl ${app_kit} ${foundation})
${app_kit} ${foundation})
else()
target_link_libraries(${cur_project} rt)
endif()
Expand Down
47 changes: 47 additions & 0 deletions Builds/CMake/Findjemalloc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# - Try to find jemalloc
# Once done this will define
# JEMALLOC_FOUND - System has jemalloc
# JEMALLOC_INCLUDE_DIRS - The jemalloc include directories
# JEMALLOC_LIBRARIES - The libraries needed to use jemalloc

if(NOT USE_BUNDLED_JEMALLOC)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_JEMALLOC QUIET jemalloc)
endif()
else()
set(PC_JEMALLOC_INCLUDEDIR)
set(PC_JEMALLOC_INCLUDE_DIRS)
set(PC_JEMALLOC_LIBDIR)
set(PC_JEMALLOC_LIBRARY_DIRS)
set(LIMIT_SEARCH NO_DEFAULT_PATH)
endif()

set(JEMALLOC_DEFINITIONS ${PC_JEMALLOC_CFLAGS_OTHER})

find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h
PATHS ${PC_JEMALLOC_INCLUDEDIR} ${PC_JEMALLOC_INCLUDE_DIRS}
${LIMIT_SEARCH})

# If we're asked to use static linkage, add libjemalloc.a as a preferred library name.
if(JEMALLOC_USE_STATIC)
list(APPEND JEMALLOC_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()

list(APPEND JEMALLOC_NAMES jemalloc)

find_library(JEMALLOC_LIBRARY NAMES ${JEMALLOC_NAMES}
HINTS ${PC_JEMALLOC_LIBDIR} ${PC_JEMALLOC_LIBRARY_DIRS}
${LIMIT_SEARCH})

set(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
set(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(JeMalloc DEFAULT_MSG
JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)

mark_as_advanced(JEMALLOC_INCLUDE_DIR JEMALLOC_LIBRARY)
Loading

0 comments on commit dd52bdd

Please sign in to comment.