mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-05 03:35:51 +00:00
Compare commits
197 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
caa5c9e223 | ||
|
|
846538304f | ||
|
|
7b7e3b6750 | ||
|
|
a988b3224f | ||
|
|
89b3bf0796 | ||
|
|
6d8988b78a | ||
|
|
3acbd84f1d | ||
|
|
45403b877f | ||
|
|
f17d9bc421 | ||
|
|
ba2714fa22 | ||
|
|
2c4b3d515d | ||
|
|
59973a435e | ||
|
|
93232ec7df | ||
|
|
efa926676c | ||
|
|
dc24748c24 | ||
|
|
f8365f5009 | ||
|
|
c2138c4e88 | ||
|
|
bfad96dbb9 | ||
|
|
0ef6d9f9a0 | ||
|
|
c1a1cfe550 | ||
|
|
773dcd1d48 | ||
|
|
de99e79bf1 | ||
|
|
e83d367f49 | ||
|
|
aa76b382af | ||
|
|
595b7b194c | ||
|
|
5f908ba870 | ||
|
|
adc1b8a36b | ||
|
|
73c6e47e8a | ||
|
|
3a780f80f1 | ||
|
|
c78404e233 | ||
|
|
79a0cb096b | ||
|
|
6f9e8dc720 | ||
|
|
b39b0fef39 | ||
|
|
be139d9bde | ||
|
|
c6d82c722b | ||
|
|
0c20e2eb8b | ||
|
|
63eeb8d734 | ||
|
|
5214b3c1b0 | ||
|
|
5f7a61f040 | ||
|
|
c5a938de55 | ||
|
|
9372a587e4 | ||
|
|
948e724dff | ||
|
|
06faf2bd5b | ||
|
|
1dd81c04f3 | ||
|
|
56dbf70c3c | ||
|
|
f8a4ac6ad7 | ||
|
|
61bd06177f | ||
|
|
80e535a13c | ||
|
|
64b55c0f88 | ||
|
|
afcc4ff296 | ||
|
|
57fe197d3e | ||
|
|
9279a3fee7 | ||
|
|
b6363289bf | ||
|
|
8c1123edc6 | ||
|
|
834f545498 | ||
|
|
dd99bf479f | ||
|
|
2e26377e7c | ||
|
|
0329ee236f | ||
|
|
b347afcc5b | ||
|
|
fa57859477 | ||
|
|
88cb0e5928 | ||
|
|
e239eed6de | ||
|
|
504b3441dd | ||
|
|
872478d965 | ||
|
|
185f2baf76 | ||
|
|
36d6758945 | ||
|
|
d8c450d272 | ||
|
|
8ef5b9bab4 | ||
|
|
e6370a6482 | ||
|
|
b2170d016a | ||
|
|
5c124f11c2 | ||
|
|
2aed24a552 | ||
|
|
296469f5fe | ||
|
|
08371ba2c4 | ||
|
|
56bc2a2ade | ||
|
|
1084dc6dd3 | ||
|
|
8023caaa97 | ||
|
|
8b97466285 | ||
|
|
de1d102535 | ||
|
|
1e1e8c2547 | ||
|
|
aa49be65a1 | ||
|
|
cd820b3777 | ||
|
|
8d59ed5b2a | ||
|
|
e03efdbe0b | ||
|
|
4f52c2989c | ||
|
|
3fb13233a9 | ||
|
|
9695fd44ba | ||
|
|
1bb32134f8 | ||
|
|
0ebed96142 | ||
|
|
4c06b3f86f | ||
|
|
a3470c225b | ||
|
|
c5d215d901 | ||
|
|
9dbf8495ee | ||
|
|
2529edd2b6 | ||
|
|
e974c7d8a4 | ||
|
|
b335adb674 | ||
|
|
c6ab880c03 | ||
|
|
7779dcdda0 | ||
|
|
132f1b218c | ||
|
|
e5d6f16f19 | ||
|
|
8f973621fc | ||
|
|
b75c2d71a5 | ||
|
|
eed210bb67 | ||
|
|
eab2a0d668 | ||
|
|
148bbf4e8f | ||
|
|
494724578a | ||
|
|
ea76103d5f | ||
|
|
2151110976 | ||
|
|
dfb45baa93 | ||
| f443439f1f | |||
|
|
6d0b108ec1 | ||
|
|
710f9ee1ac | ||
|
|
76d5ecb595 | ||
|
|
ba9ca1378e | ||
|
|
1be8094ee2 | ||
|
|
96c949a997 | ||
|
|
9121e26708 | ||
|
|
2432f13903 | ||
|
|
259fb1c32e | ||
|
|
e0515b0015 | ||
|
|
412a3ec710 | ||
|
|
30bba29da2 | ||
|
|
4f3a76dec0 | ||
|
|
61f443e3bb | ||
|
|
bd2a38f584 | ||
|
|
4cff94f7a4 | ||
|
|
fbdbffed67 | ||
|
|
ad5c5f1969 | ||
|
|
c354809e1c | ||
|
|
dc4d76f626 | ||
|
|
c1a02440dc | ||
|
|
e7a69cce65 | ||
|
|
60dc949314 | ||
|
|
cc824685e7 | ||
|
|
be70d81bd7 | ||
|
|
6df96f08df | ||
|
|
9ad2b9be45 | ||
|
|
0d2b2923da | ||
|
|
265f5f1fb1 | ||
|
|
a2ab6c4b02 | ||
|
|
6bdc9e7b30 | ||
|
|
c71eb45240 | ||
|
|
753600a2a0 | ||
|
|
945493d9cf | ||
|
|
2a8b0e4b88 | ||
|
|
513b1dd194 | ||
|
|
77462b8f72 | ||
|
|
1682fe3a39 | ||
|
|
58f786cbb4 | ||
|
|
a96cb8fc1c | ||
|
|
c587012e5c | ||
|
|
ad4bbd8dff | ||
|
|
202d91c9f0 | ||
|
|
146ea5d44e | ||
|
|
157c066f2b | ||
|
|
156e8dae83 | ||
|
|
5e96da51f9 | ||
|
|
cb71d493a0 | ||
|
|
8124c1f51f | ||
|
|
6ed2270bc9 | ||
|
|
4e7c038520 | ||
|
|
7b48dc36f5 | ||
|
|
d5c0e1216d | ||
|
|
a999894dae | ||
|
|
63e167b7a3 | ||
|
|
8fc6a8175b | ||
|
|
af1697cc6a | ||
|
|
e98c76110a | ||
|
|
7fe1d4b9c2 | ||
|
|
b36e11bc49 | ||
|
|
63c3fc30d8 | ||
|
|
1ac9694dbc | ||
|
|
3661dc88fe | ||
|
|
86c066cd7e | ||
|
|
d70464032c | ||
|
|
0bbe6e226c | ||
|
|
49e61cc0a6 | ||
|
|
6572fc8e95 | ||
|
|
3ce4dda5cb | ||
|
|
7295cf979b | ||
|
|
e14f913244 | ||
|
|
cd1c5a30dd | ||
|
|
8dd8433bb6 | ||
|
|
eeb9d92fb0 | ||
|
|
4104778067 | ||
|
|
4dcb3c9199 | ||
|
|
b0092aee24 | ||
|
|
bb52b04c25 | ||
|
|
83dac8b382 | ||
|
|
8a4951947d | ||
|
|
ab6163e989 | ||
|
|
5741a8356f | ||
|
|
b2f2d89a08 | ||
|
|
c946043280 | ||
|
|
820546c873 | ||
|
|
b36e9dd1b4 | ||
|
|
582d1691a9 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -92,3 +92,5 @@ Builds/VisualStudio2015/*.sdf
|
||||
# MSVC
|
||||
*.pdb
|
||||
.vs/
|
||||
CMakeSettings.json
|
||||
compile_commands.json
|
||||
|
||||
169
.gitlab-ci.yml
Normal file
169
.gitlab-ci.yml
Normal file
@@ -0,0 +1,169 @@
|
||||
# I don't know what the minimum size is, but we cannot build on t3.micro.
|
||||
|
||||
# TODO: Factor common builds between different tests.
|
||||
|
||||
# The parameters for our job matrix:
|
||||
#
|
||||
# 1. Generator (Make, Ninja, MSBuild)
|
||||
# 2. Compiler (GCC, Clang, MSVC)
|
||||
# 3. Build type (Debug, Release)
|
||||
# 4. Definitions (-Dunity=OFF, -Dassert=ON, ...)
|
||||
|
||||
|
||||
.job_linux_build_test:
|
||||
only:
|
||||
variables:
|
||||
- $CI_PROJECT_URL =~ /^https?:\/\/gitlab.com\//
|
||||
stage: build
|
||||
tags:
|
||||
- linux
|
||||
- c5.2xlarge
|
||||
image: thejohnfreeman/rippled-build-ubuntu:1bc7230e5b97
|
||||
script:
|
||||
- bin/ci/build.sh
|
||||
- bin/ci/test.sh
|
||||
cache:
|
||||
# Use a different key for each unique combination of (generator, compiler,
|
||||
# build type). Caches are stored as `.zip` files; they are not merged.
|
||||
# Generate a new key whenever you want to bust the cache, e.g. when the
|
||||
# dependency versions have been bumped.
|
||||
# By default, jobs pull the cache. Only a few specially chosen jobs update
|
||||
# the cache (with policy `pull-push`); one for each unique combination of
|
||||
# (generator, compiler, build type).
|
||||
policy: pull
|
||||
paths:
|
||||
- .nih_c/
|
||||
|
||||
'build+test Make GCC Debug':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Unix Makefiles
|
||||
COMPILER: gcc
|
||||
BUILD_TYPE: Debug
|
||||
cache:
|
||||
key: ae412fb0-5fc8-4fd5-8e48-e3a60e91ed46
|
||||
policy: pull-push
|
||||
|
||||
'build+test Ninja GCC Debug':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: gcc
|
||||
BUILD_TYPE: Debug
|
||||
cache:
|
||||
key: 3a314872-4faa-4712-b8ab-a8d54ac83342
|
||||
policy: pull-push
|
||||
|
||||
'build+test Ninja GCC Debug -Dstatic=OFF':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: gcc
|
||||
BUILD_TYPE: Debug
|
||||
CMAKE_ARGS: '-Dstatic=OFF'
|
||||
cache:
|
||||
key: 3a314872-4faa-4712-b8ab-a8d54ac83342
|
||||
|
||||
'build+test Ninja GCC Debug -Dstatic=OFF -DBUILD_SHARED_LIBS=ON':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: gcc
|
||||
BUILD_TYPE: Debug
|
||||
CMAKE_ARGS: '-Dstatic=OFF -DBUILD_SHARED_LIBS=ON'
|
||||
cache:
|
||||
key: 3a314872-4faa-4712-b8ab-a8d54ac83342
|
||||
|
||||
'build+test Ninja GCC Debug -Dunity=OFF':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: gcc
|
||||
BUILD_TYPE: Debug
|
||||
CMAKE_ARGS: '-Dunity=OFF'
|
||||
cache:
|
||||
key: 3a314872-4faa-4712-b8ab-a8d54ac83342
|
||||
|
||||
'build+test Ninja GCC Release -Dassert=ON':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: gcc
|
||||
BUILD_TYPE: Release
|
||||
CMAKE_ARGS: '-Dassert=ON'
|
||||
cache:
|
||||
key: ac5e7a8a-bfcb-4480-a3cc-07d0336f4408
|
||||
policy: pull-push
|
||||
|
||||
'build+test(manual) Ninja GCC Release -Dassert=ON':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: gcc
|
||||
BUILD_TYPE: Release
|
||||
CMAKE_ARGS: '-Dassert=ON'
|
||||
MANUAL_TEST: 'true'
|
||||
cache:
|
||||
key: ac5e7a8a-bfcb-4480-a3cc-07d0336f4408
|
||||
|
||||
'build+test Make clang Debug':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Unix Makefiles
|
||||
COMPILER: clang
|
||||
BUILD_TYPE: Debug
|
||||
cache:
|
||||
key: 09cec2ce-83f5-4ce9-8a3b-23737edefd4f
|
||||
policy: pull-push
|
||||
|
||||
'build+test Ninja clang Debug':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: clang
|
||||
BUILD_TYPE: Debug
|
||||
cache:
|
||||
key: c6e29541-e539-4d57-86c5-57d923521f35
|
||||
policy: pull-push
|
||||
|
||||
'build+test Ninja clang Debug -Dunity=OFF':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: clang
|
||||
BUILD_TYPE: Debug
|
||||
CMAKE_ARGS: '-Dunity=OFF'
|
||||
cache:
|
||||
key: c6e29541-e539-4d57-86c5-57d923521f35
|
||||
|
||||
'build+test Ninja clang Debug -Dunity=OFF -Dsan=address':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: clang
|
||||
BUILD_TYPE: Debug
|
||||
CMAKE_ARGS: '-Dunity=OFF -Dsan=address'
|
||||
CONCURRENT_TESTS: 1
|
||||
cache:
|
||||
key: c6e29541-e539-4d57-86c5-57d923521f35
|
||||
|
||||
'build+test Ninja clang Debug -Dunity=OFF -Dsan=undefined':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: clang
|
||||
BUILD_TYPE: Debug
|
||||
CMAKE_ARGS: '-Dunity=OFF -Dsan=undefined'
|
||||
cache:
|
||||
key: c6e29541-e539-4d57-86c5-57d923521f35
|
||||
|
||||
'build+test Ninja clang Release -Dassert=ON':
|
||||
extends: .job_linux_build_test
|
||||
variables:
|
||||
GENERATOR: Ninja
|
||||
COMPILER: clang
|
||||
BUILD_TYPE: Release
|
||||
CMAKE_ARGS: '-Dassert=ON'
|
||||
cache:
|
||||
key: 2e48f4d8-e0d7-4aa9-b646-499cef6c1a87
|
||||
policy: pull-push
|
||||
9
.gitmodules
vendored
9
.gitmodules
vendored
@@ -1,9 +0,0 @@
|
||||
[submodule "src/nudb/extras/beast"]
|
||||
path = src/nudb/extras/beast
|
||||
url = https://github.com/vinniefalco/Beast.git
|
||||
[submodule "src/nudb/extras/rocksdb"]
|
||||
path = src/nudb/extras/rocksdb
|
||||
url = https://github.com/facebook/rocksdb.git
|
||||
[submodule "src/nudb/doc/docca"]
|
||||
path = src/nudb/doc/docca
|
||||
url = https://github.com/vinniefalco/docca.git
|
||||
|
||||
42
.travis.yml
42
.travis.yml
@@ -1,5 +1,6 @@
|
||||
sudo: false
|
||||
language: cpp
|
||||
dist: xenial
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -10,17 +11,19 @@ env:
|
||||
# to boost's .tar.gz.
|
||||
- LCOV_ROOT=$HOME/lcov
|
||||
- GDB_ROOT=$HOME/gdb
|
||||
- BOOST_ROOT=$HOME/boost_1_67_0
|
||||
- BOOST_URL='http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.gz'
|
||||
- BOOST_ROOT=$HOME/boost_1_70_0
|
||||
- BOOST_URL='http://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.gz'
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-5.0
|
||||
- llvm-toolchain-xenial-7
|
||||
packages:
|
||||
- gcc-5
|
||||
- g++-5
|
||||
- gcc-7
|
||||
- g++-7
|
||||
- gcc-8
|
||||
- g++-8
|
||||
- python-software-properties
|
||||
- protobuf-compiler
|
||||
- libprotobuf-dev
|
||||
@@ -29,43 +32,26 @@ addons:
|
||||
- binutils-gold
|
||||
- cmake
|
||||
- lcov
|
||||
- llvm-5.0
|
||||
- clang-5.0
|
||||
- llvm-7
|
||||
- clang-7
|
||||
|
||||
matrix:
|
||||
include:
|
||||
|
||||
- compiler: gcc
|
||||
env: GCC_VER=5 TARGET=debug
|
||||
|
||||
# - compiler: gcc
|
||||
# env: GCC_VER=5 TARGET=debug.nounity
|
||||
|
||||
# - compiler: gcc
|
||||
# env: GCC_VER=5 TARGET=coverage PATH=$PWD/cmake/bin:$PATH
|
||||
|
||||
env: GCC_VER=7 BUILD_TYPE=Debug
|
||||
- compiler: clang
|
||||
env: GCC_VER=5 TARGET=debug
|
||||
|
||||
# - compiler: clang
|
||||
# env: GCC_VER=5 TARGET=debug.nounity
|
||||
|
||||
# The clang cmake builds do not link.
|
||||
# - compiler: clang
|
||||
# env: GCC_VER=5 TARGET=debug CLANG_VER=3.8 PATH=$PWD/llvm-$LLVM_VERSION/bin:$PWD/cmake/bin:$PATH
|
||||
|
||||
# - compiler: clang
|
||||
# env: GCC_VER=5 TARGET=debug.nounity CLANG_VER=3.8 PATH=$PWD/llvm-$LLVM_VERSION/bin:$PWD/cmake/bin:$PATH
|
||||
env: GCC_VER=7 BUILD_TYPE=Debug
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $BOOST_ROOT
|
||||
- .nih_c
|
||||
|
||||
before_install:
|
||||
- bin/ci/ubuntu/install-dependencies.sh
|
||||
|
||||
script:
|
||||
- travis_retry bin/ci/ubuntu/build-and-test.sh
|
||||
- travis_wait 35 bin/ci/ubuntu/build-and-test.sh
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
||||
@@ -108,10 +108,173 @@ macro(group_sources curdir)
|
||||
group_sources_in(${PROJECT_SOURCE_DIR} ${curdir})
|
||||
endmacro()
|
||||
|
||||
macro (exclude_from_default target_)
|
||||
set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||
set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON)
|
||||
endmacro ()
|
||||
|
||||
macro (exclude_if_included target_)
|
||||
if (NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
|
||||
set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||
set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON)
|
||||
get_directory_property(has_parent PARENT_DIRECTORY)
|
||||
if (has_parent)
|
||||
exclude_from_default (${target_})
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
function (print_ep_logs _target)
|
||||
ExternalProject_Get_Property (${_target} STAMP_DIR)
|
||||
add_custom_command(TARGET ${_target} POST_BUILD
|
||||
COMMENT "${_target} BUILD OUTPUT"
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DIN_FILE=${STAMP_DIR}/${_target}-build-out.log
|
||||
-P ${CMAKE_SOURCE_DIR}/Builds/CMake/echo_file.cmake
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DIN_FILE=${STAMP_DIR}/${_target}-build-err.log
|
||||
-P ${CMAKE_SOURCE_DIR}/Builds/CMake/echo_file.cmake)
|
||||
endfunction ()
|
||||
|
||||
#[=========================================================[
|
||||
This is a function override for one function in the
|
||||
standard ExternalProject module. We want to change
|
||||
the generated build script slightly to include printing
|
||||
the build logs in the case of failure. Those modifications
|
||||
have been made here. This function override could break
|
||||
in the future if the ExternalProject module changes internal
|
||||
function names or changes the way it generates the build
|
||||
scripts.
|
||||
See:
|
||||
https://gitlab.kitware.com/cmake/cmake/blob/df1ddeec128d68cc636f2dde6c2acd87af5658b6/Modules/ExternalProject.cmake#L1855-1952
|
||||
#]=========================================================]
|
||||
|
||||
function(_ep_write_log_script name step cmd_var)
|
||||
ExternalProject_Get_Property(${name} stamp_dir)
|
||||
set(command "${${cmd_var}}")
|
||||
|
||||
set(make "")
|
||||
set(code_cygpath_make "")
|
||||
if(command MATCHES "^\\$\\(MAKE\\)")
|
||||
# GNU make recognizes the string "$(MAKE)" as recursive make, so
|
||||
# ensure that it appears directly in the makefile.
|
||||
string(REGEX REPLACE "^\\$\\(MAKE\\)" "\${make}" command "${command}")
|
||||
set(make "-Dmake=$(MAKE)")
|
||||
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
set(code_cygpath_make "
|
||||
if(\${make} MATCHES \"^/\")
|
||||
execute_process(
|
||||
COMMAND cygpath -w \${make}
|
||||
OUTPUT_VARIABLE cygpath_make
|
||||
ERROR_VARIABLE cygpath_make
|
||||
RESULT_VARIABLE cygpath_error
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(NOT cygpath_error)
|
||||
set(make \${cygpath_make})
|
||||
endif()
|
||||
endif()
|
||||
")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(config "")
|
||||
if("${CMAKE_CFG_INTDIR}" MATCHES "^\\$")
|
||||
string(REPLACE "${CMAKE_CFG_INTDIR}" "\${config}" command "${command}")
|
||||
set(config "-Dconfig=${CMAKE_CFG_INTDIR}")
|
||||
endif()
|
||||
|
||||
# Wrap multiple 'COMMAND' lines up into a second-level wrapper
|
||||
# script so all output can be sent to one log file.
|
||||
if(command MATCHES "(^|;)COMMAND;")
|
||||
set(code_execute_process "
|
||||
${code_cygpath_make}
|
||||
execute_process(COMMAND \${command} RESULT_VARIABLE result)
|
||||
if(result)
|
||||
set(msg \"Command failed (\${result}):\\n\")
|
||||
foreach(arg IN LISTS command)
|
||||
set(msg \"\${msg} '\${arg}'\")
|
||||
endforeach()
|
||||
message(FATAL_ERROR \"\${msg}\")
|
||||
endif()
|
||||
")
|
||||
set(code "")
|
||||
set(cmd "")
|
||||
set(sep "")
|
||||
foreach(arg IN LISTS command)
|
||||
if("x${arg}" STREQUAL "xCOMMAND")
|
||||
if(NOT "x${cmd}" STREQUAL "x")
|
||||
string(APPEND code "set(command \"${cmd}\")${code_execute_process}")
|
||||
endif()
|
||||
set(cmd "")
|
||||
set(sep "")
|
||||
else()
|
||||
string(APPEND cmd "${sep}${arg}")
|
||||
set(sep ";")
|
||||
endif()
|
||||
endforeach()
|
||||
string(APPEND code "set(command \"${cmd}\")${code_execute_process}")
|
||||
file(GENERATE OUTPUT "${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake" CONTENT "${code}")
|
||||
set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake)
|
||||
endif()
|
||||
|
||||
# Wrap the command in a script to log output to files.
|
||||
set(script ${stamp_dir}/${name}-${step}-$<CONFIG>.cmake)
|
||||
set(logbase ${stamp_dir}/${name}-${step})
|
||||
set(code "
|
||||
${code_cygpath_make}
|
||||
function (_echo_file _fil)
|
||||
file (READ \${_fil} _cont)
|
||||
execute_process (COMMAND \${CMAKE_COMMAND} -E echo \"\${_cont}\")
|
||||
endfunction ()
|
||||
set(command \"${command}\")
|
||||
execute_process(
|
||||
COMMAND \${command}
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_FILE \"${logbase}-out.log\"
|
||||
ERROR_FILE \"${logbase}-err.log\"
|
||||
)
|
||||
if(result)
|
||||
set(msg \"Command failed: \${result}\\n\")
|
||||
foreach(arg IN LISTS command)
|
||||
set(msg \"\${msg} '\${arg}'\")
|
||||
endforeach()
|
||||
execute_process (COMMAND \${CMAKE_COMMAND} -E echo \"Build output for ${logbase} : \")
|
||||
_echo_file (\"${logbase}-out.log\")
|
||||
_echo_file (\"${logbase}-err.log\")
|
||||
set(msg \"\${msg}\\nSee above\\n\")
|
||||
message(FATAL_ERROR \"\${msg}\")
|
||||
else()
|
||||
set(msg \"${name} ${step} command succeeded. See also ${logbase}-*.log\")
|
||||
message(STATUS \"\${msg}\")
|
||||
endif()
|
||||
")
|
||||
file(GENERATE OUTPUT "${script}" CONTENT "${code}")
|
||||
set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script})
|
||||
set(${cmd_var} "${command}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
find_package(Git)
|
||||
|
||||
# function that calls git log to get current hash
|
||||
function (git_hash hash_val)
|
||||
# note: optional second extra string argument not in signature
|
||||
if (NOT GIT_FOUND)
|
||||
return ()
|
||||
endif ()
|
||||
set (_hash "unknown")
|
||||
set (_format "%H")
|
||||
if (ARGC GREATER_EQUAL 2)
|
||||
string (TOLOWER ${ARGV1} _short)
|
||||
if (_short STREQUAL "short")
|
||||
set (_format "%h")
|
||||
endif ()
|
||||
endif ()
|
||||
execute_process (COMMAND ${GIT_EXECUTABLE} "log" "--pretty=${_format}" "-n1"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
RESULT_VARIABLE _git_exit_code
|
||||
OUTPUT_VARIABLE _temp_hash
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
if (_git_exit_code EQUAL 0)
|
||||
set (_hash ${_temp_hash})
|
||||
endif ()
|
||||
set (${hash_val} "${_hash}" PARENT_SCOPE)
|
||||
endfunction ()
|
||||
|
||||
60
Builds/CMake/CMake_sqlite3.txt
Normal file
60
Builds/CMake/CMake_sqlite3.txt
Normal file
@@ -0,0 +1,60 @@
|
||||
|
||||
#[=========================================================[
|
||||
SQLITE doesn't provide build files in the
|
||||
standard source-only distribution. So we wrote
|
||||
a simple cmake file and we copy it to the
|
||||
external project folder so that we can use
|
||||
this file to build the lib with ExternalProject
|
||||
#]=========================================================]
|
||||
|
||||
add_library (sqlite3 STATIC sqlite3.c)
|
||||
#[=========================================================[
|
||||
When compiled with SQLITE_THREADSAFE=1, SQLite operates
|
||||
in serialized mode. In this mode, SQLite can be safely
|
||||
used by multiple threads with no restriction.
|
||||
|
||||
NOTE: This implies a global mutex!
|
||||
|
||||
When compiled with SQLITE_THREADSAFE=2, SQLite can be
|
||||
used in a multithreaded program so long as no two
|
||||
threads attempt to use the same database connection at
|
||||
the same time.
|
||||
|
||||
NOTE: This is the preferred threading model, but not
|
||||
currently enabled because we need to investigate our
|
||||
use-model and concurrency requirements.
|
||||
|
||||
TODO: consider whether any other options should be
|
||||
used: https://www.sqlite.org/compile.html
|
||||
#]=========================================================]
|
||||
|
||||
target_compile_definitions (sqlite3
|
||||
PRIVATE
|
||||
SQLITE_THREADSAFE=1
|
||||
HAVE_USLEEP=1)
|
||||
target_compile_options (sqlite3
|
||||
PRIVATE
|
||||
$<$<BOOL:${MSVC}>:
|
||||
-wd4100
|
||||
-wd4127
|
||||
-wd4232
|
||||
-wd4244
|
||||
-wd4701
|
||||
-wd4706
|
||||
-wd4996
|
||||
>
|
||||
$<$<NOT:$<BOOL:${MSVC}>>:-Wno-array-bounds>)
|
||||
install (
|
||||
TARGETS
|
||||
sqlite3
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES DESTINATION include)
|
||||
install (
|
||||
FILES
|
||||
sqlite3.h
|
||||
sqlite3ext.h
|
||||
DESTINATION include)
|
||||
|
||||
|
||||
@@ -1,237 +1,242 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindBoost
|
||||
# ---------
|
||||
#
|
||||
# Find Boost include dirs and libraries
|
||||
#
|
||||
# Use this module by invoking find_package with the form::
|
||||
#
|
||||
# find_package(Boost
|
||||
# [version] [EXACT] # Minimum or EXACT version e.g. 1.67.0
|
||||
# [REQUIRED] # Fail with error if Boost is not found
|
||||
# [COMPONENTS <libs>...] # Boost libraries by their canonical name
|
||||
# # e.g. "date_time" for "libboost_date_time"
|
||||
# [OPTIONAL_COMPONENTS <libs>...]
|
||||
# # Optional Boost libraries by their canonical name)
|
||||
# ) # e.g. "date_time" for "libboost_date_time"
|
||||
#
|
||||
# This module finds headers and requested component libraries OR a CMake
|
||||
# package configuration file provided by a "Boost CMake" build. For the
|
||||
# latter case skip to the "Boost CMake" section below. For the former
|
||||
# case results are reported in variables::
|
||||
#
|
||||
# Boost_FOUND - True if headers and requested libraries were found
|
||||
# Boost_INCLUDE_DIRS - Boost include directories
|
||||
# Boost_LIBRARY_DIRS - Link directories for Boost libraries
|
||||
# Boost_LIBRARIES - Boost component libraries to be linked
|
||||
# Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
|
||||
# Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
|
||||
# target_link_libraries debug/optimized keywords)
|
||||
# Boost_VERSION - BOOST_VERSION value from boost/version.hpp
|
||||
# Boost_LIB_VERSION - Version string appended to library filenames
|
||||
# Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
|
||||
# Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
|
||||
# Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
|
||||
# Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
|
||||
# - Pass to add_definitions() to have diagnostic
|
||||
# information about Boost's automatic linking
|
||||
# displayed during compilation
|
||||
#
|
||||
# Note that Boost Python components require a Python version suffix
|
||||
# (Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
|
||||
# versions built against Python 3.6 and 2.7, respectively. This also
|
||||
# applies to additional components using Python including
|
||||
# ``mpi_python`` and ``numpy``. Earlier Boost releases may use
|
||||
# distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
|
||||
# These may also be used as suffixes, but note that they are not
|
||||
# portable.
|
||||
#
|
||||
# This module reads hints about search locations from variables::
|
||||
#
|
||||
# BOOST_ROOT - Preferred installation prefix
|
||||
# (or BOOSTROOT)
|
||||
# BOOST_INCLUDEDIR - Preferred include directory e.g. <prefix>/include
|
||||
# BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
|
||||
# Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
|
||||
# specified by these hint variables. Default is OFF.
|
||||
# Boost_ADDITIONAL_VERSIONS
|
||||
# - List of Boost versions not known to this module
|
||||
# (Boost install locations may contain the version)
|
||||
#
|
||||
# and saves search results persistently in CMake cache entries::
|
||||
#
|
||||
# Boost_INCLUDE_DIR - Directory containing Boost headers
|
||||
# Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
|
||||
# Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries
|
||||
# Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
|
||||
# Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
|
||||
#
|
||||
# The following :prop_tgt:`IMPORTED` targets are also defined::
|
||||
#
|
||||
# Boost::boost - Target for header-only dependencies
|
||||
# (Boost include directory)
|
||||
# Boost::<C> - Target for specific component dependency
|
||||
# (shared or static library); <C> is lower-
|
||||
# case
|
||||
# Boost::diagnostic_definitions - interface target to enable diagnostic
|
||||
# information about Boost's automatic linking
|
||||
# during compilation (adds BOOST_LIB_DIAGNOSTIC)
|
||||
# Boost::disable_autolinking - interface target to disable automatic
|
||||
# linking with MSVC (adds BOOST_ALL_NO_LIB)
|
||||
# Boost::dynamic_linking - interface target to enable dynamic linking
|
||||
# linking with MSVC (adds BOOST_ALL_DYN_LINK)
|
||||
#
|
||||
# Implicit dependencies such as Boost::filesystem requiring
|
||||
# Boost::system will be automatically detected and satisfied, even
|
||||
# if system is not specified when using find_package and if
|
||||
# Boost::system is not added to target_link_libraries. If using
|
||||
# Boost::thread, then Threads::Threads will also be added automatically.
|
||||
#
|
||||
# It is important to note that the imported targets behave differently
|
||||
# than variables created by this module: multiple calls to
|
||||
# find_package(Boost) in the same directory or sub-directories with
|
||||
# different options (e.g. static or shared) will not override the
|
||||
# values of the targets created by the first call.
|
||||
#
|
||||
# Users may set these hints or results as cache entries. Projects
|
||||
# should not read these entries directly but instead use the above
|
||||
# result variables. Note that some hint names start in upper-case
|
||||
# "BOOST". One may specify these as environment variables if they are
|
||||
# not specified as CMake variables or cache entries.
|
||||
#
|
||||
# This module first searches for the Boost header files using the above
|
||||
# hint variables (excluding BOOST_LIBRARYDIR) and saves the result in
|
||||
# Boost_INCLUDE_DIR. Then it searches for requested component libraries
|
||||
# using the above hints (excluding BOOST_INCLUDEDIR and
|
||||
# Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR,
|
||||
# and the library name configuration settings below. It saves the
|
||||
# library directories in Boost_LIBRARY_DIR_DEBUG and
|
||||
# Boost_LIBRARY_DIR_RELEASE and individual library
|
||||
# locations in Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE.
|
||||
# When one changes settings used by previous searches in the same build
|
||||
# tree (excluding environment variables) this module discards previous
|
||||
# search results affected by the changes and searches again.
|
||||
#
|
||||
# Boost libraries come in many variants encoded in their file name.
|
||||
# Users or projects may tell this module which variant to find by
|
||||
# setting variables::
|
||||
#
|
||||
# Boost_USE_DEBUG_LIBS - Set to ON or OFF to specify whether to search
|
||||
# and use the debug libraries. Default is ON.
|
||||
# Boost_USE_RELEASE_LIBS - Set to ON or OFF to specify whether to search
|
||||
# and use the release libraries. Default is ON.
|
||||
# Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
|
||||
# libraries ('mt' tag). Default is ON.
|
||||
# Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
|
||||
# libraries. Default is OFF.
|
||||
# Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
|
||||
# libraries linked statically to the C++ runtime
|
||||
# ('s' tag). Default is platform dependent.
|
||||
# Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use
|
||||
# libraries linked to the MS debug C++ runtime
|
||||
# ('g' tag). Default is ON.
|
||||
# Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
|
||||
# debug Python build ('y' tag). Default is OFF.
|
||||
# Boost_USE_STLPORT - Set to ON to use libraries compiled with
|
||||
# STLPort ('p' tag). Default is OFF.
|
||||
# Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
|
||||
# - Set to ON to use libraries compiled with
|
||||
# STLPort deprecated "native iostreams"
|
||||
# ('n' tag). Default is OFF.
|
||||
# Boost_COMPILER - Set to the compiler-specific library suffix
|
||||
# (e.g. "-gcc43"). Default is auto-computed
|
||||
# for the C++ compiler in use. A list may be
|
||||
# used if multiple compatible suffixes should
|
||||
# be tested for, in decreasing order of
|
||||
# preference.
|
||||
# Boost_THREADAPI - Suffix for "thread" component library name,
|
||||
# such as "pthread" or "win32". Names with
|
||||
# and without this suffix will both be tried.
|
||||
# Boost_NAMESPACE - Alternate namespace used to build boost with
|
||||
# e.g. if set to "myboost", will search for
|
||||
# myboost_thread instead of boost_thread.
|
||||
#
|
||||
# Other variables one may set to control this module are::
|
||||
#
|
||||
# Boost_DEBUG - Set to ON to enable debug output from FindBoost.
|
||||
# Please enable this before filing any bug report.
|
||||
# Boost_DETAILED_FAILURE_MSG
|
||||
# - Set to ON to add detailed information to the
|
||||
# failure message even when the REQUIRED option
|
||||
# is not given to the find_package call.
|
||||
# Boost_REALPATH - Set to ON to resolve symlinks for discovered
|
||||
# libraries to assist with packaging. For example,
|
||||
# the "system" component library may be resolved to
|
||||
# "/usr/lib/libboost_system.so.1.67.0" instead of
|
||||
# "/usr/lib/libboost_system.so". This does not
|
||||
# affect linking and should not be enabled unless
|
||||
# the user needs this information.
|
||||
# Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and
|
||||
# Boost_LIBRARY_DIR_DEBUG.
|
||||
#
|
||||
# On Visual Studio and Borland compilers Boost headers request automatic
|
||||
# linking to corresponding libraries. This requires matching libraries
|
||||
# to be linked explicitly or available in the link library search path.
|
||||
# In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve
|
||||
# dynamic linking. Boost automatic linking typically requests static
|
||||
# libraries with a few exceptions (such as Boost.Python). Use::
|
||||
#
|
||||
# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
|
||||
#
|
||||
# to ask Boost to report information about automatic linking requests.
|
||||
#
|
||||
# Example to find Boost headers only::
|
||||
#
|
||||
# find_package(Boost 1.36.0)
|
||||
# if(Boost_FOUND)
|
||||
# include_directories(${Boost_INCLUDE_DIRS})
|
||||
# add_executable(foo foo.cc)
|
||||
# endif()
|
||||
#
|
||||
# Example to find Boost libraries and use imported targets::
|
||||
#
|
||||
# find_package(Boost 1.56 REQUIRED COMPONENTS
|
||||
# date_time filesystem iostreams)
|
||||
# add_executable(foo foo.cc)
|
||||
# target_link_libraries(foo Boost::date_time Boost::filesystem
|
||||
# Boost::iostreams)
|
||||
#
|
||||
# Example to find Boost Python 3.6 libraries and use imported targets::
|
||||
#
|
||||
# find_package(Boost 1.67 REQUIRED COMPONENTS
|
||||
# python36 numpy36)
|
||||
# add_executable(foo foo.cc)
|
||||
# target_link_libraries(foo Boost::python36 Boost::numpy36)
|
||||
#
|
||||
# Example to find Boost headers and some *static* (release only) libraries::
|
||||
#
|
||||
# set(Boost_USE_STATIC_LIBS ON) # only find static libs
|
||||
# set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
|
||||
# set(Boost_USE_RELEASE_LIBS ON) # only find release libs
|
||||
# set(Boost_USE_MULTITHREADED ON)
|
||||
# set(Boost_USE_STATIC_RUNTIME OFF)
|
||||
# find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
|
||||
# if(Boost_FOUND)
|
||||
# include_directories(${Boost_INCLUDE_DIRS})
|
||||
# add_executable(foo foo.cc)
|
||||
# target_link_libraries(foo ${Boost_LIBRARIES})
|
||||
# endif()
|
||||
#
|
||||
# Boost CMake
|
||||
# ^^^^^^^^^^^
|
||||
#
|
||||
# If Boost was built using the boost-cmake project it provides a package
|
||||
# configuration file for use with find_package's Config mode. This
|
||||
# module looks for the package configuration file called
|
||||
# BoostConfig.cmake or boost-config.cmake and stores the result in cache
|
||||
# entry "Boost_DIR". If found, the package configuration file is loaded
|
||||
# and this module returns with no further action. See documentation of
|
||||
# the Boost CMake package configuration for details on what it provides.
|
||||
#
|
||||
# Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.
|
||||
#[=======================================================================[.rst:
|
||||
FindBoost
|
||||
---------
|
||||
|
||||
Find Boost include dirs and libraries
|
||||
|
||||
Use this module by invoking find_package with the form::
|
||||
|
||||
find_package(Boost
|
||||
[version] [EXACT] # Minimum or EXACT version e.g. 1.67.0
|
||||
[REQUIRED] # Fail with error if Boost is not found
|
||||
[COMPONENTS <libs>...] # Boost libraries by their canonical name
|
||||
# e.g. "date_time" for "libboost_date_time"
|
||||
[OPTIONAL_COMPONENTS <libs>...]
|
||||
# Optional Boost libraries by their canonical name)
|
||||
) # e.g. "date_time" for "libboost_date_time"
|
||||
|
||||
This module finds headers and requested component libraries OR a CMake
|
||||
package configuration file provided by a "Boost CMake" build. For the
|
||||
latter case skip to the "Boost CMake" section below. For the former
|
||||
case results are reported in variables::
|
||||
|
||||
Boost_FOUND - True if headers and requested libraries were found
|
||||
Boost_INCLUDE_DIRS - Boost include directories
|
||||
Boost_LIBRARY_DIRS - Link directories for Boost libraries
|
||||
Boost_LIBRARIES - Boost component libraries to be linked
|
||||
Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
|
||||
Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
|
||||
target_link_libraries debug/optimized keywords)
|
||||
Boost_VERSION - BOOST_VERSION value from boost/version.hpp
|
||||
Boost_LIB_VERSION - Version string appended to library filenames
|
||||
Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
|
||||
Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
|
||||
Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
|
||||
Boost_VERSION_STRING - Boost version number in x.y.z format
|
||||
Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
|
||||
- Pass to add_definitions() to have diagnostic
|
||||
information about Boost's automatic linking
|
||||
displayed during compilation
|
||||
|
||||
Note that Boost Python components require a Python version suffix
|
||||
(Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
|
||||
versions built against Python 3.6 and 2.7, respectively. This also
|
||||
applies to additional components using Python including
|
||||
``mpi_python`` and ``numpy``. Earlier Boost releases may use
|
||||
distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
|
||||
These may also be used as suffixes, but note that they are not
|
||||
portable.
|
||||
|
||||
This module reads hints about search locations from variables::
|
||||
|
||||
BOOST_ROOT - Preferred installation prefix
|
||||
(or BOOSTROOT)
|
||||
BOOST_INCLUDEDIR - Preferred include directory e.g. <prefix>/include
|
||||
BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
|
||||
Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
|
||||
specified by these hint variables. Default is OFF.
|
||||
Boost_ADDITIONAL_VERSIONS
|
||||
- List of Boost versions not known to this module
|
||||
(Boost install locations may contain the version)
|
||||
|
||||
and saves search results persistently in CMake cache entries::
|
||||
|
||||
Boost_INCLUDE_DIR - Directory containing Boost headers
|
||||
Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
|
||||
Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries
|
||||
Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
|
||||
Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
|
||||
|
||||
The following :prop_tgt:`IMPORTED` targets are also defined::
|
||||
|
||||
Boost::boost - Target for header-only dependencies
|
||||
(Boost include directory)
|
||||
Boost::<C> - Target for specific component dependency
|
||||
(shared or static library); <C> is lower-
|
||||
case
|
||||
Boost::diagnostic_definitions - interface target to enable diagnostic
|
||||
information about Boost's automatic linking
|
||||
during compilation (adds BOOST_LIB_DIAGNOSTIC)
|
||||
Boost::disable_autolinking - interface target to disable automatic
|
||||
linking with MSVC (adds BOOST_ALL_NO_LIB)
|
||||
Boost::dynamic_linking - interface target to enable dynamic linking
|
||||
linking with MSVC (adds BOOST_ALL_DYN_LINK)
|
||||
|
||||
Implicit dependencies such as ``Boost::filesystem`` requiring
|
||||
``Boost::system`` will be automatically detected and satisfied, even
|
||||
if system is not specified when using :command:`find_package` and if
|
||||
``Boost::system`` is not added to :command:`target_link_libraries`. If using
|
||||
``Boost::thread``, then ``Threads::Threads`` will also be added automatically.
|
||||
|
||||
It is important to note that the imported targets behave differently
|
||||
than variables created by this module: multiple calls to
|
||||
:command:`find_package(Boost)` in the same directory or sub-directories with
|
||||
different options (e.g. static or shared) will not override the
|
||||
values of the targets created by the first call.
|
||||
|
||||
Users may set these hints or results as ``CACHE`` entries. Projects
|
||||
should not read these entries directly but instead use the above
|
||||
result variables. Note that some hint names start in upper-case
|
||||
"BOOST". One may specify these as environment variables if they are
|
||||
not specified as CMake variables or cache entries.
|
||||
|
||||
This module first searches for the ``Boost`` header files using the above
|
||||
hint variables (excluding ``BOOST_LIBRARYDIR``) and saves the result in
|
||||
``Boost_INCLUDE_DIR``. Then it searches for requested component libraries
|
||||
using the above hints (excluding ``BOOST_INCLUDEDIR`` and
|
||||
``Boost_ADDITIONAL_VERSIONS``), "lib" directories near ``Boost_INCLUDE_DIR``,
|
||||
and the library name configuration settings below. It saves the
|
||||
library directories in ``Boost_LIBRARY_DIR_DEBUG`` and
|
||||
``Boost_LIBRARY_DIR_RELEASE`` and individual library
|
||||
locations in ``Boost_<C>_LIBRARY_DEBUG`` and ``Boost_<C>_LIBRARY_RELEASE``.
|
||||
When one changes settings used by previous searches in the same build
|
||||
tree (excluding environment variables) this module discards previous
|
||||
search results affected by the changes and searches again.
|
||||
|
||||
Boost libraries come in many variants encoded in their file name.
|
||||
Users or projects may tell this module which variant to find by
|
||||
setting variables::
|
||||
|
||||
Boost_USE_DEBUG_LIBS - Set to ON or OFF to specify whether to search
|
||||
and use the debug libraries. Default is ON.
|
||||
Boost_USE_RELEASE_LIBS - Set to ON or OFF to specify whether to search
|
||||
and use the release libraries. Default is ON.
|
||||
Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
|
||||
libraries ('mt' tag). Default is ON.
|
||||
Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
|
||||
libraries. Default is OFF.
|
||||
Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
|
||||
libraries linked statically to the C++ runtime
|
||||
('s' tag). Default is platform dependent.
|
||||
Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use
|
||||
libraries linked to the MS debug C++ runtime
|
||||
('g' tag). Default is ON.
|
||||
Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
|
||||
debug Python build ('y' tag). Default is OFF.
|
||||
Boost_USE_STLPORT - Set to ON to use libraries compiled with
|
||||
STLPort ('p' tag). Default is OFF.
|
||||
Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
|
||||
- Set to ON to use libraries compiled with
|
||||
STLPort deprecated "native iostreams"
|
||||
('n' tag). Default is OFF.
|
||||
Boost_COMPILER - Set to the compiler-specific library suffix
|
||||
(e.g. "-gcc43"). Default is auto-computed
|
||||
for the C++ compiler in use. A list may be
|
||||
used if multiple compatible suffixes should
|
||||
be tested for, in decreasing order of
|
||||
preference.
|
||||
Boost_ARCHITECTURE - Set to the architecture-specific library suffix
|
||||
(e.g. "-x64"). Default is auto-computed for the
|
||||
C++ compiler in use.
|
||||
Boost_THREADAPI - Suffix for "thread" component library name,
|
||||
such as "pthread" or "win32". Names with
|
||||
and without this suffix will both be tried.
|
||||
Boost_NAMESPACE - Alternate namespace used to build boost with
|
||||
e.g. if set to "myboost", will search for
|
||||
myboost_thread instead of boost_thread.
|
||||
|
||||
Other variables one may set to control this module are::
|
||||
|
||||
Boost_DEBUG - Set to ON to enable debug output from FindBoost.
|
||||
Please enable this before filing any bug report.
|
||||
Boost_DETAILED_FAILURE_MSG
|
||||
- Set to ON to add detailed information to the
|
||||
failure message even when the REQUIRED option
|
||||
is not given to the find_package call.
|
||||
Boost_REALPATH - Set to ON to resolve symlinks for discovered
|
||||
libraries to assist with packaging. For example,
|
||||
the "system" component library may be resolved to
|
||||
"/usr/lib/libboost_system.so.1.67.0" instead of
|
||||
"/usr/lib/libboost_system.so". This does not
|
||||
affect linking and should not be enabled unless
|
||||
the user needs this information.
|
||||
Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and
|
||||
Boost_LIBRARY_DIR_DEBUG.
|
||||
|
||||
On Visual Studio and Borland compilers Boost headers request automatic
|
||||
linking to corresponding libraries. This requires matching libraries
|
||||
to be linked explicitly or available in the link library search path.
|
||||
In this case setting ``Boost_USE_STATIC_LIBS`` to ``OFF`` may not achieve
|
||||
dynamic linking. Boost automatic linking typically requests static
|
||||
libraries with a few exceptions (such as ``Boost.Python``). Use::
|
||||
|
||||
add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
|
||||
|
||||
to ask Boost to report information about automatic linking requests.
|
||||
|
||||
Example to find Boost headers only::
|
||||
|
||||
find_package(Boost 1.36.0)
|
||||
if(Boost_FOUND)
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
add_executable(foo foo.cc)
|
||||
endif()
|
||||
|
||||
Example to find Boost libraries and use imported targets::
|
||||
|
||||
find_package(Boost 1.56 REQUIRED COMPONENTS
|
||||
date_time filesystem iostreams)
|
||||
add_executable(foo foo.cc)
|
||||
target_link_libraries(foo Boost::date_time Boost::filesystem
|
||||
Boost::iostreams)
|
||||
|
||||
Example to find Boost Python 3.6 libraries and use imported targets::
|
||||
|
||||
find_package(Boost 1.67 REQUIRED COMPONENTS
|
||||
python36 numpy36)
|
||||
add_executable(foo foo.cc)
|
||||
target_link_libraries(foo Boost::python36 Boost::numpy36)
|
||||
|
||||
Example to find Boost headers and some *static* (release only) libraries::
|
||||
|
||||
set(Boost_USE_STATIC_LIBS ON) # only find static libs
|
||||
set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
|
||||
set(Boost_USE_RELEASE_LIBS ON) # only find release libs
|
||||
set(Boost_USE_MULTITHREADED ON)
|
||||
set(Boost_USE_STATIC_RUNTIME OFF)
|
||||
find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
|
||||
if(Boost_FOUND)
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
add_executable(foo foo.cc)
|
||||
target_link_libraries(foo ${Boost_LIBRARIES})
|
||||
endif()
|
||||
|
||||
Boost CMake
|
||||
^^^^^^^^^^^
|
||||
|
||||
If Boost was built using the boost-cmake project it provides a package
|
||||
configuration file for use with find_package's Config mode. This
|
||||
module looks for the package configuration file called
|
||||
``BoostConfig.cmake`` or ``boost-config.cmake`` and stores the result in
|
||||
``CACHE`` entry "Boost_DIR". If found, the package configuration file is loaded
|
||||
and this module returns with no further action. See documentation of
|
||||
the Boost CMake package configuration for details on what it provides.
|
||||
|
||||
Set ``Boost_NO_BOOST_CMAKE`` to ``ON``, to disable the search for boost-cmake.
|
||||
#]=======================================================================]
|
||||
|
||||
# Save project's policies
|
||||
cmake_policy(PUSH)
|
||||
@@ -406,15 +411,18 @@ endmacro()
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Runs compiler with "-dumpversion" and parses major/minor
|
||||
# version with a regex.
|
||||
#
|
||||
function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION)
|
||||
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1\\2"
|
||||
_boost_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
|
||||
# Convert CMAKE_CXX_COMPILER_VERSION to boost compiler suffix version.
|
||||
function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION _OUTPUT_VERSION_MAJOR _OUTPUT_VERSION_MINOR)
|
||||
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1"
|
||||
_boost_COMPILER_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}")
|
||||
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\2"
|
||||
_boost_COMPILER_VERSION_MINOR "${CMAKE_CXX_COMPILER_VERSION}")
|
||||
|
||||
set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}${_boost_COMPILER_VERSION_MINOR}")
|
||||
|
||||
set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
|
||||
set(${_OUTPUT_VERSION_MAJOR} ${_boost_COMPILER_VERSION_MAJOR} PARENT_SCOPE)
|
||||
set(${_OUTPUT_VERSION_MINOR} ${_boost_COMPILER_VERSION_MINOR} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#
|
||||
@@ -457,21 +465,20 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
|
||||
endif()
|
||||
elseif (GHSMULTI)
|
||||
set(_boost_COMPILER "-ghs")
|
||||
elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
|
||||
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
|
||||
set(_boost_COMPILER "-vc141;-vc140")
|
||||
elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
|
||||
set(_boost_COMPILER "-vc140")
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18)
|
||||
set(_boost_COMPILER "-vc120")
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17)
|
||||
set(_boost_COMPILER "-vc110")
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
|
||||
set(_boost_COMPILER "-vc100")
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15)
|
||||
set(_boost_COMPILER "-vc90")
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
|
||||
set(_boost_COMPILER "-vc80")
|
||||
elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC" OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
|
||||
if(MSVC_TOOLSET_VERSION GREATER_EQUAL 150)
|
||||
# Not yet known.
|
||||
set(_boost_COMPILER "")
|
||||
elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 140)
|
||||
# MSVC toolset 14.x versions are forward compatible.
|
||||
set(_boost_COMPILER "")
|
||||
foreach(v 9 8 7 6 5 4 3 2 1 0)
|
||||
if(MSVC_TOOLSET_VERSION GREATER_EQUAL 14${v})
|
||||
list(APPEND _boost_COMPILER "-vc14${v}")
|
||||
endif()
|
||||
endforeach()
|
||||
elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
|
||||
set(_boost_COMPILER "-vc${MSVC_TOOLSET_VERSION}")
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10)
|
||||
set(_boost_COMPILER "-vc71")
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) # Good luck!
|
||||
@@ -479,6 +486,12 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
|
||||
else() # VS 6.0 Good luck!
|
||||
set(_boost_COMPILER "-vc6") # yes, this is correct
|
||||
endif()
|
||||
|
||||
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
|
||||
string(REPLACE "." ";" VERSION_LIST "${CMAKE_CXX_COMPILER_VERSION}")
|
||||
list(GET VERSION_LIST 0 CLANG_VERSION_MAJOR)
|
||||
set(_boost_COMPILER "-clangw${CLANG_VERSION_MAJOR};${_boost_COMPILER}")
|
||||
endif()
|
||||
elseif (BORLAND)
|
||||
set(_boost_COMPILER "-bcb")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
|
||||
@@ -489,25 +502,35 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
|
||||
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
|
||||
set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
|
||||
else()
|
||||
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION)
|
||||
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION _boost_COMPILER_VERSION_MAJOR _boost_COMPILER_VERSION_MINOR)
|
||||
set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
|
||||
endif()
|
||||
elseif (UNIX)
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION _boost_COMPILER_VERSION_MAJOR _boost_COMPILER_VERSION_MINOR)
|
||||
if(NOT Boost_VERSION VERSION_LESS 106900)
|
||||
# From GCC 5 and clang 4, versioning changes and minor becomes patch.
|
||||
# For those compilers, patch is exclude from compiler tag in Boost 1.69+ library naming.
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER 4)
|
||||
set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER 3)
|
||||
set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
|
||||
set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34
|
||||
else()
|
||||
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION)
|
||||
# Determine which version of GCC we have.
|
||||
if(APPLE)
|
||||
if(Boost_MINOR_VERSION)
|
||||
if(${Boost_MINOR_VERSION} GREATER 35)
|
||||
# In Boost 1.36.0 and newer, the mangled compiler name used
|
||||
# on Mac OS X/Darwin is "xgcc".
|
||||
# on macOS/Darwin is "xgcc".
|
||||
set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
|
||||
else()
|
||||
# In Boost <= 1.35.0, there is no mangled compiler name for
|
||||
# the Mac OS X/Darwin version of GCC.
|
||||
# the macOS/Darwin version of GCC.
|
||||
set(_boost_COMPILER "")
|
||||
endif()
|
||||
else()
|
||||
@@ -519,7 +542,10 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
|
||||
set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
endif ()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
# TODO: Find out any Boost version constraints vs clang support.
|
||||
set(_boost_COMPILER "-clang${_boost_COMPILER_VERSION}")
|
||||
endif()
|
||||
else()
|
||||
# TODO at least Boost_DEBUG here?
|
||||
set(_boost_COMPILER "")
|
||||
@@ -583,7 +609,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
|
||||
endif()
|
||||
|
||||
set(_Boost_IMPORTED_TARGETS TRUE)
|
||||
if(Boost_VERSION VERSION_LESS 103300)
|
||||
if(Boost_VERSION AND Boost_VERSION VERSION_LESS 103300)
|
||||
message(WARNING "Imported targets and dependency information not available for Boost version ${Boost_VERSION} (all versions older than 1.33)")
|
||||
set(_Boost_IMPORTED_TARGETS FALSE)
|
||||
elseif(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
|
||||
@@ -816,26 +842,72 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
|
||||
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
||||
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
|
||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||
elseif(NOT Boost_VERSION VERSION_LESS 106700 AND Boost_VERSION VERSION_LESS 106800)
|
||||
set(_Boost_CHRONO_DEPENDENCIES system)
|
||||
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
|
||||
set(_Boost_COROUTINE_DEPENDENCIES context system)
|
||||
set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
|
||||
set(_Boost_FILESYSTEM_DEPENDENCIES system)
|
||||
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
|
||||
set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
|
||||
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
|
||||
set(_Boost_MPI_DEPENDENCIES serialization)
|
||||
set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
|
||||
set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
|
||||
set(_Boost_RANDOM_DEPENDENCIES system)
|
||||
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
|
||||
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
||||
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
|
||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||
elseif(NOT Boost_VERSION VERSION_LESS 106800 AND Boost_VERSION VERSION_LESS 106900)
|
||||
set(_Boost_CHRONO_DEPENDENCIES system)
|
||||
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
|
||||
set(_Boost_CONTRACT_DEPENDENCIES thread chrono system date_time)
|
||||
set(_Boost_COROUTINE_DEPENDENCIES context system)
|
||||
set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
|
||||
set(_Boost_FILESYSTEM_DEPENDENCIES system)
|
||||
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
|
||||
set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
|
||||
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
|
||||
set(_Boost_MPI_DEPENDENCIES serialization)
|
||||
set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
|
||||
set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
|
||||
set(_Boost_RANDOM_DEPENDENCIES system)
|
||||
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
|
||||
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
||||
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
|
||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||
elseif(NOT Boost_VERSION VERSION_LESS 106900 AND Boost_VERSION VERSION_LESS 107000)
|
||||
set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
|
||||
set(_Boost_COROUTINE_DEPENDENCIES context)
|
||||
set(_Boost_FIBER_DEPENDENCIES context)
|
||||
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
|
||||
set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
|
||||
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
|
||||
set(_Boost_MPI_DEPENDENCIES serialization)
|
||||
set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
|
||||
set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
|
||||
set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
|
||||
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
||||
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
|
||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||
else()
|
||||
if(NOT Boost_VERSION VERSION_LESS 106700)
|
||||
set(_Boost_CHRONO_DEPENDENCIES system)
|
||||
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
|
||||
set(_Boost_COROUTINE_DEPENDENCIES context system)
|
||||
set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
|
||||
set(_Boost_FILESYSTEM_DEPENDENCIES system)
|
||||
if(NOT Boost_VERSION VERSION_LESS 107000)
|
||||
set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
|
||||
set(_Boost_COROUTINE_DEPENDENCIES context)
|
||||
set(_Boost_FIBER_DEPENDENCIES context)
|
||||
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
|
||||
set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
|
||||
set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
|
||||
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
|
||||
set(_Boost_MPI_DEPENDENCIES serialization)
|
||||
set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
|
||||
set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
|
||||
set(_Boost_RANDOM_DEPENDENCIES system)
|
||||
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
|
||||
set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
|
||||
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
||||
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
|
||||
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
|
||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||
endif()
|
||||
if(NOT Boost_VERSION VERSION_LESS 106800)
|
||||
if(NOT Boost_VERSION VERSION_LESS 107100)
|
||||
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
|
||||
endif()
|
||||
endif()
|
||||
@@ -872,7 +944,12 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
|
||||
set(_Boost_ATOMIC_HEADERS "boost/atomic.hpp")
|
||||
set(_Boost_CHRONO_HEADERS "boost/chrono.hpp")
|
||||
set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
|
||||
set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
|
||||
set(_Boost_CONTRACT_HEADERS "boost/contract.hpp")
|
||||
if(Boost_VERSION VERSION_LESS 106100)
|
||||
set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
|
||||
else()
|
||||
set(_Boost_CONTEXT_HEADERS "boost/context/detail/fcontext.hpp")
|
||||
endif()
|
||||
set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
|
||||
set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
|
||||
set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
|
||||
@@ -901,6 +978,12 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
|
||||
set(_Boost_REGEX_HEADERS "boost/regex.hpp")
|
||||
set(_Boost_SERIALIZATION_HEADERS "boost/serialization/serialization.hpp")
|
||||
set(_Boost_SIGNALS_HEADERS "boost/signals.hpp")
|
||||
set(_Boost_STACKTRACE_ADDR2LINE_HEADERS "boost/stacktrace.hpp")
|
||||
set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp")
|
||||
set(_Boost_STACKTRACE_BASIC_HEADERS "boost/stacktrace.hpp")
|
||||
set(_Boost_STACKTRACE_NOOP_HEADERS "boost/stacktrace.hpp")
|
||||
set(_Boost_STACKTRACE_WINDBG_CACHED_HEADERS "boost/stacktrace.hpp")
|
||||
set(_Boost_STACKTRACE_WINDBG_HEADERS "boost/stacktrace.hpp")
|
||||
set(_Boost_SYSTEM_HEADERS "boost/system/config.hpp")
|
||||
set(_Boost_TEST_EXEC_MONITOR_HEADERS "boost/test/test_exec_monitor.hpp")
|
||||
set(_Boost_THREAD_HEADERS "boost/thread.hpp")
|
||||
@@ -1009,21 +1092,18 @@ function(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS component
|
||||
else()
|
||||
set(_arch_suffix 32)
|
||||
endif()
|
||||
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
|
||||
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.1)
|
||||
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.0)
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
|
||||
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.0)
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18)
|
||||
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-12.0)
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17)
|
||||
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-11.0)
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
|
||||
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-10.0)
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15)
|
||||
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-9.0)
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
|
||||
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-8.0)
|
||||
if(MSVC_TOOLSET_VERSION GREATER_EQUAL 150)
|
||||
# Not yet known.
|
||||
elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 140)
|
||||
# MSVC toolset 14.x versions are forward compatible.
|
||||
foreach(v 9 8 7 6 5 4 3 2 1 0)
|
||||
if(MSVC_TOOLSET_VERSION GREATER_EQUAL 14${v})
|
||||
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.${v})
|
||||
endif()
|
||||
endforeach()
|
||||
elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
|
||||
math(EXPR _toolset_major_version "${MSVC_TOOLSET_VERSION} / 10")
|
||||
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-${_toolset_major_version}.0)
|
||||
endif()
|
||||
set(${componentlibvar} ${${componentlibvar}} PARENT_SCOPE)
|
||||
endif()
|
||||
@@ -1081,7 +1161,8 @@ else()
|
||||
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
|
||||
# _Boost_COMPONENT_DEPENDENCIES.
|
||||
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
|
||||
"1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
|
||||
"1.70.0" "1.70" "1.69.0" "1.69"
|
||||
"1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
|
||||
"1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
|
||||
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
|
||||
"1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
|
||||
@@ -1141,6 +1222,8 @@ if(NOT TARGET Boost::diagnostic_definitions)
|
||||
add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
|
||||
add_library(Boost::disable_autolinking INTERFACE IMPORTED)
|
||||
add_library(Boost::dynamic_linking INTERFACE IMPORTED)
|
||||
set_target_properties(Boost::dynamic_linking PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
|
||||
endif()
|
||||
if(WIN32)
|
||||
# In windows, automatic linking is performed, so you do not have
|
||||
@@ -1165,8 +1248,6 @@ if(WIN32)
|
||||
INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
|
||||
set_target_properties(Boost::disable_autolinking PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
|
||||
set_target_properties(Boost::dynamic_linking PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
|
||||
endif()
|
||||
|
||||
_Boost_CHECK_SPELLING(Boost_ROOT)
|
||||
@@ -1238,7 +1319,7 @@ if(NOT Boost_INCLUDE_DIR)
|
||||
list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
else()
|
||||
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
|
||||
foreach(ver ${_Boost_KNOWN_VERSIONS})
|
||||
foreach(ver ${_boost_TEST_VERSIONS})
|
||||
string(REPLACE "." "_" ver "${ver}")
|
||||
list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS "C:/local/boost_${ver}")
|
||||
endforeach()
|
||||
@@ -1323,6 +1404,7 @@ if(Boost_INCLUDE_DIR)
|
||||
math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
|
||||
math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
|
||||
math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
|
||||
set(Boost_VERSION_STRING "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
|
||||
|
||||
string(APPEND Boost_ERROR_REASON
|
||||
"Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
|
||||
@@ -1382,6 +1464,13 @@ if ( NOT Boost_NAMESPACE )
|
||||
set(Boost_NAMESPACE "boost")
|
||||
endif()
|
||||
|
||||
if(Boost_DEBUG)
|
||||
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||
"Boost_LIB_PREFIX = ${Boost_LIB_PREFIX}")
|
||||
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||
"Boost_NAMESPACE = ${Boost_NAMESPACE}")
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Suffix initialization and compiler suffix detection.
|
||||
# ------------------------------------------------------------------------
|
||||
@@ -1474,27 +1563,35 @@ endif()
|
||||
# -x86 Architecture and address model tag
|
||||
# First character is the architecture, then word-size, either 32 or 64
|
||||
# Only used in 'versioned' layout, added in Boost 1.66.0
|
||||
set(_boost_ARCHITECTURE_TAG "")
|
||||
# {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers
|
||||
if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600)
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "-")
|
||||
# This needs to be kept in-sync with the section of CMakePlatformId.h.in
|
||||
# inside 'defined(_WIN32) && defined(_MSC_VER)'
|
||||
if(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "IA64")
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "i")
|
||||
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "X86"
|
||||
OR ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "x64")
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "x")
|
||||
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} MATCHES "^ARM")
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "a")
|
||||
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "MIPS")
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "m")
|
||||
if(DEFINED Boost_ARCHITECTURE)
|
||||
set(_boost_ARCHITECTURE_TAG "${Boost_ARCHITECTURE}")
|
||||
if(Boost_DEBUG)
|
||||
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||
"using user-specified Boost_ARCHITECTURE = ${_boost_ARCHITECTURE_TAG}")
|
||||
endif()
|
||||
else()
|
||||
set(_boost_ARCHITECTURE_TAG "")
|
||||
# {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers
|
||||
if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600)
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "-")
|
||||
# This needs to be kept in-sync with the section of CMakePlatformId.h.in
|
||||
# inside 'defined(_WIN32) && defined(_MSC_VER)'
|
||||
if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64")
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "i")
|
||||
elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86"
|
||||
OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64")
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "x")
|
||||
elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM")
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "a")
|
||||
elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS")
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "m")
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "64")
|
||||
else()
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "32")
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "64")
|
||||
else()
|
||||
string(APPEND _boost_ARCHITECTURE_TAG "32")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1549,7 +1646,7 @@ foreach(c DEBUG RELEASE)
|
||||
if( Boost_NO_SYSTEM_PATHS )
|
||||
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
else()
|
||||
foreach(ver ${_Boost_KNOWN_VERSIONS})
|
||||
foreach(ver ${_boost_TEST_VERSIONS})
|
||||
string(REPLACE "." "_" ver "${ver}")
|
||||
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/local/boost_${ver}")
|
||||
endforeach()
|
||||
@@ -1680,7 +1777,7 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
|
||||
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
|
||||
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
|
||||
# Gentoo
|
||||
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
|
||||
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}.${COMPONENT_PYTHON_VERSION_MINOR}")
|
||||
# RPMs
|
||||
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
|
||||
endif()
|
||||
@@ -1731,21 +1828,26 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
|
||||
foreach(compiler IN LISTS _boost_COMPILER)
|
||||
list(APPEND _boost_RELEASE_NAMES
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} )
|
||||
endforeach()
|
||||
list(APPEND _boost_RELEASE_NAMES
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
|
||||
if(_boost_STATIC_RUNTIME_WORKAROUND)
|
||||
set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
|
||||
foreach(compiler IN LISTS _boost_COMPILER)
|
||||
list(APPEND _boost_RELEASE_NAMES
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
|
||||
endforeach()
|
||||
list(APPEND _boost_RELEASE_NAMES
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
|
||||
endif()
|
||||
endforeach()
|
||||
@@ -1783,10 +1885,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
|
||||
foreach(compiler IN LISTS _boost_COMPILER)
|
||||
list(APPEND _boost_DEBUG_NAMES
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} )
|
||||
endforeach()
|
||||
list(APPEND _boost_DEBUG_NAMES
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
|
||||
@@ -1795,10 +1899,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
|
||||
foreach(compiler IN LISTS _boost_COMPILER)
|
||||
list(APPEND _boost_DEBUG_NAMES
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
|
||||
endforeach()
|
||||
list(APPEND _boost_DEBUG_NAMES
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
|
||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
|
||||
endif()
|
||||
endforeach()
|
||||
@@ -2037,6 +2143,9 @@ if(Boost_FOUND)
|
||||
message (STATUS " ${COMPONENT}")
|
||||
endif()
|
||||
list(APPEND Boost_LIBRARIES ${Boost_${UPPERCOMPONENT}_LIBRARY})
|
||||
if(COMPONENT STREQUAL "thread")
|
||||
list(APPEND Boost_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
|
||||
18
Builds/CMake/README.md
Normal file
18
Builds/CMake/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
These are modules and sources that support our CMake build.
|
||||
|
||||
== FindBoost.cmake ==
|
||||
|
||||
In order to facilitate updating to latest releases of boost, we've made a local
|
||||
copy of the FindBoost cmake module in our repo. The latest official version can
|
||||
generally be obtained
|
||||
[here](https://github.com/Kitware/CMake/blob/master/Modules/FindBoost.cmake).
|
||||
|
||||
The latest version provided by Kitware can be tailored for use with the
|
||||
version of CMake that it ships with (typically the next upcoming CMake
|
||||
release). As such, the latest version from the repository might not work
|
||||
perfectly with older versions of CMake - for instance, the latest version
|
||||
might use features or properties only available in the version of CMake that
|
||||
it ships with. Given this, it's best to test any updates to this module with a few
|
||||
different versions of cmake.
|
||||
|
||||
@@ -27,20 +27,20 @@ find_dependency (Boost 1.67
|
||||
#[=========================================================[
|
||||
OpenSSL
|
||||
#]=========================================================]
|
||||
if (APPLE AND NOT DEFINED ENV{OPENSSL_ROOT_DIR})
|
||||
find_program (HOMEBREW brew)
|
||||
if (NOT HOMEBREW STREQUAL "HOMEBREW-NOTFOUND")
|
||||
execute_process (COMMAND ${HOMEBREW} --prefix openssl
|
||||
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (NOT DEFINED OPENSSL_ROOT_DIR)
|
||||
if (DEFINED ENV{OPENSSL_ROOT})
|
||||
set (OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT})
|
||||
elseif (APPLE)
|
||||
find_program (homebrew brew)
|
||||
if (homebrew)
|
||||
execute_process (COMMAND ${homebrew} --prefix openssl
|
||||
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif ()
|
||||
endif ()
|
||||
file (TO_CMAKE_PATH "${OPENSSL_ROOT_DIR}" OPENSSL_ROOT_DIR)
|
||||
endif ()
|
||||
|
||||
if ((NOT DEFINED OPENSSL_ROOT) AND (DEFINED ENV{OPENSSL_ROOT}))
|
||||
set (OPENSSL_ROOT $ENV{OPENSSL_ROOT})
|
||||
endif ()
|
||||
file (TO_CMAKE_PATH "${OPENSSL_ROOT}" OPENSSL_ROOT)
|
||||
|
||||
if (static OR APPLE OR MSVC)
|
||||
set (OPENSSL_USE_STATIC_LIBS ON)
|
||||
endif ()
|
||||
|
||||
15
Builds/CMake/echo_file.cmake
Normal file
15
Builds/CMake/echo_file.cmake
Normal file
@@ -0,0 +1,15 @@
|
||||
#[=========================================================[
|
||||
This is a CMake script file that is used to write
|
||||
the contents of a file to stdout (using the cmake
|
||||
echo command). The input file is passed via the
|
||||
IN_FILE variable.
|
||||
#]=========================================================]
|
||||
|
||||
file (READ ${IN_FILE} contents)
|
||||
## only print files that actually have some text in them
|
||||
if (contents MATCHES "[a-z0-9A-Z]+")
|
||||
execute_process(
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E echo "${contents}")
|
||||
endif ()
|
||||
|
||||
16
Builds/CMake/rocks_thirdparty.inc
Normal file
16
Builds/CMake/rocks_thirdparty.inc
Normal file
@@ -0,0 +1,16 @@
|
||||
set (THIRDPARTY_LIBS "")
|
||||
if(WITH_SNAPPY)
|
||||
find_package(snappy REQUIRED)
|
||||
add_definitions(-DSNAPPY)
|
||||
include_directories(${SNAPPY_INCLUDE_DIR})
|
||||
list(APPEND THIRDPARTY_LIBS ${SNAPPY_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WITH_LZ4)
|
||||
find_package(lz4 REQUIRED)
|
||||
add_definitions(-DLZ4)
|
||||
include_directories(${LZ4_INCLUDE_DIR})
|
||||
list(APPEND THIRDPARTY_LIBS ${LZ4_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
||||
4
Builds/CMake/rocksdb_build_version.cc.in
Normal file
4
Builds/CMake/rocksdb_build_version.cc.in
Normal file
@@ -0,0 +1,4 @@
|
||||
#include "build_version.h"
|
||||
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha: N/A";
|
||||
const char* rocksdb_build_git_date = "rocksdb_build_git_date: N/A";
|
||||
const char* rocksdb_build_compile_date = "N/A";
|
||||
13
Builds/CMake/soci_patch.cmake
Normal file
13
Builds/CMake/soci_patch.cmake
Normal file
@@ -0,0 +1,13 @@
|
||||
# This patches unsigned-types.h in the soci official sources
|
||||
# so as to remove type range check exceptions that cause
|
||||
# us trouble when using boost::optional to select int values
|
||||
file (STRINGS include/soci/unsigned-types.h sourcecode)
|
||||
foreach (line_ ${sourcecode})
|
||||
if (line_ MATCHES "^[ \\t]+throw[ ]+soci_error[ ]*\\([ ]*\"Value outside of allowed.+$")
|
||||
set (line_ "//${CMAKE_MATCH_0}")
|
||||
endif ()
|
||||
file (APPEND include/soci/unsigned-types.h.patched "${line_}\n")
|
||||
endforeach ()
|
||||
file (RENAME include/soci/unsigned-types.h include/soci/unsigned-types.h.orig)
|
||||
file (RENAME include/soci/unsigned-types.h.patched include/soci/unsigned-types.h)
|
||||
|
||||
@@ -15,11 +15,10 @@ need these software components
|
||||
| Component | Minimum Recommended Version |
|
||||
|-----------|-----------------------|
|
||||
| [Visual Studio 2017](README.md#install-visual-studio-2017)| 15.5.4 |
|
||||
| [Git for Windows](README.md#install-git-for-windows)| 2.16.1|
|
||||
| [Google Protocol Buffers Compiler](README.md#install-google-protocol-buffers-compiler) | 2.5.1|
|
||||
| [Git for Windows](README.md#install-git-for-windows)| 2.16.1 |
|
||||
| [OpenSSL Library](README.md#install-openssl) | 1.0.2n |
|
||||
| [Boost library](README.md#build-boost) | 1.67.0 |
|
||||
| [CMake for Windows](README.md#optional-install-cmake-for-windows)* | 3.10.2 |
|
||||
| [Boost library](README.md#build-boost) | 1.70.0 |
|
||||
| [CMake for Windows](README.md#optional-install-cmake-for-windows)* | 3.12 |
|
||||
|
||||
\* Only needed if not using the integrated CMake in VS 2017 and prefer generating dedicated project/solution files.
|
||||
|
||||
@@ -49,26 +48,6 @@ Windows](https://git-scm.com/) since it provides a Unix-like command line
|
||||
environment useful for running shell scripts. Use of the bash shell under
|
||||
Windows is mandatory for running the unit tests.
|
||||
|
||||
### Install Google Protocol Buffers Compiler
|
||||
|
||||
Building rippled requires **protoc.exe** version 2. Version 3 is not currently
|
||||
supported.. At your option you may build it yourself from the sources in the
|
||||
[Google Protocol Buffers](https://github.com/google/protobuf) repository, or you
|
||||
may download a
|
||||
[protoc.exe](https://ripple.github.io/Downloads/protoc/2.5.1/protoc.exe)
|
||||
([alternate
|
||||
link](https://github.com/ripple/Downloads/raw/gh-pages/protoc/2.5.1/protoc.exe))
|
||||
precompiled Windows executable from the [Ripple
|
||||
Organization](https://github.com/ripple).
|
||||
|
||||
Either way, once you have the required version of **protoc.exe**, copy it into a
|
||||
standard location that is in your command line `%PATH%`.
|
||||
|
||||
* **NOTE:** If you use an older version of the compiler, the build will fail
|
||||
with errors related to a mismatch of the version of protocol buffer headers
|
||||
versus the compiler. Likewise, if you use version 3 or newer, the build will
|
||||
fail.
|
||||
|
||||
### Install OpenSSL
|
||||
|
||||
[Download OpenSSL.](http://slproweb.com/products/Win32OpenSSL.html) There will
|
||||
@@ -99,13 +78,13 @@ to get the correct 32-/64-bit variant.
|
||||
|
||||
### Build Boost
|
||||
|
||||
Boost 1.67 or later is required.
|
||||
Boost 1.70 or later is required.
|
||||
|
||||
After [downloading boost](http://www.boost.org/users/download/) and unpacking it
|
||||
to `c:\lib`. As of this writing, the most recent version of boost is 1.67.0,
|
||||
which will unpack into a directory named `boost_1_67_0`. We recommended either
|
||||
to `c:\lib`. As of this writing, the most recent version of boost is 1.70.0,
|
||||
which will unpack into a directory named `boost_1_70_0`. We recommended either
|
||||
renaming this directory to `boost`, or creating a junction link `mklink /J boost
|
||||
boost_1_67_0`, so that you can more easily switch between versions.
|
||||
boost_1_70_0`, so that you can more easily switch between versions.
|
||||
|
||||
Next, open **Developer Command Prompt** and type the following commands
|
||||
|
||||
@@ -137,12 +116,10 @@ library paths as they will be required later.
|
||||
Studio 2017 includes an integrated version of CMake that avoids having to
|
||||
manually run CMake, but it is undergoing continuous improvement. Users that
|
||||
prefer to use standard Visual Studio project and solution files need to install
|
||||
a dedicated version of Cmake to generate them. The latest version can be found
|
||||
a dedicated version of CMake to generate them. The latest version can be found
|
||||
at the [CMake download site](https://cmake.org/download/). It is recommended you
|
||||
select the install option to add CMake to your path.
|
||||
|
||||
As of this writing, the latest version of CMake for windows is 3.10.2.
|
||||
|
||||
## Clone the rippled repository
|
||||
|
||||
If you are familiar with cloning github repositories, just follow your normal
|
||||
@@ -218,13 +195,13 @@ documentation](https://docs.microsoft.com/en-us/cpp/ide/cmake-tools-for-visual-c
|
||||
|
||||
If using the provided `CMakeSettings.json` file, the executable will be in
|
||||
```
|
||||
.\build\x64-Release\Release\rippled(_classic).exe
|
||||
.\build\x64-Release\Release\rippled.exe
|
||||
```
|
||||
or
|
||||
```
|
||||
.\build\x64-Debug\Debug\rippled(_classic).exe
|
||||
.\build\x64-Debug\Debug\rippled.exe
|
||||
```
|
||||
where these paths are relative to your cloned git repository.
|
||||
These paths are relative to your cloned git repository.
|
||||
|
||||
# Build using stand-alone CMake
|
||||
|
||||
@@ -237,24 +214,40 @@ execute the following commands within your `rippled` cloned repository:
|
||||
```
|
||||
mkdir build\cmake
|
||||
cd build\cmake
|
||||
cmake ..\.. -G"Visual Studio 15 2017 Win64" -DBOOST_ROOT="C:\lib\boost_1_67_0" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64"
|
||||
cmake ..\.. -G"Visual Studio 15 2017 Win64" -DBOOST_ROOT="C:\lib\boost_1_70_0" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64"
|
||||
```
|
||||
Now launch Visual Studio 2017 and select **File | Open | Project/Solution**.
|
||||
Navigate to the `build\cmake` folder created above and select the `rippled.sln`
|
||||
file. You can then choose whether to build the `Debug` or `Release` solution
|
||||
configuration. Within the **Solution Explorer**, selected either the `rippled`
|
||||
(unity build) project or the `rippled_classic` (non-unity) project, and
|
||||
right-click to build.
|
||||
configuration.
|
||||
|
||||
The executable will be in
|
||||
```
|
||||
.\build\cmake\Release\rippled(_classic).exe
|
||||
.\build\cmake\Release\rippled.exe
|
||||
```
|
||||
or
|
||||
````
|
||||
.\build\cmake\Debug\rippled(_classic).exe
|
||||
````
|
||||
where these paths are relative to your cloned git repository.
|
||||
or
|
||||
```
|
||||
.\build\cmake\Debug\rippled.exe
|
||||
```
|
||||
These paths are relative to your cloned git repository.
|
||||
|
||||
# Unity/No-Unity Builds
|
||||
|
||||
The rippled build system defaults to using [unity source files](http://onqtam.com/programming/2018-07-07-unity-builds/)
|
||||
to improve build times. In some cases it might be desirable to disable the unity build and compile
|
||||
individual translation units. Here is how you can switch to a "no-unity" build configuration:
|
||||
|
||||
## Visual Studio Integrated CMake
|
||||
|
||||
Edit your `CmakeSettings.json` (described above) by adding `-Dunity=OFF` to the `cmakeCommandArgs` entry
|
||||
for each build configuration.
|
||||
|
||||
## Standalone CMake Builds
|
||||
|
||||
When running cmake to generate the Visual Studio project files, add `-Dunity=OFF` to the
|
||||
command line options passed to cmake.
|
||||
|
||||
**Note:** you will need to re-run the cmake configuration step anytime you want to switch between unity/no-unity builds.
|
||||
|
||||
# Unit Test (Recommended)
|
||||
|
||||
|
||||
31
Builds/containers/README.md
Normal file
31
Builds/containers/README.md
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
# rippled Packaging and Containers
|
||||
|
||||
This folder contains docker container definitions and configuration
|
||||
files to support building rpm and deb packages of rippled. The container
|
||||
definitions include some additional software/packages that are used
|
||||
for general build/test CI workflows of rippled but are not explicitly
|
||||
needed for the package building workflow.
|
||||
|
||||
## CMake Targets
|
||||
|
||||
If you have docker installed on your local system, then the main
|
||||
CMake file will enable several targets related to building packages:
|
||||
`rpm_container`, `rpm`, `dpkg_container`, and `dpkg`. The package targets
|
||||
depend on the container targets and will trigger a build of those first.
|
||||
The container builds can take several dozen minutes to complete (depending
|
||||
on hardware specs), so quick build cycles are not possible currently. As
|
||||
such, these targets are often best suited to CI/automated build systems.
|
||||
|
||||
The package build can be invoked like any other cmake target from the
|
||||
rippled root folder:
|
||||
```
|
||||
mkdir -p build/pkg && cd build/pkg
|
||||
cmake -Dpackages_only=ON ../..
|
||||
cmake --build . --target rpm
|
||||
```
|
||||
Upon successful completion, the generated package files will be in
|
||||
the `build/pkg/packages` directory. For deb packages, simply replace
|
||||
`rpm` with `dpkg` in the build command above.
|
||||
|
||||
|
||||
39
Builds/containers/centos-builder/Dockerfile
Normal file
39
Builds/containers/centos-builder/Dockerfile
Normal file
@@ -0,0 +1,39 @@
|
||||
FROM centos:7
|
||||
ARG GIT_COMMIT=unknown
|
||||
ARG CI_USE=false
|
||||
|
||||
LABEL git-commit=$GIT_COMMIT
|
||||
|
||||
COPY centos-builder/centos_setup.sh /tmp/
|
||||
COPY shared/build_deps.sh /tmp/
|
||||
COPY shared/install_cmake.sh /tmp/
|
||||
COPY centos-builder/extras.sh /tmp/
|
||||
RUN chmod +x /tmp/centos_setup.sh && \
|
||||
chmod +x /tmp/build_deps.sh && \
|
||||
chmod +x /tmp/install_cmake.sh && \
|
||||
chmod +x /tmp/extras.sh
|
||||
RUN /tmp/centos_setup.sh
|
||||
RUN /tmp/install_cmake.sh
|
||||
ENV PATH="/opt/local/cmake/bin:$PATH"
|
||||
RUN source scl_source enable devtoolset-6 python27 && \
|
||||
/tmp/build_deps.sh
|
||||
ENV PLANTUML_JAR="/opt/plantuml/plantuml.jar"
|
||||
ENV BOOST_ROOT="/opt/local/boost"
|
||||
ENV OPENSSL_ROOT="/opt/local/openssl"
|
||||
ENV GDB_ROOT="/opt/local/gdb"
|
||||
RUN source scl_source enable devtoolset-6 python27 && \
|
||||
/tmp/extras.sh
|
||||
|
||||
# prep files for package building
|
||||
RUN mkdir -m 777 -p /opt/rippled_bld/pkg
|
||||
WORKDIR /opt/rippled_bld/pkg
|
||||
|
||||
COPY packaging/rpm/rippled.spec ./
|
||||
COPY shared/update_sources.sh ./
|
||||
RUN mkdir -m 777 ./rpmbuild
|
||||
RUN mkdir -m 777 ./rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||
|
||||
COPY packaging/rpm/build_rpm.sh ./
|
||||
CMD ./build_rpm.sh
|
||||
|
||||
|
||||
35
Builds/containers/centos-builder/centos_setup.sh
Executable file
35
Builds/containers/centos-builder/centos_setup.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
source /etc/os-release
|
||||
|
||||
yum -y upgrade
|
||||
yum -y update
|
||||
yum -y install epel-release centos-release-scl
|
||||
yum -y install \
|
||||
wget curl time gcc-c++ time yum-utils \
|
||||
libstdc++-static rpm-build gnupg which make cmake \
|
||||
devtoolset-4 devtoolset-4-gdb devtoolset-4-libasan-devel devtoolset-4-libtsan-devel devtoolset-4-libubsan-devel \
|
||||
devtoolset-6 devtoolset-6-gdb devtoolset-6-libasan-devel devtoolset-6-libtsan-devel devtoolset-6-libubsan-devel \
|
||||
devtoolset-7 devtoolset-7-gdb devtoolset-7-libasan-devel devtoolset-7-libtsan-devel devtoolset-7-libubsan-devel \
|
||||
llvm-toolset-7 llvm-toolset-7-runtime llvm-toolset-7-build llvm-toolset-7-clang \
|
||||
llvm-toolset-7-clang-analyzer llvm-toolset-7-clang-devel llvm-toolset-7-clang-libs \
|
||||
llvm-toolset-7-clang-tools-extra llvm-toolset-7-compiler-rt llvm-toolset-7-lldb \
|
||||
llvm-toolset-7-lldb-devel llvm-toolset-7-python-lldb \
|
||||
flex flex-devel bison bison-devel \
|
||||
ncurses ncurses-devel ncurses-libs graphviz graphviz-devel \
|
||||
lzip p7zip bzip2 bzip2-devel lzma-sdk lzma-sdk-devel xz-devel \
|
||||
zlib zlib-devel zlib-static texinfo openssl openssl-static \
|
||||
jemalloc jemalloc-devel \
|
||||
libicu-devel htop \
|
||||
python27-python rh-python35-python \
|
||||
python-devel python27-python-devel rh-python35-python-devel \
|
||||
python27 rh-python35 \
|
||||
ninja-build git svn \
|
||||
protobuf protobuf-static protobuf-c-devel \
|
||||
protobuf-compiler protobuf-devel \
|
||||
swig ccache perl-Digest-MD5 python2-pip
|
||||
|
||||
# TODO need permanent link
|
||||
yum -y install ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora-secondary/updates/26/i386/Packages/p/python2-six-1.10.0-9.fc26.noarch.rpm
|
||||
|
||||
52
Builds/containers/centos-builder/extras.sh
Executable file
52
Builds/containers/centos-builder/extras.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
if [ "${CI_USE}" = true ] ; then
|
||||
cd /tmp
|
||||
wget https://ftp.gnu.org/gnu/gdb/gdb-8.2.tar.xz
|
||||
tar xf gdb-8.2.tar.xz
|
||||
cd gdb-8.2
|
||||
./configure CFLAGS="-w -O2" CXXFLAGS="-std=gnu++11 -g -O2 -w" --prefix=/opt/local/gdb-8.2
|
||||
make -j$(nproc)
|
||||
make install
|
||||
ln -s /opt/local/gdb-8.2 /opt/local/gdb
|
||||
cd ..
|
||||
rm -f gdb-8.2.tar.xz
|
||||
rm -rf gdb-8.2
|
||||
|
||||
# clang from source
|
||||
RELEASE=tags/RELEASE_701/final
|
||||
INSTALL=/opt/llvm-7.0.1/
|
||||
mkdir -p /tmp/clang-src
|
||||
cd /tmp/clang-src
|
||||
TOPDIR=`pwd`
|
||||
svn co -q http://llvm.org/svn/llvm-project/llvm/${RELEASE} llvm
|
||||
cd ${TOPDIR}/llvm/tools
|
||||
svn co -q http://llvm.org/svn/llvm-project/cfe/${RELEASE} clang
|
||||
cd ${TOPDIR}/llvm/tools/clang/tools
|
||||
svn co -q http://llvm.org/svn/llvm-project/clang-tools-extra/${RELEASE} extra
|
||||
cd ${TOPDIR}/llvm/tools
|
||||
svn co -q http://llvm.org/svn/llvm-project/lld/${RELEASE} lld
|
||||
cd ${TOPDIR}/llvm/tools
|
||||
svn co -q http://llvm.org/svn/llvm-project/polly/${RELEASE} polly
|
||||
cd ${TOPDIR}/llvm/projects
|
||||
svn co -q http://llvm.org/svn/llvm-project/compiler-rt/${RELEASE} compiler-rt
|
||||
cd ${TOPDIR}/llvm/projects
|
||||
svn co -q http://llvm.org/svn/llvm-project/openmp/${RELEASE} openmp
|
||||
cd ${TOPDIR}/llvm/projects
|
||||
svn co -q http://llvm.org/svn/llvm-project/libcxx/${RELEASE} libcxx
|
||||
svn co -q http://llvm.org/svn/llvm-project/libcxxabi/${RELEASE} libcxxabi
|
||||
cd ${TOPDIR}/llvm/projects
|
||||
## config/build
|
||||
cd ${TOPDIR}
|
||||
mkdir mybuilddir && cd mybuilddir
|
||||
cmake ../llvm -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${INSTALL} \
|
||||
-DLLVM_LIBDIR_SUFFIX=64 \
|
||||
-DLLVM_ENABLE_EH=ON \
|
||||
-DLLVM_ENABLE_RTTI=ON
|
||||
cmake --build . --parallel --target install
|
||||
cd /tmp
|
||||
rm -rf clang-src
|
||||
fi
|
||||
41
Builds/containers/gitlab-ci/build_container.sh
Normal file
41
Builds/containers/gitlab-ci/build_container.sh
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
pkgtype=$1
|
||||
if [ "${pkgtype}" = "rpm" ] ; then
|
||||
container_name="${RPM_CONTAINER_NAME}"
|
||||
elif [ "${pkgtype}" = "dpkg" ] ; then
|
||||
container_name="${DPKG_CONTAINER_NAME}"
|
||||
else
|
||||
echo "invalid package type"
|
||||
exit 1
|
||||
fi
|
||||
if docker pull "${ARTIFACTORY_HUB}/${container_name}:${CI_COMMIT_SHA}"; then
|
||||
echo "${pkgtype} container for ${CI_COMMIT_SHA} already exists" \
|
||||
"- skipping container build!"
|
||||
exit 0
|
||||
else
|
||||
echo "no existing ${pkgtype} container for this branch - searching history."
|
||||
for CID_PREV in $(git log --pretty=%H -n30) ; do
|
||||
if docker pull "${ARTIFACTORY_HUB}/${container_name}:${CID_PREV}"; then
|
||||
echo "found container for previous commit ${CID_PREV}" \
|
||||
"- using as cache."
|
||||
docker tag \
|
||||
"${ARTIFACTORY_HUB}/${container_name}:${CID_PREV}" \
|
||||
"${container_name}:${CID_PREV}"
|
||||
CMAKE_EXTRA="-D${pkgtype}_cache_from=${container_name}:${CID_PREV}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
cmake --version
|
||||
test -d build && rm -rf build
|
||||
mkdir -p build/container && cd build/container
|
||||
eval time \
|
||||
cmake -Dpackages_only=ON -DCMAKE_VERBOSE_MAKEFILE=ON ${CMAKE_EXTRA} \
|
||||
-G Ninja ../..
|
||||
time cmake --build . --target "${pkgtype}_container" -- -v
|
||||
docker tag \
|
||||
"${container_name}:${CI_COMMIT_SHA}" \
|
||||
"${ARTIFACTORY_HUB}/${container_name}:${CI_COMMIT_SHA}"
|
||||
time docker push "${ARTIFACTORY_HUB}/${container_name}:${CI_COMMIT_SHA}"
|
||||
|
||||
23
Builds/containers/gitlab-ci/build_package.sh
Normal file
23
Builds/containers/gitlab-ci/build_package.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
pkgtype=$1
|
||||
if [ "${pkgtype}" = "rpm" ] ; then
|
||||
container_name="${RPM_CONTAINER_NAME}"
|
||||
elif [ "${pkgtype}" = "dpkg" ] ; then
|
||||
container_name="${DPKG_CONTAINER_NAME}"
|
||||
else
|
||||
echo "invalid package type"
|
||||
exit 1
|
||||
fi
|
||||
time docker pull "${ARTIFACTORY_HUB}/${container_name}:${CI_COMMIT_SHA}"
|
||||
docker tag \
|
||||
"${ARTIFACTORY_HUB}/${container_name}:${CI_COMMIT_SHA}" \
|
||||
"${container_name}:${CI_COMMIT_SHA}"
|
||||
docker images
|
||||
test -d build && rm -rf build
|
||||
mkdir -p build/${pkgtype} && cd build/${pkgtype}
|
||||
time cmake \
|
||||
-Dpackages_only=ON -Dhave_package_container=ON -DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||
-G Ninja ../..
|
||||
time cmake --build . --target ${pkgtype} -- -v
|
||||
|
||||
15
Builds/containers/gitlab-ci/docker_alpine_setup.sh
Normal file
15
Builds/containers/gitlab-ci/docker_alpine_setup.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
# used as a before/setup script for docker steps in gitlab-ci
|
||||
# expects to be run in standard alpine/dind image
|
||||
echo $(nproc)
|
||||
docker login -u rippled \
|
||||
-p ${ARTIFACTORY_DEPLOY_KEY_RIPPLED} ${ARTIFACTORY_HUB}
|
||||
apk add \
|
||||
bash util-linux coreutils binutils grep \
|
||||
make ninja cmake build-base gcc g++ abuild git \
|
||||
python3 python3-dev
|
||||
pip3 install awscli
|
||||
# list curdir contents to build log:
|
||||
ls -la
|
||||
|
||||
16
Builds/containers/gitlab-ci/get_component.sh
Normal file
16
Builds/containers/gitlab-ci/get_component.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env sh
|
||||
case ${CI_COMMIT_REF_NAME} in
|
||||
develop)
|
||||
export COMPONENT="nightly"
|
||||
;;
|
||||
release)
|
||||
export COMPONENT="unstable"
|
||||
;;
|
||||
master)
|
||||
export COMPONENT="stable"
|
||||
;;
|
||||
*)
|
||||
export COMPONENT="_unknown_"
|
||||
;;
|
||||
esac
|
||||
|
||||
563
Builds/containers/gitlab-ci/pkgbuild.yml
Normal file
563
Builds/containers/gitlab-ci/pkgbuild.yml
Normal file
@@ -0,0 +1,563 @@
|
||||
#########################################################################
|
||||
## ##
|
||||
## gitlab CI defintition for rippled build containers and distro ##
|
||||
## packages (rpm and dpkg). ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
# NOTE: these are sensible defaults for Ripple pipelines. These
|
||||
# can be overridden by project or group variables as needed.
|
||||
variables:
|
||||
RPM_CONTAINER_NAME: "rippled-rpm-builder"
|
||||
DPKG_CONTAINER_NAME: "rippled-dpkg-builder"
|
||||
ARTIFACTORY_HOST: "artifactory.ops.ripple.com"
|
||||
ARTIFACTORY_HUB: "${ARTIFACTORY_HOST}:6555"
|
||||
GIT_SIGN_PUBKEYS_URL: "https://gitlab.ops.ripple.com/snippets/11/raw"
|
||||
PUBLIC_REPO_ROOT: "https://repos.ripple.com/repos"
|
||||
# also need to define this variable ONLY for the primary
|
||||
# build/publish pipeline on the mainline repo:
|
||||
# IS_PRIMARY_REPO = "true"
|
||||
# and if you want to pause for manual approval before
|
||||
# pushing to pkg repos:
|
||||
# REQUIRE_APPROVAL = "true"
|
||||
|
||||
stages:
|
||||
- build_containers
|
||||
- build_packages
|
||||
- smoketest
|
||||
- verify_sig
|
||||
- tag_images
|
||||
- push_to_test
|
||||
- verify_from_test
|
||||
- wait_approval_prod
|
||||
- push_to_prod
|
||||
- verify_from_prod
|
||||
- get_final_hashes
|
||||
|
||||
.dind_template: &dind_param
|
||||
before_script:
|
||||
- . ./Builds/containers/gitlab-ci/docker_alpine_setup.sh
|
||||
variables:
|
||||
docker_driver: overlay2
|
||||
image:
|
||||
name: docker:latest
|
||||
services:
|
||||
- docker:dind
|
||||
tags:
|
||||
- docker-4xlarge
|
||||
|
||||
.only_primary_template: &only_primary
|
||||
only:
|
||||
refs:
|
||||
- /^(master|release|develop)$/
|
||||
variables:
|
||||
- $IS_PRIMARY_REPO == "true"
|
||||
|
||||
.only_primary_manual_template: &only_primary_manual
|
||||
only:
|
||||
refs:
|
||||
- /^(master|release|develop)$/
|
||||
variables:
|
||||
- $IS_PRIMARY_REPO == "true"
|
||||
- $REQUIRE_APPROVAL == "true"
|
||||
when: manual
|
||||
allow_failure: false
|
||||
|
||||
.smoketest_local_template: &run_local_smoketest
|
||||
tags:
|
||||
- xlarge
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/smoketest.sh local
|
||||
|
||||
.smoketest_repo_template: &run_repo_smoketest
|
||||
tags:
|
||||
- xlarge
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/smoketest.sh repo
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: build_containers ##
|
||||
## ##
|
||||
## build containers from docker definitions. These containers are ##
|
||||
## subsequently used to build the rpm and deb packages. ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
build_centos_container:
|
||||
stage: build_containers
|
||||
<<: *dind_param
|
||||
cache:
|
||||
key: containers
|
||||
paths:
|
||||
- .nih_c
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/build_container.sh rpm
|
||||
|
||||
build_ubuntu_container:
|
||||
stage: build_containers
|
||||
<<: *dind_param
|
||||
cache:
|
||||
key: containers
|
||||
paths:
|
||||
- .nih_c
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/build_container.sh dpkg
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: build_packages ##
|
||||
## ##
|
||||
## build packages using containers from previous stage. ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
rpm_build:
|
||||
stage: build_packages
|
||||
dependencies:
|
||||
- build_centos_container
|
||||
<<: *dind_param
|
||||
artifacts:
|
||||
paths:
|
||||
- build/rpm/packages/
|
||||
cache:
|
||||
key: rpm
|
||||
paths:
|
||||
- .nih_c/pkgbuild
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/build_package.sh rpm
|
||||
|
||||
dpkg_build:
|
||||
stage: build_packages
|
||||
dependencies:
|
||||
- build_ubuntu_container
|
||||
<<: *dind_param
|
||||
artifacts:
|
||||
paths:
|
||||
- build/dpkg/packages/
|
||||
cache:
|
||||
key: dpkg
|
||||
paths:
|
||||
- .nih_c/pkgbuild
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/build_package.sh dpkg
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: smoketest ##
|
||||
## ##
|
||||
## install unsigned packages from previous step and run unit tests. ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
centos_7_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- rpm_build
|
||||
image:
|
||||
name: centos:7
|
||||
<<: *run_local_smoketest
|
||||
|
||||
fedora_29_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- rpm_build
|
||||
image:
|
||||
name: fedora:29
|
||||
<<: *run_local_smoketest
|
||||
|
||||
fedora_28_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- rpm_build
|
||||
image:
|
||||
name: fedora:28
|
||||
<<: *run_local_smoketest
|
||||
|
||||
fedora_27_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- rpm_build
|
||||
image:
|
||||
name: fedora:27
|
||||
<<: *run_local_smoketest
|
||||
|
||||
## this one is not LTS, but we
|
||||
## get some extra coverage by including it
|
||||
## consider dropping it when 20.04 is ready
|
||||
ubuntu_19_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
image:
|
||||
name: ubuntu:19.04
|
||||
<<: *run_local_smoketest
|
||||
|
||||
ubuntu_18_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
image:
|
||||
name: ubuntu:18.04
|
||||
<<: *run_local_smoketest
|
||||
|
||||
ubuntu_16_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
image:
|
||||
name: ubuntu:16.04
|
||||
<<: *run_local_smoketest
|
||||
|
||||
debian_9_smoketest:
|
||||
stage: smoketest
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
image:
|
||||
name: debian:9
|
||||
<<: *run_local_smoketest
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: verify_sig ##
|
||||
## ##
|
||||
## use git/gpg to verify that HEAD is signed by an approved ##
|
||||
## committer. The whitelist of pubkeys is manually mantained ##
|
||||
## and fetched from GIT_SIGN_PUBKEYS_URL (currently a snippet ##
|
||||
## link). ##
|
||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
verify_head_signed:
|
||||
stage: verify_sig
|
||||
image:
|
||||
name: ubuntu:latest
|
||||
<<: *only_primary
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/verify_head_commit.sh
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: tag_images ##
|
||||
## ##
|
||||
## apply rippled version tag to containers from previous stage. ##
|
||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
tag_bld_images:
|
||||
stage: tag_images
|
||||
variables:
|
||||
docker_driver: overlay2
|
||||
image:
|
||||
name: docker:latest
|
||||
services:
|
||||
- docker:dind
|
||||
tags:
|
||||
- docker-large
|
||||
dependencies:
|
||||
- rpm_build
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/tag_docker_image.sh
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: push_to_test ##
|
||||
## ##
|
||||
## push packages to artifactory repositories (test) ##
|
||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
push_test:
|
||||
stage: push_to_test
|
||||
variables:
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: alpine:latest
|
||||
artifacts:
|
||||
paths:
|
||||
- files.info
|
||||
dependencies:
|
||||
- rpm_build
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/push_to_artifactory.sh "PUT" "."
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: verify_from_test ##
|
||||
## ##
|
||||
## install/test packages from test repos. ##
|
||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
centos_7_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: centos:7
|
||||
dependencies:
|
||||
- rpm_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
fedora_29_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: fedora:29
|
||||
dependencies:
|
||||
- rpm_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
fedora_28_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: fedora:28
|
||||
dependencies:
|
||||
- rpm_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
fedora_27_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm-test-mirror"
|
||||
image:
|
||||
name: fedora:27
|
||||
dependencies:
|
||||
- rpm_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_19_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
DISTRO: "disco"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: ubuntu:19.04
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_18_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
DISTRO: "bionic"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: ubuntu:18.04
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_16_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
DISTRO: "xenial"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: ubuntu:16.04
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
debian_9_verify_repo_test:
|
||||
stage: verify_from_test
|
||||
variables:
|
||||
DISTRO: "stretch"
|
||||
DEB_REPO: "rippled-deb-test-mirror"
|
||||
image:
|
||||
name: debian:9
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: wait_approval_prod ##
|
||||
## ##
|
||||
## wait for manual approval before proceeding to next stage ##
|
||||
## which pushes to prod repo. ##
|
||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO and when ##
|
||||
## REQUIRE_APPROVAL is set to true. ##
|
||||
## ##
|
||||
#########################################################################
|
||||
wait_before_push_prod:
|
||||
stage: wait_approval_prod
|
||||
image:
|
||||
name: alpine:latest
|
||||
<<: *only_primary_manual
|
||||
script:
|
||||
- echo "proceeding to next stage"
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: push_to_prod ##
|
||||
## ##
|
||||
## push packages to artifactory repositories (prod) ##
|
||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
push_prod:
|
||||
variables:
|
||||
DEB_REPO: "rippled-deb"
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: alpine:latest
|
||||
stage: push_to_prod
|
||||
artifacts:
|
||||
paths:
|
||||
- files.info
|
||||
dependencies:
|
||||
- rpm_build
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/push_to_artifactory.sh "PUT" "."
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: verify_from_prod ##
|
||||
## ##
|
||||
## install/test packages from prod repos. ##
|
||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
centos_7_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: centos:7
|
||||
dependencies:
|
||||
- rpm_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
fedora_29_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: fedora:29
|
||||
dependencies:
|
||||
- rpm_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
fedora_28_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: fedora:28
|
||||
dependencies:
|
||||
- rpm_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
fedora_27_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: fedora:27
|
||||
dependencies:
|
||||
- rpm_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_19_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
DISTRO: "disco"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: ubuntu:19.04
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_18_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
DISTRO: "bionic"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: ubuntu:18.04
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
ubuntu_16_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
DISTRO: "xenial"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: ubuntu:16.04
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
debian_9_verify_repo_prod:
|
||||
stage: verify_from_prod
|
||||
variables:
|
||||
DISTRO: "stretch"
|
||||
DEB_REPO: "rippled-deb"
|
||||
image:
|
||||
name: debian:9
|
||||
dependencies:
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
<<: *run_repo_smoketest
|
||||
|
||||
#########################################################################
|
||||
## ##
|
||||
## stage: get_final_hashes ##
|
||||
## ##
|
||||
## fetch final hashes from artifactory. ##
|
||||
## ONLY RUNS FOR PRIMARY BRANCHES/REPO ##
|
||||
## ##
|
||||
#########################################################################
|
||||
|
||||
get_prod_hashes:
|
||||
variables:
|
||||
DEB_REPO: "rippled-deb"
|
||||
RPM_REPO: "rippled-rpm"
|
||||
image:
|
||||
name: alpine:latest
|
||||
stage: get_final_hashes
|
||||
artifacts:
|
||||
paths:
|
||||
- files.info
|
||||
dependencies:
|
||||
- rpm_build
|
||||
- dpkg_build
|
||||
<<: *only_primary
|
||||
script:
|
||||
- . ./Builds/containers/gitlab-ci/push_to_artifactory.sh "GET" ".checksums"
|
||||
|
||||
91
Builds/containers/gitlab-ci/push_to_artifactory.sh
Normal file
91
Builds/containers/gitlab-ci/push_to_artifactory.sh
Normal file
@@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
action=$1
|
||||
filter=$2
|
||||
|
||||
. ./Builds/containers/gitlab-ci/get_component.sh
|
||||
|
||||
apk add curl jq coreutils util-linux
|
||||
TOPDIR=$(pwd)
|
||||
|
||||
# DPKG
|
||||
|
||||
cd $TOPDIR
|
||||
cd build/dpkg/packages
|
||||
CURLARGS="-sk -X${action} -urippled:${ARTIFACTORY_DEPLOY_KEY_RIPPLED}"
|
||||
RIPPLED_PKG=$(ls rippled_*.deb)
|
||||
RIPPLED_DEV_PKG=$(ls rippled-dev_*.deb)
|
||||
RIPPLED_DBG_PKG=$(ls rippled-dbgsym_*.deb)
|
||||
# TODO - where to upload src tgz?
|
||||
RIPPLED_SRC=$(ls rippled_*.orig.tar.gz)
|
||||
DEB_MATRIX=";deb.component=${COMPONENT};deb.architecture=amd64"
|
||||
for dist in stretch buster xenial bionic disco ; do
|
||||
DEB_MATRIX="${DEB_MATRIX};deb.distribution=${dist}"
|
||||
done
|
||||
echo "{ \"debs\": {" > "${TOPDIR}/files.info"
|
||||
for deb in ${RIPPLED_PKG} ${RIPPLED_DEV_PKG} ${RIPPLED_DBG_PKG} ; do
|
||||
# first item doesn't get a comma separator
|
||||
if [ $deb != $RIPPLED_PKG ] ; then
|
||||
echo "," >> "${TOPDIR}/files.info"
|
||||
fi
|
||||
echo "\"${deb}\"": | tee -a "${TOPDIR}/files.info"
|
||||
ca="${CURLARGS}"
|
||||
if [ "${action}" = "PUT" ] ; then
|
||||
url="https://${ARTIFACTORY_HOST}/artifactory/${DEB_REPO}/pool/${deb}${DEB_MATRIX}"
|
||||
ca="${ca} -T${deb}"
|
||||
elif [ "${action}" = "GET" ] ; then
|
||||
url="https://${ARTIFACTORY_HOST}/artifactory/api/storage/${DEB_REPO}/pool/${deb}"
|
||||
fi
|
||||
echo "file info request url --> ${url}"
|
||||
eval "curl ${ca} \"${url}\"" | jq -M "${filter}" | tee -a "${TOPDIR}/files.info"
|
||||
done
|
||||
echo "}," >> "${TOPDIR}/files.info"
|
||||
|
||||
# RPM
|
||||
|
||||
cd $TOPDIR
|
||||
cd build/rpm/packages
|
||||
RIPPLED_PKG=$(ls rippled-[0-9]*.x86_64.rpm)
|
||||
RIPPLED_DEV_PKG=$(ls rippled-devel*.rpm)
|
||||
RIPPLED_DBG_PKG=$(ls rippled-debuginfo*.rpm)
|
||||
# TODO - where to upload src rpm ?
|
||||
RIPPLED_SRC=$(ls rippled-[0-9]*.src.rpm)
|
||||
echo "\"rpms\": {" >> "${TOPDIR}/files.info"
|
||||
for rpm in ${RIPPLED_PKG} ${RIPPLED_DEV_PKG} ${RIPPLED_DBG_PKG} ; do
|
||||
# first item doesn't get a comma separator
|
||||
if [ $rpm != $RIPPLED_PKG ] ; then
|
||||
echo "," >> "${TOPDIR}/files.info"
|
||||
fi
|
||||
echo "\"${rpm}\"": | tee -a "${TOPDIR}/files.info"
|
||||
ca="${CURLARGS}"
|
||||
if [ "${action}" = "PUT" ] ; then
|
||||
url="https://${ARTIFACTORY_HOST}/artifactory/${RPM_REPO}/${COMPONENT}/"
|
||||
ca="${ca} -T${rpm}"
|
||||
elif [ "${action}" = "GET" ] ; then
|
||||
url="https://${ARTIFACTORY_HOST}/artifactory/api/storage/${RPM_REPO}/${COMPONENT}/${rpm}"
|
||||
fi
|
||||
echo "file info request url --> ${url}"
|
||||
eval "curl ${ca} \"${url}\"" | jq -M "${filter}" | tee -a "${TOPDIR}/files.info"
|
||||
done
|
||||
echo "}}" >> "${TOPDIR}/files.info"
|
||||
jq '.' "${TOPDIR}/files.info" > "${TOPDIR}/files.info.tmp"
|
||||
mv "${TOPDIR}/files.info.tmp" "${TOPDIR}/files.info"
|
||||
|
||||
if [ ! -z "${SLACK_NOTIFY_URL}" ] && [ "${action}" = "GET" ] ; then
|
||||
# extract files.info content to variable and sanitize so it can
|
||||
# be interpolated into a slack text field below
|
||||
finfo=$(cat ${TOPDIR}/files.info | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g' | sed -E 's/"/\\"/g')
|
||||
# try posting file info to slack.
|
||||
# can add channel field to payload if the
|
||||
# default channel is incorrect. Get rid of
|
||||
# newlines in payload json since slack doesn't accept them
|
||||
CONTENT=$(tr -d '[\n]' <<JSON
|
||||
payload={
|
||||
"username": "GitlabCI",
|
||||
"text": "The package build for branch \`${CI_COMMIT_REF_NAME}\` is complete. File hashes are: \`\`\`${finfo}\`\`\`",
|
||||
"icon_emoji": ":package:"}
|
||||
JSON
|
||||
)
|
||||
curl ${SLACK_NOTIFY_URL} --data-urlencode "${CONTENT}"
|
||||
fi
|
||||
|
||||
99
Builds/containers/gitlab-ci/smoketest.sh
Normal file
99
Builds/containers/gitlab-ci/smoketest.sh
Normal file
@@ -0,0 +1,99 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
install_from=$1
|
||||
use_private=${2:-0} # this option not currently needed by any CI scripts,
|
||||
# reserved for possible future use
|
||||
if [ "$use_private" -gt 0 ] ; then
|
||||
REPO_ROOT="https://rippled:${ARTIFACTORY_DEPLOY_KEY_RIPPLED}@${ARTIFACTORY_HOST}/artifactory"
|
||||
else
|
||||
REPO_ROOT="${PUBLIC_REPO_ROOT}"
|
||||
fi
|
||||
|
||||
. ./Builds/containers/gitlab-ci/get_component.sh
|
||||
|
||||
. /etc/os-release
|
||||
case ${ID} in
|
||||
ubuntu|debian)
|
||||
pkgtype="dpkg"
|
||||
;;
|
||||
fedora|centos|rhel|scientific)
|
||||
pkgtype="rpm"
|
||||
;;
|
||||
*)
|
||||
echo "unrecognized distro!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# this script provides info variables about pkg version
|
||||
. build/${pkgtype}/packages/build_vars
|
||||
|
||||
if [ "${pkgtype}" = "dpkg" ] ; then
|
||||
# sometimes update fails and requires a cleanup
|
||||
updateWithRetry()
|
||||
{
|
||||
if ! apt-get -y update ; then
|
||||
rm -rvf /var/lib/apt/lists/*
|
||||
apt-get -y clean
|
||||
apt-get -y update
|
||||
fi
|
||||
}
|
||||
if [ "${install_from}" = "repo" ] ; then
|
||||
apt-get -y upgrade
|
||||
updateWithRetry
|
||||
apt-get -y install apt apt-transport-https ca-certificates coreutils util-linux wget gnupg
|
||||
wget -q -O - "${REPO_ROOT}/api/gpg/key/public" | apt-key add -
|
||||
echo "deb ${REPO_ROOT}/${DEB_REPO} ${DISTRO} ${COMPONENT}" >> /etc/apt/sources.list
|
||||
updateWithRetry
|
||||
# uncomment this next line if you want to see the available package versions
|
||||
# apt-cache policy rippled
|
||||
apt-get -y install rippled=${dpkg_full_version}
|
||||
elif [ "${install_from}" = "local" ] ; then
|
||||
# cached pkg install
|
||||
updateWithRetry
|
||||
apt-get -y install libprotobuf-dev libssl-dev
|
||||
rm -f build/dpkg/packages/rippled-dbgsym*.*
|
||||
dpkg --no-debsig -i build/dpkg/packages/*.deb
|
||||
else
|
||||
echo "unrecognized pkg source!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
yum -y update
|
||||
if [ "${install_from}" = "repo" ] ; then
|
||||
yum -y install yum-utils coreutils util-linux
|
||||
REPOFILE="/etc/yum.repos.d/artifactory.repo"
|
||||
echo "[Artifactory]" > ${REPOFILE}
|
||||
echo "name=Artifactory" >> ${REPOFILE}
|
||||
echo "baseurl=${REPO_ROOT}/${RPM_REPO}/${COMPONENT}/" >> ${REPOFILE}
|
||||
echo "enabled=1" >> ${REPOFILE}
|
||||
echo "gpgcheck=0" >> ${REPOFILE}
|
||||
echo "gpgkey=${REPO_ROOT}/${RPM_REPO}/${COMPONENT}/repodata/repomd.xml.key" >> ${REPOFILE}
|
||||
echo "repo_gpgcheck=1" >> ${REPOFILE}
|
||||
yum -y update
|
||||
# uncomment this next line if you want to see the available package versions
|
||||
# yum --showduplicates list rippled
|
||||
yum -y install ${rpm_version_release}
|
||||
elif [ "${install_from}" = "local" ] ; then
|
||||
# cached pkg install
|
||||
yum install -y yum-utils openssl-static zlib-static
|
||||
rm -f build/rpm/packages/rippled-debug*.rpm
|
||||
rm -f build/rpm/packages/*.src.rpm
|
||||
rpm -i build/rpm/packages/*.rpm
|
||||
else
|
||||
echo "unrecognized pkg source!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# verify installed version
|
||||
INSTALLED=$(/opt/ripple/bin/rippled --version | awk '{print $NF}')
|
||||
if [ "${rippled_version}" != "${INSTALLED}" ] ; then
|
||||
echo "INSTALLED version ${INSTALLED} does not match ${rippled_version}"
|
||||
exit 1
|
||||
fi
|
||||
# run unit tests
|
||||
/opt/ripple/bin/rippled --unittest --unittest-jobs $(nproc)
|
||||
/opt/ripple/bin/validator-keys --unittest
|
||||
|
||||
|
||||
17
Builds/containers/gitlab-ci/tag_docker_image.sh
Normal file
17
Builds/containers/gitlab-ci/tag_docker_image.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
docker login -u rippled \
|
||||
-p ${ARTIFACTORY_DEPLOY_KEY_RIPPLED} "${ARTIFACTORY_HUB}"
|
||||
# this gives us rippled_version :
|
||||
source build/rpm/packages/build_vars
|
||||
docker pull "${ARTIFACTORY_HUB}/${RPM_CONTAINER_NAME}:${CI_COMMIT_SHA}"
|
||||
docker pull "${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}:${CI_COMMIT_SHA}"
|
||||
docker tag \
|
||||
"${ARTIFACTORY_HUB}/${RPM_CONTAINER_NAME}:${CI_COMMIT_SHA}" \
|
||||
"${ARTIFACTORY_HUB}/${RPM_CONTAINER_NAME}:${rippled_version}_${CI_COMMIT_REF_SLUG}"
|
||||
docker tag \
|
||||
"${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}:${CI_COMMIT_SHA}" \
|
||||
"${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}:${rippled_version}_${CI_COMMIT_REF_SLUG}"
|
||||
docker push "${ARTIFACTORY_HUB}/${RPM_CONTAINER_NAME}"
|
||||
docker push "${ARTIFACTORY_HUB}/${DPKG_CONTAINER_NAME}"
|
||||
|
||||
16
Builds/containers/gitlab-ci/verify_head_commit.sh
Normal file
16
Builds/containers/gitlab-ci/verify_head_commit.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
apt -y update
|
||||
apt -y install software-properties-common curl git gnupg
|
||||
curl -sk -o rippled-pubkeys.txt "${GIT_SIGN_PUBKEYS_URL}"
|
||||
gpg --import rippled-pubkeys.txt
|
||||
if git verify-commit HEAD; then
|
||||
echo "git commit signature check passed"
|
||||
else
|
||||
echo "git commit signature check failed"
|
||||
git log -n 5 --color
|
||||
--pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an> [%G?]%Creset'
|
||||
--abbrev-commit
|
||||
exit 1
|
||||
fi
|
||||
|
||||
88
Builds/containers/packaging/dpkg/build_dpkg.sh
Executable file
88
Builds/containers/packaging/dpkg/build_dpkg.sh
Executable file
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
source update_sources.sh
|
||||
|
||||
# Build the dpkg
|
||||
|
||||
#dpkg uses - as separator, so we need to change our -bN versions to tilde
|
||||
RIPPLED_DPKG_VERSION=$(echo "${RIPPLED_VERSION}" | sed 's!-!~!g')
|
||||
# TODO - decide how to handle the trailing/release
|
||||
# version here (hardcoded to 1). Does it ever need to change?
|
||||
RIPPLED_DPKG_FULL_VERSION="${RIPPLED_DPKG_VERSION}-1"
|
||||
|
||||
cd rippled
|
||||
if [[ -n $(git status --porcelain) ]]; then
|
||||
git status
|
||||
error "Unstaged changes in this repo - please commit first"
|
||||
fi
|
||||
git archive --format tar.gz --prefix rippled-${RIPPLED_DPKG_VERSION}/ -o ../rippled-${RIPPLED_DPKG_VERSION}.tar.gz HEAD
|
||||
cd ..
|
||||
# dpkg debmake would normally create this link, but we do it manually
|
||||
ln -s ./rippled-${RIPPLED_DPKG_VERSION}.tar.gz rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz
|
||||
tar xvf rippled-${RIPPLED_DPKG_VERSION}.tar.gz
|
||||
cd rippled-${RIPPLED_DPKG_VERSION}
|
||||
cp -pr ../debian .
|
||||
|
||||
# dpkg requires a changelog. We don't currently maintain
|
||||
# a useable one, so let's just fake it with our current version
|
||||
# TODO : not sure if the "unstable" will need to change for
|
||||
# release packages (?)
|
||||
NOWSTR=$(TZ=UTC date -R)
|
||||
cat << CHANGELOG > ./debian/changelog
|
||||
rippled (${RIPPLED_DPKG_FULL_VERSION}) unstable; urgency=low
|
||||
|
||||
* see RELEASENOTES
|
||||
|
||||
-- Ripple Labs Inc. <support@ripple.com> ${NOWSTR}
|
||||
CHANGELOG
|
||||
|
||||
# PATH must be preserved for our more modern cmake in /opt/local
|
||||
# TODO : consider allowing lintian to run in future ?
|
||||
export DH_BUILD_DDEBS=1
|
||||
debuild --no-lintian --preserve-envvar PATH --preserve-env -us -uc
|
||||
rc=$?; if [[ $rc != 0 ]]; then
|
||||
error "error building dpkg"
|
||||
fi
|
||||
cd ..
|
||||
ls -latr
|
||||
|
||||
# copy artifacts
|
||||
cp rippled-dev_${RIPPLED_DPKG_FULL_VERSION}_amd64.deb ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.deb ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}.dsc ${PKG_OUTDIR}
|
||||
# dbgsym suffix is ddeb under newer debuild, but just deb under earlier
|
||||
cp rippled-dbgsym_${RIPPLED_DPKG_FULL_VERSION}_amd64.* ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.changes ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.build ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz ${PKG_OUTDIR}
|
||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}.debian.tar.xz ${PKG_OUTDIR}
|
||||
# buildinfo is only generated by later version of debuild
|
||||
if [ -e rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.buildinfo ] ; then
|
||||
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.buildinfo ${PKG_OUTDIR}
|
||||
fi
|
||||
|
||||
cat rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.changes
|
||||
# extract the text in the .changes file that appears between
|
||||
# Checksums-Sha256: ...
|
||||
# and
|
||||
# Files: ...
|
||||
awk '/Checksums-Sha256:/{hit=1;next}/Files:/{hit=0}hit' \
|
||||
rippled_${RIPPLED_DPKG_VERSION}-1_amd64.changes | \
|
||||
sed -E 's!^[[:space:]]+!!' > shasums
|
||||
DEB_SHA256=$(cat shasums | \
|
||||
grep "rippled_${RIPPLED_DPKG_VERSION}-1_amd64.deb" | cut -d " " -f 1)
|
||||
DBG_SHA256=$(cat shasums | \
|
||||
grep "rippled-dbgsym_${RIPPLED_DPKG_VERSION}-1_amd64.*" | cut -d " " -f 1)
|
||||
DEV_SHA256=$(cat shasums | \
|
||||
grep "rippled-dev_${RIPPLED_DPKG_VERSION}-1_amd64.deb" | cut -d " " -f 1)
|
||||
SRC_SHA256=$(cat shasums | \
|
||||
grep "rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz" | cut -d " " -f 1)
|
||||
echo "deb_sha256=${DEB_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dbg_sha256=${DBG_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dev_sha256=${DEV_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "src_sha256=${SRC_SHA256}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rippled_version=${RIPPLED_VERSION}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dpkg_version=${RIPPLED_DPKG_VERSION}" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dpkg_full_version=${RIPPLED_DPKG_FULL_VERSION}" >> ${PKG_OUTDIR}/build_vars
|
||||
|
||||
3
Builds/containers/packaging/dpkg/debian/README.Debian
Normal file
3
Builds/containers/packaging/dpkg/debian/README.Debian
Normal file
@@ -0,0 +1,3 @@
|
||||
rippled daemon
|
||||
|
||||
-- Mike Ellery <mellery451@gmail.com> Tue, 04 Dec 2018 18:19:03 +0000
|
||||
1
Builds/containers/packaging/dpkg/debian/compat
Normal file
1
Builds/containers/packaging/dpkg/debian/compat
Normal file
@@ -0,0 +1 @@
|
||||
9
|
||||
3
Builds/containers/packaging/dpkg/debian/conffiles
Normal file
3
Builds/containers/packaging/dpkg/debian/conffiles
Normal file
@@ -0,0 +1,3 @@
|
||||
opt/ripple/etc/rippled.cfg
|
||||
opt/ripple/etc/validators.txt
|
||||
etc/logrotate.d/rippled
|
||||
21
Builds/containers/packaging/dpkg/debian/control
Normal file
21
Builds/containers/packaging/dpkg/debian/control
Normal file
@@ -0,0 +1,21 @@
|
||||
Source: rippled
|
||||
Section: misc
|
||||
Priority: extra
|
||||
Maintainer: Ripple Labs Inc. <support@ripple.com>
|
||||
Build-Depends: cmake, debhelper (>=9), libprotobuf-dev, libssl-dev, zlib1g-dev, dh-systemd, ninja-build
|
||||
Standards-Version: 3.9.7
|
||||
Homepage: http://ripple.com/
|
||||
|
||||
Package: rippled
|
||||
Architecture: any
|
||||
Multi-Arch: foreign
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: rippled daemon
|
||||
|
||||
Package: rippled-dev
|
||||
Section: devel
|
||||
Recommends: rippled (= ${binary:Version})
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}, libprotobuf-dev, libssl-dev
|
||||
Description: development files for applications using xrpl core library (serialize + sign)
|
||||
86
Builds/containers/packaging/dpkg/debian/copyright
Normal file
86
Builds/containers/packaging/dpkg/debian/copyright
Normal file
@@ -0,0 +1,86 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: rippled
|
||||
Source: https://github.com/ripple/rippled
|
||||
|
||||
Files: *
|
||||
Copyright: 2012-2019 Ripple Labs Inc.
|
||||
|
||||
License: __UNKNOWN__
|
||||
|
||||
The accompanying files under various copyrights.
|
||||
|
||||
Copyright (c) 2012, 2013, 2014 Ripple Labs Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
The accompanying files incorporate work covered by the following copyright
|
||||
and previous license notice:
|
||||
|
||||
Copyright (c) 2011 Arthur Britto, David Schwartz, Jed McCaleb,
|
||||
Vinnie Falco, Bob Way, Eric Lombrozo, Nikolaos D. Bougalis, Howard Hinnant
|
||||
|
||||
Some code from Raw Material Software, Ltd., provided under the terms of the
|
||||
ISC License. See the corresponding source files for more details.
|
||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
||||
Please visit http://www.juce.com
|
||||
|
||||
Some code from ASIO examples:
|
||||
// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
Some code from Bitcoin:
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2011 The Bitcoin developers
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
Some code from Tom Wu:
|
||||
This software is covered under the following copyright:
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003-2005 Tom Wu
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
|
||||
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
|
||||
* THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
|
||||
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* In addition, the following condition applies:
|
||||
*
|
||||
* All redistributions must retain an intact copy of this copyright notice
|
||||
* and disclaimer.
|
||||
*/
|
||||
|
||||
Address all questions regarding this license to:
|
||||
|
||||
Tom Wu
|
||||
tjw@cs.Stanford.EDU
|
||||
3
Builds/containers/packaging/dpkg/debian/dirs
Normal file
3
Builds/containers/packaging/dpkg/debian/dirs
Normal file
@@ -0,0 +1,3 @@
|
||||
/var/log/rippled/
|
||||
/var/lib/rippled/
|
||||
/etc/systemd/system/rippled.service.d/
|
||||
3
Builds/containers/packaging/dpkg/debian/docs
Normal file
3
Builds/containers/packaging/dpkg/debian/docs
Normal file
@@ -0,0 +1,3 @@
|
||||
README.md
|
||||
LICENSE
|
||||
RELEASENOTES.md
|
||||
@@ -0,0 +1,3 @@
|
||||
opt/ripple/include
|
||||
opt/ripple/lib/*.a
|
||||
opt/ripple/lib/cmake/ripple
|
||||
7
Builds/containers/packaging/dpkg/debian/rippled.install
Normal file
7
Builds/containers/packaging/dpkg/debian/rippled.install
Normal file
@@ -0,0 +1,7 @@
|
||||
opt/ripple/bin/rippled
|
||||
opt/ripple/bin/validator-keys
|
||||
opt/ripple/bin/update-rippled.sh
|
||||
opt/ripple/etc/rippled.cfg
|
||||
opt/ripple/etc/validators.txt
|
||||
opt/ripple/etc/update-rippled-cron
|
||||
etc/logrotate.d/rippled
|
||||
3
Builds/containers/packaging/dpkg/debian/rippled.links
Normal file
3
Builds/containers/packaging/dpkg/debian/rippled.links
Normal file
@@ -0,0 +1,3 @@
|
||||
opt/ripple/etc/rippled.cfg etc/opt/ripple/rippled.cfg
|
||||
opt/ripple/etc/validators.txt etc/opt/ripple/validators.txt
|
||||
opt/ripple/bin/rippled usr/local/bin/rippled
|
||||
35
Builds/containers/packaging/dpkg/debian/rippled.postinst
Normal file
35
Builds/containers/packaging/dpkg/debian/rippled.postinst
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
USER_NAME=rippled
|
||||
GROUP_NAME=rippled
|
||||
case "$1" in
|
||||
configure)
|
||||
id -u $USER_NAME >/dev/null 2>&1 || \
|
||||
adduser --system --quiet \
|
||||
--home /nonexistent --no-create-home \
|
||||
--disabled-password \
|
||||
--group "$GROUP_NAME"
|
||||
chown -R $USER_NAME:$GROUP_NAME /var/log/rippled/
|
||||
chown -R $USER_NAME:$GROUP_NAME /var/lib/rippled/
|
||||
chown -R $USER_NAME:$GROUP_NAME /opt/ripple
|
||||
chmod 755 /var/log/rippled/
|
||||
chmod 755 /var/lib/rippled/
|
||||
chmod 644 /opt/ripple/etc/update-rippled-cron
|
||||
chmod 644 /etc/logrotate.d/rippled
|
||||
chown -R root:$GROUP_NAME /opt/ripple/etc/update-rippled-cron
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
17
Builds/containers/packaging/dpkg/debian/rippled.postrm
Normal file
17
Builds/containers/packaging/dpkg/debian/rippled.postrm
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
20
Builds/containers/packaging/dpkg/debian/rippled.preinst
Normal file
20
Builds/containers/packaging/dpkg/debian/rippled.preinst
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
install|upgrade)
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "preinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
20
Builds/containers/packaging/dpkg/debian/rippled.prerm
Normal file
20
Builds/containers/packaging/dpkg/debian/rippled.prerm
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
remove|upgrade|deconfigure)
|
||||
;;
|
||||
|
||||
failed-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "prerm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
46
Builds/containers/packaging/dpkg/debian/rules
Executable file
46
Builds/containers/packaging/dpkg/debian/rules
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/make -f
|
||||
export DH_VERBOSE = 1
|
||||
export DH_OPTIONS = -v
|
||||
# debuild sets some warnings that don't work well
|
||||
# for our curent build..so try to remove those flags here:
|
||||
export CFLAGS:=$(subst -Wformat,,$(CFLAGS))
|
||||
export CFLAGS:=$(subst -Werror=format-security,,$(CFLAGS))
|
||||
export CXXFLAGS:=$(subst -Wformat,,$(CXXFLAGS))
|
||||
export CXXFLAGS:=$(subst -Werror=format-security,,$(CXXFLAGS))
|
||||
|
||||
%:
|
||||
dh $@ --with systemd
|
||||
|
||||
override_dh_auto_configure:
|
||||
env
|
||||
rm -rf bld
|
||||
mkdir -p bld
|
||||
cd bld && \
|
||||
cmake .. -G Ninja \
|
||||
-DCMAKE_INSTALL_PREFIX=/opt/ripple \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-Dstatic=true \
|
||||
-Dlocal_protobuf=ON \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON
|
||||
|
||||
override_dh_auto_build:
|
||||
cd bld && \
|
||||
cmake --build . --parallel -- -v
|
||||
|
||||
override_dh_auto_install:
|
||||
cd bld && DESTDIR=../debian/tmp cmake --build . --target install -- -v
|
||||
rm -rf bld_vl
|
||||
mkdir -p bld_vl
|
||||
cd bld_vl && \
|
||||
cmake ../../validator-keys-tool -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH=${PWD}/debian/tmp/opt/ripple/ \
|
||||
-Dstatic=true \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON && \
|
||||
cmake --build . --parallel -- -v
|
||||
install -D bld_vl/validator-keys debian/tmp/opt/ripple/bin/validator-keys
|
||||
install -D Builds/containers/shared/update-rippled.sh debian/tmp/opt/ripple/bin/update-rippled.sh
|
||||
install -D Builds/containers/shared/update-rippled-cron debian/tmp/opt/ripple/etc/update-rippled-cron
|
||||
install -D Builds/containers/shared/rippled-logrotate debian/tmp/etc/logrotate.d/rippled
|
||||
rm -rf bld
|
||||
rm -rf bld_vl
|
||||
1
Builds/containers/packaging/dpkg/debian/source/format
Normal file
1
Builds/containers/packaging/dpkg/debian/source/format
Normal file
@@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
||||
@@ -0,0 +1,2 @@
|
||||
#abort-on-upstream-changes
|
||||
#unapply-patches
|
||||
1
Builds/containers/packaging/rpm/50-rippled.preset
Normal file
1
Builds/containers/packaging/rpm/50-rippled.preset
Normal file
@@ -0,0 +1 @@
|
||||
enable rippled.service
|
||||
73
Builds/containers/packaging/rpm/build_rpm.sh
Executable file
73
Builds/containers/packaging/rpm/build_rpm.sh
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
source update_sources.sh
|
||||
|
||||
# Build the rpm
|
||||
|
||||
IFS='-' read -r RIPPLED_RPM_VERSION RELEASE <<< "$RIPPLED_VERSION"
|
||||
export RIPPLED_RPM_VERSION
|
||||
|
||||
RPM_RELEASE=${RPM_RELEASE-1}
|
||||
|
||||
# post-release version
|
||||
if [ "hf" = "$(echo "$RELEASE" | cut -c -2)" ]; then
|
||||
RPM_RELEASE="${RPM_RELEASE}.${RELEASE}"
|
||||
# pre-release version (-b or -rc)
|
||||
elif [[ $RELEASE ]]; then
|
||||
RPM_RELEASE="0.${RPM_RELEASE}.${RELEASE}"
|
||||
fi
|
||||
|
||||
export RPM_RELEASE
|
||||
|
||||
if [[ $RPM_PATCH ]]; then
|
||||
RPM_PATCH=".${RPM_PATCH}"
|
||||
export RPM_PATCH
|
||||
fi
|
||||
|
||||
cd rippled
|
||||
if [[ -n $(git status --porcelain) ]]; then
|
||||
git status
|
||||
error "Unstaged changes in this repo - please commit first"
|
||||
fi
|
||||
git archive --format tar.gz --prefix rippled/ -o ../rpmbuild/SOURCES/rippled.tar.gz HEAD
|
||||
cd ..
|
||||
tar -zc --exclude-vcs -f ./rpmbuild/SOURCES/validator-keys.tar.gz validator-keys-tool/
|
||||
|
||||
source /opt/rh/devtoolset-7/enable
|
||||
|
||||
rpmbuild --define "_topdir ${PWD}/rpmbuild" -ba rippled.spec
|
||||
rc=$?; if [[ $rc != 0 ]]; then
|
||||
error "error building rpm"
|
||||
fi
|
||||
|
||||
# Make a tar of the rpm and source rpm
|
||||
RPM_VERSION_RELEASE=$(rpm -qp --qf='%{NAME}-%{VERSION}-%{RELEASE}' ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm)
|
||||
tar_file=$RPM_VERSION_RELEASE.tar.gz
|
||||
|
||||
cp ./rpmbuild/RPMS/x86_64/* ${PKG_OUTDIR}
|
||||
cp ./rpmbuild/SRPMS/* ${PKG_OUTDIR}
|
||||
|
||||
RPM_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm 2>/dev/null)
|
||||
DBG_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-debuginfo*.rpm 2>/dev/null)
|
||||
DEV_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/RPMS/x86_64/rippled-devel*.rpm 2>/dev/null)
|
||||
SRC_MD5SUM=$(rpm -q --queryformat '%{SIGMD5}\n' -p ./rpmbuild/SRPMS/*.rpm 2>/dev/null)
|
||||
|
||||
RPM_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-[0-9]*.rpm | awk '{ print $1}')"
|
||||
DBG_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-debuginfo*.rpm | awk '{ print $1}')"
|
||||
DEV_SHA256="$(sha256sum ./rpmbuild/RPMS/x86_64/rippled-devel*.rpm | awk '{ print $1}')"
|
||||
SRC_SHA256="$(sha256sum ./rpmbuild/SRPMS/*.rpm | awk '{ print $1}')"
|
||||
|
||||
echo "rpm_md5sum=$RPM_MD5SUM" > ${PKG_OUTDIR}/build_vars
|
||||
echo "dbg_md5sum=$DBG_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dev_md5sum=$DEV_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "src_md5sum=$SRC_MD5SUM" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rpm_sha256=$RPM_SHA256" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dbg_sha256=$DBG_SHA256" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "dev_sha256=$DEV_SHA256" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "src_sha256=$SRC_SHA256" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rippled_version=$RIPPLED_VERSION" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rpm_version=$RIPPLED_RPM_VERSION" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rpm_file_name=$tar_file" >> ${PKG_OUTDIR}/build_vars
|
||||
echo "rpm_version_release=$RPM_VERSION_RELEASE" >> ${PKG_OUTDIR}/build_vars
|
||||
|
||||
120
Builds/containers/packaging/rpm/rippled.spec
Normal file
120
Builds/containers/packaging/rpm/rippled.spec
Normal file
@@ -0,0 +1,120 @@
|
||||
%define rippled_version %(echo $RIPPLED_RPM_VERSION)
|
||||
%define rpm_release %(echo $RPM_RELEASE)
|
||||
%define rpm_patch %(echo $RPM_PATCH)
|
||||
%define _prefix /opt/ripple
|
||||
Name: rippled
|
||||
# Dashes in Version extensions must be converted to underscores
|
||||
Version: %{rippled_version}
|
||||
Release: %{rpm_release}%{?dist}%{rpm_patch}
|
||||
Summary: rippled daemon
|
||||
|
||||
License: MIT
|
||||
URL: http://ripple.com/
|
||||
Source0: rippled.tar.gz
|
||||
Source1: validator-keys.tar.gz
|
||||
|
||||
BuildRequires: protobuf-static openssl-static cmake zlib-static ninja-build
|
||||
|
||||
%description
|
||||
rippled
|
||||
|
||||
%package devel
|
||||
Summary: Files for development of applications using xrpl core library
|
||||
Group: Development/Libraries
|
||||
Requires: openssl-static, zlib-static
|
||||
|
||||
%description devel
|
||||
core library for development of standalone applications that sign transactions.
|
||||
|
||||
%prep
|
||||
%setup -c -n rippled -a 1
|
||||
|
||||
%build
|
||||
cd rippled
|
||||
mkdir -p bld.release
|
||||
cd bld.release
|
||||
cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_BUILD_TYPE=Release -Dstatic=true -DCMAKE_VERBOSE_MAKEFILE=ON -Dlocal_protobuf=ON
|
||||
# build VK
|
||||
cd ../../validator-keys-tool
|
||||
mkdir -p bld.release
|
||||
cd bld.release
|
||||
# Install a copy of the rippled artifacts into a local VK build dir so that it
|
||||
# can use them to build against (VK needs xrpl_core lib to build). We install
|
||||
# into a local build dir instead of buildroot because we want VK to have
|
||||
# relative paths embedded in debug info, otherwise check-buildroot (rpmbuild)
|
||||
# will complain
|
||||
mkdir xrpl_dir
|
||||
DESTDIR="%{_builddir}/validator-keys-tool/bld.release/xrpl_dir" cmake --build ../../rippled/bld.release --target install -- -v
|
||||
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%{_builddir}/validator-keys-tool/bld.release/xrpl_dir/opt/ripple -Dstatic=true -DCMAKE_VERBOSE_MAKEFILE=ON
|
||||
cmake --build . --parallel -- -v
|
||||
|
||||
%pre
|
||||
test -e /etc/pki/tls || { mkdir -p /etc/pki; ln -s /usr/lib/ssl /etc/pki/tls; }
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
DESTDIR=$RPM_BUILD_ROOT cmake --build rippled/bld.release --target install -- -v
|
||||
install -d ${RPM_BUILD_ROOT}/etc/opt/ripple
|
||||
install -d ${RPM_BUILD_ROOT}/usr/local/bin
|
||||
ln -s %{_prefix}/etc/rippled.cfg ${RPM_BUILD_ROOT}/etc/opt/ripple/rippled.cfg
|
||||
ln -s %{_prefix}/etc/validators.txt ${RPM_BUILD_ROOT}/etc/opt/ripple/validators.txt
|
||||
ln -s %{_prefix}/bin/rippled ${RPM_BUILD_ROOT}/usr/local/bin/rippled
|
||||
install -D validator-keys-tool/bld.release/validator-keys ${RPM_BUILD_ROOT}%{_bindir}/validator-keys
|
||||
install -D ./rippled/Builds/containers/shared/rippled.service ${RPM_BUILD_ROOT}/usr/lib/systemd/system/rippled.service
|
||||
install -D ./rippled/Builds/containers/packaging/rpm/50-rippled.preset ${RPM_BUILD_ROOT}/usr/lib/systemd/system-preset/50-rippled.preset
|
||||
install -D ./rippled/Builds/containers/shared/update-rippled.sh ${RPM_BUILD_ROOT}%{_bindir}/update-rippled.sh
|
||||
install -D ./rippled/Builds/containers/shared/update-rippled-cron ${RPM_BUILD_ROOT}%{_prefix}/etc/update-rippled-cron
|
||||
install -D ./rippled/Builds/containers/shared/rippled-logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/rippled
|
||||
install -d $RPM_BUILD_ROOT/var/log/rippled
|
||||
install -d $RPM_BUILD_ROOT/var/lib/rippled
|
||||
|
||||
%post
|
||||
USER_NAME=rippled
|
||||
GROUP_NAME=rippled
|
||||
|
||||
getent passwd $USER_NAME &>/dev/null || useradd $USER_NAME
|
||||
getent group $GROUP_NAME &>/dev/null || groupadd $GROUP_NAME
|
||||
|
||||
chown -R $USER_NAME:$GROUP_NAME /var/log/rippled/
|
||||
chown -R $USER_NAME:$GROUP_NAME /var/lib/rippled/
|
||||
chown -R $USER_NAME:$GROUP_NAME %{_prefix}/
|
||||
|
||||
chmod 755 /var/log/rippled/
|
||||
chmod 755 /var/lib/rippled/
|
||||
|
||||
chmod 644 %{_prefix}/etc/update-rippled-cron
|
||||
chmod 644 /etc/logrotate.d/rippled
|
||||
chown -R root:$GROUP_NAME %{_prefix}/etc/update-rippled-cron
|
||||
|
||||
%files
|
||||
%doc rippled/README.md rippled/LICENSE
|
||||
%{_bindir}/rippled
|
||||
/usr/local/bin/rippled
|
||||
%{_bindir}/update-rippled.sh
|
||||
%{_prefix}/etc/update-rippled-cron
|
||||
%{_bindir}/validator-keys
|
||||
%config(noreplace) %{_prefix}/etc/rippled.cfg
|
||||
%config(noreplace) /etc/opt/ripple/rippled.cfg
|
||||
%config(noreplace) %{_prefix}/etc/validators.txt
|
||||
%config(noreplace) /etc/opt/ripple/validators.txt
|
||||
%config(noreplace) /etc/logrotate.d/rippled
|
||||
%config(noreplace) /usr/lib/systemd/system/rippled.service
|
||||
%config(noreplace) /usr/lib/systemd/system-preset/50-rippled.preset
|
||||
%dir /var/log/rippled/
|
||||
%dir /var/lib/rippled/
|
||||
|
||||
%files devel
|
||||
%{_prefix}/include
|
||||
%{_prefix}/lib/*.a
|
||||
%{_prefix}/lib/cmake/ripple
|
||||
|
||||
%changelog
|
||||
* Wed May 15 2019 Mike Ellery <mellery451@gmail.com>
|
||||
- Make validator-keys use local rippled build for core lib
|
||||
|
||||
* Wed Aug 01 2018 Mike Ellery <mellery451@gmail.com>
|
||||
- add devel package for signing library
|
||||
|
||||
* Thu Jun 02 2016 Brandon Wilson <bwilson@ripple.com>
|
||||
- Install validators.txt
|
||||
|
||||
78
Builds/containers/shared/build_deps.sh
Executable file
78
Builds/containers/shared/build_deps.sh
Executable file
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
function build_boost()
|
||||
{
|
||||
local boost_ver=$1
|
||||
local do_link=$2
|
||||
local boost_path=$(echo "${boost_ver}" | sed -e 's!\.!_!g')
|
||||
cd /tmp
|
||||
wget https://dl.bintray.com/boostorg/release/${boost_ver}/source/boost_${boost_path}.tar.bz2
|
||||
mkdir -p /opt/local
|
||||
cd /opt/local
|
||||
tar xf /tmp/boost_${boost_path}.tar.bz2
|
||||
if [ "$do_link" = true ] ; then
|
||||
ln -s ./boost_${boost_path} boost
|
||||
fi
|
||||
cd boost_${boost_path}
|
||||
./bootstrap.sh
|
||||
./b2 -j$(nproc)
|
||||
./b2 stage
|
||||
cd ..
|
||||
rm -f /tmp/boost_${boost_path}.tar.bz2
|
||||
}
|
||||
|
||||
build_boost "1.70.0" true
|
||||
|
||||
# installed in opt, so won't be used
|
||||
# unless specified by OPENSSL_ROOT_DIR
|
||||
cd /tmp
|
||||
OPENSSL_VER=1.1.1
|
||||
wget https://www.openssl.org/source/openssl-${OPENSSL_VER}.tar.gz
|
||||
tar xf openssl-${OPENSSL_VER}.tar.gz
|
||||
cd openssl-${OPENSSL_VER}
|
||||
# NOTE: add -g to the end of the following line if we want debug symbols for openssl
|
||||
SSLDIR=$(openssl version -d | cut -d: -f2 | tr -d [:space:]\")
|
||||
./config -fPIC --prefix=/opt/local/openssl --openssldir=${SSLDIR} zlib shared
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
rm -f openssl-${OPENSSL_VER}.tar.gz
|
||||
rm -rf openssl-${OPENSSL_VER}
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/local/openssl/lib /opt/local/openssl/bin/openssl version -a
|
||||
|
||||
if [ "${CI_USE}" = true ] ; then
|
||||
cd /tmp
|
||||
wget https://github.com/doxygen/doxygen/archive/Release_1_8_14.tar.gz
|
||||
tar xf Release_1_8_14.tar.gz
|
||||
cd doxygen-Release_1_8_14
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "Unix Makefiles" ..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ../..
|
||||
rm -f Release_1_8_14.tar.gz
|
||||
rm -rf doxygen-Release_1_8_14
|
||||
|
||||
mkdir -p /opt/plantuml
|
||||
wget -O /opt/plantuml/plantuml.jar https://downloads.sourceforge.net/project/plantuml/plantuml.jar
|
||||
|
||||
cd /tmp
|
||||
wget https://github.com/linux-test-project/lcov/releases/download/v1.13/lcov-1.13.tar.gz
|
||||
tar xfz lcov-1.13.tar.gz
|
||||
cd lcov-1.13
|
||||
make install PREFIX=/usr/local
|
||||
cd ..
|
||||
rm -r lcov-1.13 lcov-1.13.tar.gz
|
||||
|
||||
pip install requests
|
||||
pip install https://github.com/codecov/codecov-python/archive/master.zip
|
||||
|
||||
set +e
|
||||
mkdir -p /opt/local/nih_cache
|
||||
mkdir -p /opt/jenkins
|
||||
set -e
|
||||
fi
|
||||
|
||||
|
||||
16
Builds/containers/shared/install_cmake.sh
Executable file
16
Builds/containers/shared/install_cmake.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
cd /tmp
|
||||
CM_INSTALLER=cmake-3.13.2-Linux-x86_64.sh
|
||||
CM_VER_DIR=/opt/local/cmake-3.13
|
||||
wget https://cmake.org/files/v3.13/$CM_INSTALLER
|
||||
chmod a+x $CM_INSTALLER
|
||||
mkdir -p $CM_VER_DIR
|
||||
ln -s $CM_VER_DIR /opt/local/cmake
|
||||
./$CM_INSTALLER --prefix=$CM_VER_DIR --exclude-subdir
|
||||
rm -f /tmp/$CM_INSTALLER
|
||||
|
||||
export PATH="/opt/local/cmake/bin:${PATH}"
|
||||
|
||||
|
||||
15
Builds/containers/shared/rippled-logrotate
Normal file
15
Builds/containers/shared/rippled-logrotate
Normal file
@@ -0,0 +1,15 @@
|
||||
/var/log/rippled/*.log {
|
||||
daily
|
||||
minsize 200M
|
||||
rotate 7
|
||||
nocreate
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
compresscmd /usr/bin/nice
|
||||
compressoptions -n19 ionice -c3 gzip
|
||||
compressext .gz
|
||||
postrotate
|
||||
/opt/ripple/bin/rippled --conf /opt/ripple/etc/rippled.cfg logrotate
|
||||
endscript
|
||||
}
|
||||
15
Builds/containers/shared/rippled.service
Normal file
15
Builds/containers/shared/rippled.service
Normal file
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Ripple Daemon
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/opt/ripple/bin/rippled --net --silent --conf /etc/opt/ripple/rippled.cfg
|
||||
# Default KillSignal can be used if/when rippled handles SIGTERM
|
||||
KillSignal=SIGINT
|
||||
Restart=no
|
||||
User=rippled
|
||||
Group=rippled
|
||||
LimitNOFILE=65536
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
10
Builds/containers/shared/update-rippled-cron
Normal file
10
Builds/containers/shared/update-rippled-cron
Normal file
@@ -0,0 +1,10 @@
|
||||
# For automatic updates, symlink this file to /etc/cron.d/
|
||||
# Do not remove the newline at the end of this cron script
|
||||
|
||||
# bash required for use of RANDOM below.
|
||||
SHELL=/bin/bash
|
||||
PATH=/sbin;/bin;/usr/sbin;/usr/bin
|
||||
|
||||
# invoke check/update script with random delay up to 59 mins
|
||||
0 * * * * root sleep $((RANDOM*3540/32768)) && /opt/ripple/bin/update-rippled.sh
|
||||
|
||||
59
Builds/containers/shared/update-rippled.sh
Executable file
59
Builds/containers/shared/update-rippled.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# auto-update script for rippled daemon
|
||||
|
||||
LOCKDIR=/tmp/rippleupdate.lock
|
||||
UPDATELOG=/var/log/rippled/update.log
|
||||
|
||||
function cleanup {
|
||||
# If this directory isn't removed, future updates will fail.
|
||||
rmdir $LOCKDIR
|
||||
}
|
||||
|
||||
# Use mkdir to check if process is already running. mkdir is atomic, as against file create.
|
||||
if ! mkdir $LOCKDIR 2>/dev/null; then
|
||||
echo $(date -u) "lockdir exists - won't proceed." >> $UPDATELOG
|
||||
exit 1
|
||||
fi
|
||||
trap cleanup EXIT
|
||||
|
||||
source /etc/os-release
|
||||
can_update=false
|
||||
|
||||
if [[ "$ID" == "ubuntu" || "$ID" == "debian" ]] ; then
|
||||
# Silent update
|
||||
apt-get update -qq
|
||||
|
||||
# The next line is an "awk"ward way to check if the package needs to be updated.
|
||||
RIPPLE=$(apt-get install -s --only-upgrade rippled | awk '/^Inst/ { print $2 }')
|
||||
test "$RIPPLE" == "rippled" && can_update=true
|
||||
|
||||
function apply_update {
|
||||
apt-get install rippled -qq
|
||||
}
|
||||
elif [[ "$ID" == "fedora" || "$ID" == "centos" || "$ID" == "rhel" || "$ID" == "scientific" ]] ; then
|
||||
RIPPLE_REPO=${RIPPLE_REPO-stable}
|
||||
yum --disablerepo=* --enablerepo=ripple-$RIPPLE_REPO clean expire-cache
|
||||
|
||||
yum check-update -q --enablerepo=ripple-$RIPPLE_REPO rippled || can_update=true
|
||||
|
||||
function apply_update {
|
||||
yum update -y --enablerepo=ripple-$RIPPLE_REPO rippled
|
||||
}
|
||||
else
|
||||
echo "unrecognized distro!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Do the actual update and restart the service after reloading systemctl daemon.
|
||||
if [ "$can_update" = true ] ; then
|
||||
exec 3>&1 1>>${UPDATELOG} 2>&1
|
||||
set -e
|
||||
apply_update
|
||||
systemctl daemon-reload
|
||||
systemctl restart rippled.service
|
||||
echo $(date -u) "rippled daemon updated."
|
||||
else
|
||||
echo $(date -u) "no updates available" >> $UPDATELOG
|
||||
fi
|
||||
|
||||
27
Builds/containers/shared/update_sources.sh
Executable file
27
Builds/containers/shared/update_sources.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function error {
|
||||
echo $1
|
||||
exit 1
|
||||
}
|
||||
|
||||
cd /opt/rippled_bld/pkg/rippled
|
||||
export RIPPLED_VERSION=$(egrep -i -o "\b(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9a-z\-]+(\.[0-9a-z\-]+)*)?(\+[0-9a-z\-]+(\.[0-9a-z\-]+)*)?\b" src/ripple/protocol/impl/BuildInfo.cpp)
|
||||
|
||||
cd ..
|
||||
git clone https://github.com/ripple/validator-keys-tool.git
|
||||
cd validator-keys-tool
|
||||
git checkout origin/master
|
||||
git submodule update --init --recursive
|
||||
cd ..
|
||||
|
||||
: ${PKG_OUTDIR:=/opt/rippled_bld/pkg/out}
|
||||
export PKG_OUTDIR
|
||||
if [ ! -d ${PKG_OUTDIR} ]; then
|
||||
error "${PKG_OUTDIR} is not mounted"
|
||||
fi
|
||||
|
||||
if [ -x ${OPENSSL_ROOT}/bin/openssl ]; then
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${OPENSSL_ROOT}/lib ${OPENSSL_ROOT}/bin/openssl version -a
|
||||
fi
|
||||
|
||||
32
Builds/containers/ubuntu-builder/Dockerfile
Normal file
32
Builds/containers/ubuntu-builder/Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
ARG DIST_TAG=16.04
|
||||
ARG GIT_COMMIT=unknown
|
||||
|
||||
FROM ubuntu:$DIST_TAG
|
||||
LABEL git-commit=$GIT_COMMIT
|
||||
|
||||
# install/setup prerequisites:
|
||||
COPY ubuntu-builder/ubuntu_setup.sh /tmp/
|
||||
COPY shared/build_deps.sh /tmp/
|
||||
COPY shared/install_cmake.sh /tmp/
|
||||
RUN chmod +x /tmp/ubuntu_setup.sh && \
|
||||
chmod +x /tmp/build_deps.sh && \
|
||||
chmod +x /tmp/install_cmake.sh
|
||||
RUN /tmp/ubuntu_setup.sh
|
||||
RUN /tmp/install_cmake.sh
|
||||
ENV PATH="/opt/local/cmake/bin:$PATH"
|
||||
RUN /tmp/build_deps.sh
|
||||
ENV PLANTUML_JAR="/opt/plantuml/plantuml.jar"
|
||||
ENV BOOST_ROOT="/opt/local/boost"
|
||||
ENV OPENSSL_ROOT="/opt/local/openssl"
|
||||
|
||||
# prep files for package building
|
||||
RUN mkdir -m 777 -p /opt/rippled_bld/pkg
|
||||
WORKDIR /opt/rippled_bld/pkg
|
||||
|
||||
COPY packaging/dpkg/debian /opt/rippled_bld/pkg/debian/
|
||||
COPY shared/update_sources.sh ./
|
||||
COPY shared/rippled.service /opt/rippled_bld/pkg/debian/
|
||||
|
||||
COPY packaging/dpkg/build_dpkg.sh ./
|
||||
CMD ./build_dpkg.sh
|
||||
|
||||
120
Builds/containers/ubuntu-builder/ubuntu_setup.sh
Executable file
120
Builds/containers/ubuntu-builder/ubuntu_setup.sh
Executable file
@@ -0,0 +1,120 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
source /etc/os-release
|
||||
|
||||
if [[ ${VERSION_ID} =~ ^18\. || ${VERSION_ID} =~ ^16\. ]] ; then
|
||||
echo "setup for ${PRETTY_NAME}"
|
||||
else
|
||||
echo "${VERSION} not supported"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
echo "Acquire::Retries 3;" > /etc/apt/apt.conf.d/80-retries
|
||||
echo "Acquire::http::Pipeline-Depth 0;" >> /etc/apt/apt.conf.d/80-retries
|
||||
echo "Acquire::http::No-Cache true;" >> /etc/apt/apt.conf.d/80-retries
|
||||
echo "Acquire::BrokenProxy true;" >> /etc/apt/apt.conf.d/80-retries
|
||||
apt-get update -o Acquire::CompressionTypes::Order::=gz
|
||||
|
||||
apt-get -y update
|
||||
apt-get -y install apt-utils
|
||||
apt-get -y install software-properties-common wget
|
||||
apt-get -y upgrade
|
||||
if [[ ${VERSION_ID} =~ ^18\. ]] ; then
|
||||
apt-add-repository -y multiverse
|
||||
apt-add-repository -y universe
|
||||
elif [[ ${VERSION_ID} =~ ^16\. ]] ; then
|
||||
add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
fi
|
||||
apt-get -y clean
|
||||
apt-get -y update
|
||||
|
||||
apt-get -y --fix-missing install \
|
||||
make cmake ninja-build ccache \
|
||||
protobuf-compiler libprotobuf-dev openssl libssl-dev \
|
||||
liblzma-dev libbz2-dev zlib1g-dev \
|
||||
libjemalloc-dev \
|
||||
python-pip \
|
||||
gdb gdbserver \
|
||||
libstdc++6 \
|
||||
flex bison \
|
||||
libicu-dev texinfo \
|
||||
java-common javacc \
|
||||
gcc-7 g++-7 \
|
||||
gcc-8 g++-8 \
|
||||
dpkg-dev debhelper devscripts fakeroot \
|
||||
debmake git-buildpackage dh-make gitpkg debsums gnupg \
|
||||
dh-buildinfo dh-make dh-systemd
|
||||
|
||||
update-alternatives --install \
|
||||
/usr/bin/gcc gcc /usr/bin/gcc-7 40 \
|
||||
--slave /usr/bin/g++ g++ /usr/bin/g++-7 \
|
||||
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-7 \
|
||||
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-7 \
|
||||
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-7 \
|
||||
--slave /usr/bin/gcov gcov /usr/bin/gcov-7 \
|
||||
--slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-dump-7 \
|
||||
--slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-tool-7
|
||||
update-alternatives --install \
|
||||
/usr/bin/gcc gcc /usr/bin/gcc-8 20 \
|
||||
--slave /usr/bin/g++ g++ /usr/bin/g++-8 \
|
||||
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-8 \
|
||||
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-8 \
|
||||
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-8 \
|
||||
--slave /usr/bin/gcov gcov /usr/bin/gcov-8 \
|
||||
--slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-dump-8 \
|
||||
--slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-tool-8
|
||||
update-alternatives --auto gcc
|
||||
|
||||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-7 40
|
||||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-8 20
|
||||
update-alternatives --auto cpp
|
||||
|
||||
if [[ ${VERSION_ID} =~ ^18\. ]] ; then
|
||||
apt-get -y install binutils
|
||||
elif [[ ${VERSION_ID} =~ ^16\. ]] ; then
|
||||
apt-get -y install python-software-properties binutils-gold
|
||||
fi
|
||||
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
|
||||
if [[ ${VERSION_ID} =~ ^18\. ]] ; then
|
||||
cat << EOF > /etc/apt/sources.list.d/llvm.list
|
||||
deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main
|
||||
deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic main
|
||||
deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-6.0 main
|
||||
deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-6.0 main
|
||||
deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main
|
||||
deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main
|
||||
EOF
|
||||
elif [[ ${VERSION_ID} =~ ^16\. ]] ; then
|
||||
cat << EOF > /etc/apt/sources.list.d/llvm.list
|
||||
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial main
|
||||
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial main
|
||||
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main
|
||||
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main
|
||||
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main
|
||||
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main
|
||||
EOF
|
||||
fi
|
||||
apt-get -y update
|
||||
|
||||
apt-get -y install \
|
||||
clang-7 libclang-common-7-dev libclang-7-dev libllvm7 lldb-7 llvm-7 \
|
||||
llvm-7-dev llvm-7-runtime clang-format-7 python-clang-7 python-lldb-7 \
|
||||
liblldb-7-dev lld-7 libfuzzer-7-dev libc++-7-dev
|
||||
update-alternatives --install \
|
||||
/usr/bin/clang clang /usr/bin/clang-7 40 \
|
||||
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-7 \
|
||||
--slave /usr/bin/llvm-profdata llvm-profdata /usr/bin/llvm-profdata-7 \
|
||||
--slave /usr/bin/asan-symbolize asan-symbolize /usr/bin/asan_symbolize-7 \
|
||||
--slave /usr/bin/clang-format clang-format /usr/bin/clang-format-7 \
|
||||
--slave /usr/bin/lldb lldb /usr/bin/lldb-7 \
|
||||
--slave /usr/bin/lldb-server lldb-server /usr/bin/lldb-server-7 \
|
||||
--slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-7 \
|
||||
--slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-7 \
|
||||
--slave /usr/bin/llvm-nm llvm-nm /usr/bin/llvm-nm-7
|
||||
update-alternatives --auto clang
|
||||
|
||||
apt-get -y autoremove
|
||||
|
||||
@@ -25,14 +25,14 @@ protobuf will give errors.
|
||||
|
||||
### Build Boost
|
||||
|
||||
Boost 1.67 or later is required. We recommend downloading and compiling boost
|
||||
Boost 1.70 or later is required. We recommend downloading and compiling boost
|
||||
with the following process: After changing to the directory where
|
||||
you wish to download and compile boost, run
|
||||
|
||||
```
|
||||
$ wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz
|
||||
$ tar -xzf boost_1_67_0.tar.gz
|
||||
$ cd boost_1_67_0
|
||||
$ wget https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz
|
||||
$ tar -xzf boost_1_70_0.tar.gz
|
||||
$ cd boost_1_70_0
|
||||
$ ./bootstrap.sh
|
||||
$ ./b2 headers
|
||||
$ ./b2 -j<Num Parallel>
|
||||
@@ -81,14 +81,14 @@ git checkout develop
|
||||
If you didn't persistently set the `BOOST_ROOT` environment variable to the
|
||||
directory in which you compiled boost, then you should set it temporarily.
|
||||
|
||||
For example, you built Boost in your home directory `~/boost_1_67_0`, you
|
||||
For example, you built Boost in your home directory `~/boost_1_70_0`, you
|
||||
would do for any shell in which you want to build:
|
||||
|
||||
```
|
||||
export BOOST_ROOT=~/boost_1_67_0
|
||||
export BOOST_ROOT=~/boost_1_70_0
|
||||
```
|
||||
|
||||
Alternatively, you can add `DBOOST_ROOT=~/boost_1_67_0` to the command line when
|
||||
Alternatively, you can add `DBOOST_ROOT=~/boost_1_70_0` to the command line when
|
||||
invoking `cmake`.
|
||||
|
||||
### Generate and Build
|
||||
|
||||
@@ -60,17 +60,17 @@ brew install git cmake pkg-config protobuf openssl ninja
|
||||
|
||||
### Build Boost
|
||||
|
||||
Boost 1.67 or later is required.
|
||||
Boost 1.70 or later is required.
|
||||
|
||||
We want to compile boost with clang/libc++
|
||||
|
||||
Download [a release](https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.bz2)
|
||||
Download [a release](https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2)
|
||||
|
||||
Extract it to a folder, making note of where, open a terminal, then:
|
||||
|
||||
```
|
||||
./bootstrap.sh
|
||||
./b2 cxxflags="-std=c++14"
|
||||
./b2 cxxflags="-std=c++14" visibility=global
|
||||
```
|
||||
|
||||
Create an environment variable `BOOST_ROOT` in one of your `rc` files, pointing
|
||||
@@ -120,11 +120,11 @@ If you didn't persistently set the `BOOST_ROOT` environment variable to the
|
||||
root of the extracted directory above, then you should set it temporarily.
|
||||
|
||||
For example, assuming your username were `Abigail` and you extracted Boost
|
||||
1.67.0 in `/Users/Abigail/Downloads/boost_1_67_0`, you would do for any
|
||||
1.70.0 in `/Users/Abigail/Downloads/boost_1_70_0`, you would do for any
|
||||
shell in which you want to build:
|
||||
|
||||
```
|
||||
export BOOST_ROOT=/Users/Abigail/Downloads/boost_1_67_0
|
||||
export BOOST_ROOT=/Users/Abigail/Downloads/boost_1_70_0
|
||||
```
|
||||
|
||||
### Generate and Build
|
||||
|
||||
1361
CMakeLists.txt
1361
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
330
Jenkinsfile
vendored
330
Jenkinsfile
vendored
@@ -70,8 +70,10 @@ try {
|
||||
|
||||
if (! collab_found) {
|
||||
echo "$CHANGE_AUTHOR is not a collaborator - waiting for manual approval."
|
||||
sendToSlack("A <${env.BUILD_URL}|jenkins job (PR)> is waiting for approval - please review.")
|
||||
|
||||
try {
|
||||
response = httpRequest(
|
||||
httpRequest(
|
||||
timeout: 10,
|
||||
authentication: github_cred,
|
||||
url: getCommentURL(),
|
||||
@@ -106,13 +108,18 @@ try {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UNCOMMENT the following if we want one message for every job...
|
||||
//node('rippled-dev') {
|
||||
// sendToSlack("<${env.BUILD_URL}|Job ${env.BUILD_TAG}> has started.")
|
||||
//}
|
||||
}
|
||||
|
||||
stage ('Parallel Build') {
|
||||
String[][] variants = [
|
||||
['gcc.Release' ,'-Dassert=ON' ,'MANUAL_TESTS=true' ],
|
||||
['gcc.Debug' ,'-Dcoverage=ON' ],
|
||||
['docs' ],
|
||||
['gcc.Debug' ,'-Dcoverage=ON' ,'TARGET=coverage_report', 'SKIP_TESTS=true'],
|
||||
['docs' ,'' ,'TARGET=docs' ],
|
||||
['msvc.Debug' ],
|
||||
['msvc.Debug' ,'' ,'NINJA_BUILD=true' ],
|
||||
['msvc.Debug' ,'-Dunity=OFF' ],
|
||||
@@ -150,8 +157,11 @@ try {
|
||||
|
||||
def compiler = getFirstPart(bldtype)
|
||||
def config = getSecondPart(bldtype)
|
||||
def target = 'install' // currently ignored for windows builds
|
||||
if (compiler == 'docs') {
|
||||
compiler = 'gcc'
|
||||
config = 'Release'
|
||||
target = 'docs'
|
||||
}
|
||||
def cc =
|
||||
(compiler == 'clang') ? '/opt/llvm-5.0.1/bin/clang' : 'gcc'
|
||||
@@ -167,6 +177,7 @@ try {
|
||||
def max_minutes = 25
|
||||
|
||||
def env_vars = [
|
||||
"TARGET=${target}",
|
||||
"BUILD_TYPE=${config}",
|
||||
"COMPILER=${compiler}",
|
||||
"PARALLEL_TESTS=${pt}",
|
||||
@@ -187,9 +198,11 @@ try {
|
||||
echo "COMPILER: ${compiler}"
|
||||
echo "BUILD_TYPE: ${config}"
|
||||
echo "USE_CC: ${ucc}"
|
||||
env_vars.addAll([
|
||||
"NIH_CACHE_ROOT=${cdir}/.nih_c"])
|
||||
if (compiler == 'msvc') {
|
||||
env_vars.addAll([
|
||||
'BOOST_ROOT=c:\\lib\\boost_1_67',
|
||||
'BOOST_ROOT=c:\\lib\\boost_1_70',
|
||||
'PROJECT_NAME=rippled',
|
||||
'MSBUILDDISABLENODEREUSE=1', // this ENV setting is probably redundant since we also pass /nr:false to msbuild
|
||||
'OPENSSL_ROOT=c:\\OpenSSL-Win64'])
|
||||
@@ -206,7 +219,7 @@ try {
|
||||
'LCOV_ROOT=""',
|
||||
'PATH+CMAKE_BIN=/opt/local/cmake',
|
||||
'GDB_ROOT=/opt/local/gdb',
|
||||
'BOOST_ROOT=/opt/local/boost_1_67_0',
|
||||
'BOOST_ROOT=/opt/local/boost_1_70_0',
|
||||
"USE_CCACHE=${ucc}"])
|
||||
}
|
||||
|
||||
@@ -214,109 +227,102 @@ try {
|
||||
env_vars.addAll(extra_env)
|
||||
}
|
||||
|
||||
withCredentials(
|
||||
[string(
|
||||
credentialsId: 'RIPPLED_CODECOV_TOKEN',
|
||||
variable: 'CODECOV_TOKEN')])
|
||||
{
|
||||
withEnv(env_vars) {
|
||||
myStage(bldlabel)
|
||||
try {
|
||||
timeout(
|
||||
time: max_minutes * 2,
|
||||
units: 'MINUTES')
|
||||
{
|
||||
if (compiler == 'msvc') {
|
||||
powershell "Remove-Item -Path \"${bldlabel}.txt\" -Force -ErrorAction Ignore"
|
||||
// we capture stdout to variable because I could
|
||||
// not figure out how to make powershell redirect internally
|
||||
output = powershell (
|
||||
returnStdout: true,
|
||||
script: windowsBuildCmd())
|
||||
// if the powershell command fails (has nonzero exit)
|
||||
// then the command above throws, we don't get our output,
|
||||
// and we never create this output file.
|
||||
// SEE https://issues.jenkins-ci.org/browse/JENKINS-44930
|
||||
// Alternatively, figure out how to reliably redirect
|
||||
// all output above to a file (Start/Stop transcript does not work)
|
||||
writeFile(
|
||||
file: "${bldlabel}.txt",
|
||||
text: output)
|
||||
}
|
||||
else {
|
||||
sh "rm -fv ${bldlabel}.txt"
|
||||
// execute the bld command in a redirecting shell
|
||||
// to capture output
|
||||
sh redhatBuildCmd(bldlabel)
|
||||
}
|
||||
// try to figure out codecov token to use. Look for
|
||||
// MY_CODECOV_TOKEN id first so users can set that
|
||||
// on job scope but then default to RIPPLED_CODECOV_TOKEN
|
||||
// which should be globally scoped
|
||||
def codecov_token = ''
|
||||
try {
|
||||
withCredentials( [string( credentialsId: 'MY_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) {
|
||||
codecov_token = env.CODECOV_TOKEN
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
// this might throw when MY_CODECOV_TOKEN doesn't exist
|
||||
}
|
||||
if (codecov_token == '') {
|
||||
withCredentials( [string( credentialsId: 'RIPPLED_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) {
|
||||
codecov_token = env.CODECOV_TOKEN
|
||||
}
|
||||
}
|
||||
env_vars.addAll(["CODECOV_TOKEN=${codecov_token}"])
|
||||
|
||||
withEnv(env_vars) {
|
||||
myStage(bldlabel)
|
||||
def thrown = '';
|
||||
try {
|
||||
timeout(
|
||||
time: max_minutes * 2,
|
||||
units: 'MINUTES')
|
||||
{
|
||||
if (compiler == 'msvc') {
|
||||
powershell "Remove-Item -Path \"${bldlabel}.txt\" -Force -ErrorAction Ignore"
|
||||
// we capture stdout to variable because I could
|
||||
// not figure out how to make powershell redirect internally
|
||||
output = powershell (
|
||||
returnStdout: true,
|
||||
script: windowsBuildCmd())
|
||||
// if the powershell command fails (has nonzero exit)
|
||||
// then the command above throws, we don't get our output,
|
||||
// and we never create this output file.
|
||||
// SEE https://issues.jenkins-ci.org/browse/JENKINS-44930
|
||||
// Alternatively, figure out how to reliably redirect
|
||||
// all output above to a file (Start/Stop transcript does not work)
|
||||
writeFile(
|
||||
file: "${bldlabel}.txt",
|
||||
text: output)
|
||||
}
|
||||
else {
|
||||
sh "rm -fv ${bldlabel}.txt"
|
||||
// execute the bld command in a redirecting shell
|
||||
// to capture output
|
||||
sh redhatBuildCmd(bldlabel)
|
||||
}
|
||||
}
|
||||
finally {
|
||||
if (bldtype == 'docs') {
|
||||
publishHTML(
|
||||
allowMissing: true,
|
||||
alwaysLinkToLastBuild: false,
|
||||
keepAll: true,
|
||||
reportName: 'Doxygen',
|
||||
reportDir: 'build/docs/html_doc',
|
||||
reportFiles: 'index.html')
|
||||
}
|
||||
def envs = ''
|
||||
for (int j = 0; j < extra_env.size(); j++) {
|
||||
envs += ", <br/>" + extra_env[j]
|
||||
}
|
||||
def cmake_txt = cmake_extra
|
||||
if (cmake_txt != '') {
|
||||
cmake_txt = " <br/>" + cmake_txt
|
||||
}
|
||||
def st = reportStatus(bldlabel, bldtype + cmake_txt + envs, env.BUILD_URL)
|
||||
lock('rippled_dev_status') {
|
||||
all_status[bldlabel] = st
|
||||
}
|
||||
} //try-catch-finally
|
||||
} //withEnv
|
||||
} //withCredentials
|
||||
} //node
|
||||
} //builds item
|
||||
} //for variants
|
||||
|
||||
// Also add a single build job for doing the RPM build
|
||||
// on a docker node
|
||||
builds['rpm'] = {
|
||||
node('docker') {
|
||||
def bldlabel = 'rpm'
|
||||
def remote =
|
||||
(git_fork == 'ripple') ? 'origin' : git_fork
|
||||
|
||||
withCredentials(
|
||||
[string(
|
||||
credentialsId: 'RIPPLED_RPM_ROLE_ID',
|
||||
variable: 'ROLE_ID')])
|
||||
{
|
||||
withEnv([
|
||||
'docker_image=artifactory.ops.ripple.com:6555/rippled-rpm-builder:latest',
|
||||
"git_commit=${commit_id}",
|
||||
"git_remote=${remote}",
|
||||
"rpm_release=${env.BUILD_ID}"])
|
||||
{
|
||||
try {
|
||||
sh "rm -fv ${bldlabel}.txt"
|
||||
sh "if [ -d rpm-out ]; then rm -rf rpm-out; fi"
|
||||
sh rpmBuildCmd(bldlabel)
|
||||
}
|
||||
catch(e) {
|
||||
thrown = "${e}"
|
||||
throw e
|
||||
}
|
||||
finally {
|
||||
def st = reportStatus(bldlabel, bldlabel, env.BUILD_URL)
|
||||
if (bldtype == 'docs') {
|
||||
publishHTML(
|
||||
allowMissing: true,
|
||||
alwaysLinkToLastBuild: true,
|
||||
keepAll: true,
|
||||
reportName: 'Doxygen',
|
||||
reportDir: "build/${bldlabel}/html_doc",
|
||||
reportFiles: 'index.html')
|
||||
}
|
||||
if (isCoverage(cmake_extra)) {
|
||||
publishHTML(
|
||||
allowMissing: true,
|
||||
alwaysLinkToLastBuild: false,
|
||||
keepAll: true,
|
||||
reportName: 'Coverage',
|
||||
reportDir: "build/${bldlabel}/coverage",
|
||||
reportFiles: 'index.html')
|
||||
}
|
||||
def envs = ''
|
||||
for (int j = 0; j < extra_env.size(); j++) {
|
||||
envs += ", <br/>" + extra_env[j]
|
||||
}
|
||||
def cmake_txt = cmake_extra
|
||||
if (cmake_txt != '') {
|
||||
cmake_txt = " <br/>" + cmake_txt
|
||||
}
|
||||
def st = reportStatus(bldlabel, bldtype + cmake_txt + envs, env.BUILD_URL, thrown)
|
||||
lock('rippled_dev_status') {
|
||||
all_status[bldlabel] = st
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: 'rpm-out/*.rpm',
|
||||
allowEmptyArchive: true)
|
||||
}
|
||||
if (thrown == '') {
|
||||
assert st[0] : "Unit Test Failures"
|
||||
}
|
||||
} //try-catch-finally
|
||||
} //withEnv
|
||||
} //withCredentials
|
||||
} //node
|
||||
}
|
||||
} //node
|
||||
} //builds item
|
||||
} //for variants
|
||||
|
||||
// this actually executes all the builds we just defined
|
||||
// above, in parallel as slaves are available
|
||||
@@ -486,9 +492,9 @@ def getFailures(text, label) {
|
||||
text == '' ?
|
||||
manager.getLogMatcher(/\[${label}\].+?(\d+) test[s]? total, (\d+) (failure(s?))/) :
|
||||
text =~ /(\d+) test[s]? total, (\d+) (failure(s?))/
|
||||
// if we didn't match, then return 1 since something is
|
||||
// if we didn't match, then return -1 since something is
|
||||
// probably wrong, e.g. maybe the build failed...
|
||||
matcher ? matcher[0][2] as Integer : 1i
|
||||
matcher ? matcher[0][2] as Integer : -1i
|
||||
}
|
||||
|
||||
@NonCPS
|
||||
@@ -542,10 +548,34 @@ def getSecondPart(bld) {
|
||||
// functions in groovy....
|
||||
@NonCPS
|
||||
def upDir(path) {
|
||||
def matcher = path =~ /^(.+)\/(.+?)/
|
||||
def matcher = path =~ /^(.+)[\/\\](.+?)/
|
||||
matcher ? matcher[0][1] : path
|
||||
}
|
||||
|
||||
def sendToSlack(message) {
|
||||
try {
|
||||
withCredentials( [string( credentialsId: 'RIPPLED_SLACK_INCOMING_URL', variable: 'SLACK_URL')]) {
|
||||
// I was unable to make httpRequest method work with the
|
||||
// formdata required by slack API, so resorting
|
||||
// to curl commands...
|
||||
sh '''\
|
||||
CONTENT=$(tr -d '[\n]' <<JSON
|
||||
payload={
|
||||
"channel": "#cpp-notifications",
|
||||
"username": "JenkinsCI",
|
||||
"text": "''' + message + '''",
|
||||
"icon_emoji": ":jenkins:"}
|
||||
JSON
|
||||
)
|
||||
curl ${SLACK_URL} --data-urlencode "${CONTENT}"
|
||||
'''
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
echo "had a problem posting to slack: ${e}"
|
||||
}
|
||||
}
|
||||
|
||||
// the shell command used for building on redhat
|
||||
def redhatBuildCmd(bldlabel) {
|
||||
'''\
|
||||
@@ -560,7 +590,7 @@ ccache -s
|
||||
'''
|
||||
}
|
||||
|
||||
// the powershell command used for building an RPM
|
||||
// the powershell command used for building
|
||||
def windowsBuildCmd() {
|
||||
'''
|
||||
# Enable streams 3-6
|
||||
@@ -621,91 +651,11 @@ finally {
|
||||
'''
|
||||
}
|
||||
|
||||
// the shell command used for building an RPM
|
||||
def rpmBuildCmd(bldlabel) {
|
||||
'''\
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
log_file=''' + "${bldlabel}.txt" + '''
|
||||
exec 3>&1 1>>${log_file} 2>&1
|
||||
|
||||
# Vault Steps
|
||||
SECRET_ID=$(cat /.vault/rippled-build-role/secret-id)
|
||||
export VAULT_TOKEN=$(/usr/local/ripple/ops-toolbox/vault/vault_approle_auth -r ${ROLE_ID} -s ${SECRET_ID} -t)
|
||||
/usr/local/ripple/ops-toolbox/vault/vault_get_sts_token.py -r rippled-build-role
|
||||
|
||||
mkdir -p rpm-out
|
||||
|
||||
docker pull "${docker_image}"
|
||||
|
||||
echo "Running build container"
|
||||
|
||||
docker run --rm \
|
||||
-v $PWD/rpm-out:/opt/rippled-rpm/out \
|
||||
-e "GIT_COMMIT=$git_commit" \
|
||||
-e "GIT_REMOTE=$git_remote" \
|
||||
-e "RPM_RELEASE=$rpm_release" \
|
||||
"${docker_image}"
|
||||
|
||||
. rpm-out/build_vars
|
||||
|
||||
cd rpm-out
|
||||
tar xvf rippled-*.tar.gz
|
||||
ls -la *.rpm
|
||||
#################################
|
||||
## for now we don't want the src
|
||||
## and debugsource rpms for testing
|
||||
## or archiving...
|
||||
#################################
|
||||
rm rippled-debugsource*.rpm
|
||||
rm *.src.rpm
|
||||
mkdir rpm-main
|
||||
cp *.rpm rpm-main
|
||||
cd rpm-main
|
||||
cd ../..
|
||||
|
||||
cat > test_rpm.sh << "EOL"
|
||||
#!/bin/bash
|
||||
|
||||
function error {
|
||||
echo $1
|
||||
exit 1
|
||||
}
|
||||
|
||||
yum install -y yum-utils openssl-static zlib-static
|
||||
rpm -i /opt/rippled-rpm/*.rpm
|
||||
rc=$?; if [[ $rc != 0 ]]; then
|
||||
error "error installing rpms"
|
||||
fi
|
||||
|
||||
/opt/ripple/bin/rippled --unittest
|
||||
rc=$?; if [[ $rc != 0 ]]; then
|
||||
error "rippled --unittest failed"
|
||||
fi
|
||||
|
||||
/opt/ripple/bin/validator-keys --unittest
|
||||
rc=$?; if [[ $rc != 0 ]]; then
|
||||
error "validator-keys --unittest failed"
|
||||
fi
|
||||
|
||||
EOL
|
||||
|
||||
chmod +x test_rpm.sh
|
||||
|
||||
echo "Running test container"
|
||||
|
||||
docker run --rm \
|
||||
-v $PWD/rpm-out/rpm-main:/opt/rippled-rpm \
|
||||
-v $PWD:/opt/rippled --entrypoint /opt/rippled/test_rpm.sh \
|
||||
centos:latest
|
||||
'''
|
||||
}
|
||||
|
||||
// post processing step after each build:
|
||||
// * archives the log file
|
||||
// * adds short description/status to build status
|
||||
// * returns an array of result info to add to the all_build summary
|
||||
def reportStatus(label, type, bldurl) {
|
||||
def reportStatus(label, type, bldurl, errmsg) {
|
||||
def outstr = ''
|
||||
def loglink = "[console](${bldurl}/console)"
|
||||
def logfile = "${label}.txt"
|
||||
@@ -719,7 +669,7 @@ def reportStatus(label, type, bldurl) {
|
||||
def fail_count = getFailures(outstr, label)
|
||||
outstr = null
|
||||
def txtcolor =
|
||||
fail_count == 0 ? 'DarkGreen' : 'Crimson'
|
||||
(fail_count == 0 && errmsg == '') ? 'DarkGreen' : 'Crimson'
|
||||
def shortbld = label
|
||||
// this is just an attempt to shorten the
|
||||
// summary text label to the point of absurdity..
|
||||
@@ -739,12 +689,16 @@ def reportStatus(label, type, bldurl) {
|
||||
shortbld = shortbld.replace('DEBUGGER', 'gdb')
|
||||
shortbld = shortbld.replace('ON', 'Y')
|
||||
shortbld = shortbld.replace('OFF', 'N')
|
||||
def stattext = "${st}, t: ${time}"
|
||||
if (fail_count <= 0 && errmsg != '') {
|
||||
stattext += " [BAD EXIT]"
|
||||
}
|
||||
manager.addShortText(
|
||||
"${shortbld}: ${st}, t: ${time}",
|
||||
"${shortbld}: ${stattext}",
|
||||
txtcolor,
|
||||
'white',
|
||||
'0px',
|
||||
'white')
|
||||
[fail_count == 0, type, "${st}, t: ${time}", loglink]
|
||||
[fail_count == 0 && errmsg == '', type, stattext, loglink]
|
||||
}
|
||||
|
||||
|
||||
144
RELEASENOTES.md
144
RELEASENOTES.md
@@ -14,6 +14,150 @@ If you are using Red Hat Enterprise Linux 7 or CentOS 7, you can [update using `
|
||||
|
||||
# Releases
|
||||
|
||||
## Version 1.3.0
|
||||
The `rippled` 1.3.0 release introduces several new features and overall improvements to the codebase, including the `fixMasterKeyAsRegularKey` amendment, code to adjust the timing of the consensus process and support for decentralized validator domain verification. The release also includes miscellaneous improvements including in the transaction censorship detection code, transaction validation code, manifest parsing code, configuration file parsing code, log file rotation code, and in the build, continuous integration, testing and package building pipelines.
|
||||
|
||||
**New and Updated Features**
|
||||
- The `fixMasterKeyAsRegularKey` amendment which, if enabled, will correct a technical flaw that allowed setting an account's regular key to the account's master key.
|
||||
- Code that allows validators to adjust the timing of the consensus process in near-real-time to account for connection delays.
|
||||
- Support for decentralized validator domain verification by adding support for a "domain" field in manifests.
|
||||
|
||||
**Bug Fixes**
|
||||
- Improve ledger trie ancestry tracking to reduce unnecessary error messages.
|
||||
- More efficient detection of dry paths in the payment engine. Although not a transaction-breaking change, this should reduces spurious error messages in the log files.
|
||||
|
||||
## Version 1.2.4
|
||||
|
||||
The `rippled` 1.2.4 release improves the way that shard crawl requests are routed and the robustness of configured validator list retrieval by imposing a 20 second timeout.
|
||||
|
||||
**New and Updated Features**
|
||||
|
||||
This release has no new features.
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Use public keys when routing shard crawl requests
|
||||
- Enforce a 20s timeout when making validator list requests (RIPD-1737)
|
||||
|
||||
## Version 1.2.3
|
||||
|
||||
The `rippled` 1.2.3 release corrects a technical flaw which in some circumstances can cause a null pointer dereference that can crash the server.
|
||||
|
||||
**New and Updated Features**
|
||||
|
||||
This release has no new features.
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Fix a technical flaw which in some circumstances can cause a null pointer dereference that can crash the server.
|
||||
|
||||
## Version 1.2.2
|
||||
|
||||
The `rippled` 1.2.2 release corrects a technical flaw in the fee escalation
|
||||
engine which could cause some fee metrics to be calculated incorrectly. In some
|
||||
circumstances this can potentially cause the server to crash.
|
||||
|
||||
**New and Updated Features**
|
||||
|
||||
This release has no new features.
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Fix a technical flaw in the fee escalation engine which could cause some fee metrics to be calculated incorrectly (4c06b3f86)
|
||||
|
||||
## Version 1.2.1
|
||||
|
||||
The `rippled` 1.2.1 release introduces several fixes including a change in the
|
||||
information reported via the enhanced crawl functionality introduced in the
|
||||
1.2.0 release, a fix for a potential race condition when processing a status
|
||||
change message for a peer, and for a technical flaw that could cause a server
|
||||
to not properly detect that it had lost all its peers.
|
||||
|
||||
The release also adds the `delivered_amount` field to more responses to simplify
|
||||
the handling of payment or check cashing transactions.
|
||||
|
||||
**New and Updated Features**
|
||||
|
||||
This release has no new features.
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Fix a race condition during `TMStatusChange` handling (c8249981)
|
||||
- Properly transition state to disconnected (9d027394)
|
||||
- Display validator status only in response to admin requests (2d6a518a)
|
||||
- Add the `delivered_amount` to more RPC commands (f2756914)
|
||||
|
||||
|
||||
## Version 1.2.0
|
||||
|
||||
The `rippled` 1.2.0 release introduces the MultisignReserve Amendment, which
|
||||
reduces the reserve requirement associated with signer lists. This release also
|
||||
includes incremental improvements to the code that handles offers. Furthermore,
|
||||
`rippled` now also has the ability to automatically detect transaction
|
||||
censorship attempts and issue warnings of increasing severity for transactions
|
||||
that should have been included in a closed ledger after several rounds of
|
||||
consensus.
|
||||
|
||||
**New and Updated Features**
|
||||
|
||||
- Reduce the account reserve for a Multisign SignerList (6572fc8)
|
||||
- Improve transaction error condition handling (4104778)
|
||||
- Allow servers to automatically detect transaction censorship attempts (945493d)
|
||||
- Load validator list from file (c1a0244)
|
||||
- Add RPC command shard crawl (17e0d09)
|
||||
- Add RPC Call unit tests (eeb9d92)
|
||||
- Grow the open ledger expected transactions quickly (7295cf9)
|
||||
- Avoid dispatching multiple fetch pack threads (4dcb3c9)
|
||||
- Remove unused function in AutoSocket.h (8dd8433)
|
||||
- Update TxQ developer docs (e14f913)
|
||||
- Add user defined literals for megabytes and kilobytes (cd1c5a3)
|
||||
- Make the FeeEscalation Amendment permanent (58f786c)
|
||||
- Remove undocumented experimental options from RPC sign (a96cb8f)
|
||||
- Improve RPC error message for fee command (af1697c)
|
||||
- Improve ledger_entry command’s inconsistent behavior (63e167b)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Accept redirects from validator list sites (7fe1d4b)
|
||||
- Implement missing string conversions for JSON (c0e9418)
|
||||
- Eliminate potential undefined behavior (c71eb45)
|
||||
- Add safe_cast to sure no overflow in casts between enums and integral types (a7e4541)
|
||||
|
||||
## Version 1.1.2
|
||||
|
||||
The `rippled` 1.1.2 release introduces a fix for an issue that could have
|
||||
prevented cluster peers from successfully bypassing connection limits when
|
||||
connecting to other servers on the same cluster. Additionally, it improves
|
||||
logic used to determine what the preferred ledger is during suboptimal
|
||||
network conditions.
|
||||
|
||||
**New and Updated Features**
|
||||
|
||||
This release has no new features.
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Properly bypass connection limits for cluster peers (#2795, #2796)
|
||||
- Improve preferred ledger calculation (#2784)
|
||||
|
||||
## Version 1.1.1
|
||||
|
||||
The `rippled` 1.1.1 release adds support for redirections when retrieving
|
||||
validator lists and changes the way that validators with an expired list
|
||||
behave. Additionally, informational commands return more useful information
|
||||
to allow server operators to determine the state of their server
|
||||
|
||||
**New and Updated Features**
|
||||
|
||||
- Enhance status reporting when using the `server_info` and `validators` commands (#2734)
|
||||
- Accept redirects from validator list sites: (#2715)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Properly handle expired validator lists when validating (#2734)
|
||||
|
||||
|
||||
|
||||
## Version 1.1.0
|
||||
|
||||
The `rippled` 1.1.0 release release includes the `DepositPreAuth` amendment, which combined with the previously released `DepositAuth` amendment, allows users to pre-authorize incoming transactions to accounts, by whitelisting sender addresses. The 1.1.0 release also includes incremental improvements to several previously released features (`fix1515` amendment), deprecates support for the `sign` and `sign_for` commands from the rippled API and improves invariant checking for enhanced security.
|
||||
|
||||
@@ -11,6 +11,7 @@ environment:
|
||||
# CMake honors these environment variables, setting the include/lib paths.
|
||||
BOOST_ROOT: C:/%RIPPLED_DEPS_PATH%/boost
|
||||
OPENSSL_ROOT: C:/%RIPPLED_DEPS_PATH%/openssl
|
||||
NIH_CACHE_ROOT: C:/%RIPPLED_DEPS_PATH%/
|
||||
|
||||
# We've had trouble with AppVeyor apparently not having a stack as large
|
||||
# as the *nix CI platforms. AppVeyor support suggested that we try
|
||||
@@ -74,7 +75,7 @@ build_script:
|
||||
Push-Location "build/$cmake_target"
|
||||
cmake -G"Visual Studio 15 2017 Win64" ../..
|
||||
if ($LastExitCode -ne 0) { throw "CMake failed" }
|
||||
cmake --build . --config $env:buildconfig -- -m
|
||||
cmake --build . --config $env:buildconfig --parallel 3
|
||||
if ($LastExitCode -ne 0) { throw "CMake build failed" }
|
||||
Pop-Location
|
||||
|
||||
@@ -87,7 +88,7 @@ test_script:
|
||||
- ps: |
|
||||
& {
|
||||
# Run the rippled unit tests
|
||||
& $exe --unittest --unittest-log
|
||||
& $exe --unittest --unittest-log --unittest-jobs 2
|
||||
# https://connect.microsoft.com/PowerShell/feedback/details/751703/option-to-stop-script-if-command-line-exe-fails
|
||||
if ($LastExitCode -ne 0) { throw "Unit tests failed" }
|
||||
}
|
||||
|
||||
24
bin/ci/README.md
Normal file
24
bin/ci/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
In this directory are two scripts, `build.sh` and `test.sh` used for building
|
||||
and testing rippled.
|
||||
|
||||
(For now, they assume Bash and Linux. Once I get Windows containers for
|
||||
testing, I'll try them there, but if Bash is not available, then they will
|
||||
soon be joined by PowerShell scripts `build.ps` and `test.ps`.)
|
||||
|
||||
We don't want these scripts to require arcane invocations that can only be
|
||||
pieced together from within a CI configuration. We want something that humans
|
||||
can easily invoke, read, and understand, for when we eventually have to test
|
||||
and debug them interactively. That means:
|
||||
|
||||
(1) They should work with no arguments.
|
||||
(2) They should document their arguments.
|
||||
(3) They should expand short arguments into long arguments.
|
||||
|
||||
While we want to provide options for common use cases, we don't need to offer
|
||||
the kitchen sink. We can rightfully expect users with esoteric, complicated
|
||||
needs to write their own scripts.
|
||||
|
||||
To make argument-handling easy for us, the implementers, we can just take all
|
||||
arguments from environment variables. They have the nice advantage that every
|
||||
command-line uses named arguments. For the benefit of us and our users, we
|
||||
document those variables at the top of each script.
|
||||
28
bin/ci/build.sh
Executable file
28
bin/ci/build.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o xtrace
|
||||
set -o errexit
|
||||
|
||||
# The build system. Either 'Unix Makefiles' or 'Ninja'.
|
||||
GENERATOR=${GENERATOR:-Unix Makefiles}
|
||||
# The compiler. Either 'gcc' or 'clang'.
|
||||
COMPILER=${COMPILER:-gcc}
|
||||
# The build type. Either 'Debug' or 'Release'.
|
||||
BUILD_TYPE=${BUILD_TYPE:-Debug}
|
||||
# Additional arguments to CMake.
|
||||
# We use the `-` substitution here instead of `:-` so that callers can erase
|
||||
# the default by setting `$CMAKE_ARGS` to the empty string.
|
||||
CMAKE_ARGS=${CMAKE_ARGS-'-Dwerr=ON'}
|
||||
|
||||
if [[ ${COMPILER} == 'gcc' ]]; then
|
||||
export CC='gcc'
|
||||
export CXX='g++'
|
||||
elif [[ ${COMPILER} == 'clang' ]]; then
|
||||
export CC='clang'
|
||||
export CXX='clang++'
|
||||
fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${GENERATOR}" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${CMAKE_ARGS} ..
|
||||
cmake --build . -- -j $(nproc)
|
||||
42
bin/ci/test.sh
Executable file
42
bin/ci/test.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o xtrace
|
||||
set -o errexit
|
||||
|
||||
# Set to 'true' to run the known "manual" tests in rippled.
|
||||
MANUAL_TESTS=${MANUAL_TESTS:-false}
|
||||
# The maximum number of concurrent tests.
|
||||
CONCURRENT_TESTS=${CONCURRENT_TESTS:-$(nproc)}
|
||||
# The path to rippled.
|
||||
RIPPLED=${RIPPLED:-build/rippled}
|
||||
# Additional arguments to rippled.
|
||||
RIPPLED_ARGS=${RIPPLED_ARGS:-}
|
||||
|
||||
function join_by { local IFS="$1"; shift; echo "$*"; }
|
||||
|
||||
declare -a manual_tests=(
|
||||
'beast.chrono.abstract_clock'
|
||||
'beast.unit_test.print'
|
||||
'ripple.NodeStore.Timing'
|
||||
'ripple.app.Flow_manual'
|
||||
'ripple.app.NoRippleCheckLimits'
|
||||
'ripple.app.PayStrandAllPairs'
|
||||
'ripple.consensus.ByzantineFailureSim'
|
||||
'ripple.consensus.DistributedValidators'
|
||||
'ripple.consensus.ScaleFreeSim'
|
||||
'ripple.ripple_data.digest'
|
||||
'ripple.tx.CrossingLimits'
|
||||
'ripple.tx.FindOversizeCross'
|
||||
'ripple.tx.Offer_manual'
|
||||
'ripple.tx.OversizeMeta'
|
||||
'ripple.tx.PlumpBook'
|
||||
)
|
||||
|
||||
if [[ ${MANUAL_TESTS} == 'true' ]]; then
|
||||
RIPPLED_ARGS+=" --unittest=$(join_by , "${manual_tests[@]}")"
|
||||
else
|
||||
RIPPLED_ARGS+=" --unittest --quiet --unittest-log"
|
||||
fi
|
||||
RIPPLED_ARGS+=" --unittest-jobs ${CONCURRENT_TESTS}"
|
||||
|
||||
${RIPPLED} ${RIPPLED_ARGS}
|
||||
@@ -5,7 +5,7 @@
|
||||
# debugging.
|
||||
set -ex
|
||||
__dirname=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
echo "using CC: $CC"
|
||||
echo "using CC: ${CC}"
|
||||
"${CC}" --version
|
||||
export CC
|
||||
COMPNAME=$(basename $CC)
|
||||
@@ -15,11 +15,14 @@ if [[ $CXX ]]; then
|
||||
export CXX
|
||||
fi
|
||||
: ${BUILD_TYPE:=Debug}
|
||||
echo "BUILD TYPE: $BUILD_TYPE"
|
||||
echo "BUILD TYPE: ${BUILD_TYPE}"
|
||||
|
||||
: ${TARGET:=install}
|
||||
echo "BUILD TARGET: ${TARGET}"
|
||||
|
||||
# Ensure APP defaults to rippled if it's not set.
|
||||
: ${APP:=rippled}
|
||||
echo "using APP: $APP"
|
||||
echo "using APP: ${APP}"
|
||||
|
||||
JOBS=${NUM_PROCESSORS:-2}
|
||||
if [[ ${TRAVIS:-false} != "true" ]]; then
|
||||
@@ -34,6 +37,12 @@ else
|
||||
time=
|
||||
fi
|
||||
|
||||
if [[ -z "${MAX_TIME:-}" ]] ; then
|
||||
timeout_cmd=""
|
||||
else
|
||||
timeout_cmd="timeout ${MAX_TIME}"
|
||||
fi
|
||||
|
||||
echo "cmake building ${APP}"
|
||||
: ${CMAKE_EXTRA_ARGS:=""}
|
||||
if [[ ${NINJA_BUILD:-} == true ]]; then
|
||||
@@ -41,9 +50,10 @@ if [[ ${NINJA_BUILD:-} == true ]]; then
|
||||
fi
|
||||
|
||||
coverage=false
|
||||
if [[ "${CMAKE_EXTRA_ARGS}" =~ -Dcoverage=((on)|(ON)) ]] ; then
|
||||
if [[ "${TARGET}" == "coverage_report" ]] ; then
|
||||
echo "coverage option detected."
|
||||
coverage=true
|
||||
export PATH=$PATH:${LCOV_ROOT}/usr/bin
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -73,9 +83,12 @@ fi
|
||||
|
||||
mkdir -p "build/${BUILD_DIR}"
|
||||
pushd "build/${BUILD_DIR}"
|
||||
$time cmake ../.. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${CMAKE_EXTRA_ARGS}
|
||||
if [[ ${BUILD_TYPE} == "docs" ]]; then
|
||||
$time cmake --build . --target docs -- $BUILDARGS
|
||||
# generate
|
||||
${time} cmake ../.. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${CMAKE_EXTRA_ARGS}
|
||||
# build
|
||||
export DESTDIR=$(pwd)/_INSTALLED_
|
||||
time ${timeout_cmd} cmake --build . --target ${TARGET} -- $BUILDARGS
|
||||
if [[ ${TARGET} == "docs" ]]; then
|
||||
## mimic the standard test output for docs build
|
||||
## to make controlling processes like jenkins happy
|
||||
if [ -f html_doc/index.html ]; then
|
||||
@@ -84,15 +97,13 @@ if [[ ${BUILD_TYPE} == "docs" ]]; then
|
||||
echo "1 case, 1 test total, 1 failures"
|
||||
fi
|
||||
exit
|
||||
else
|
||||
$time cmake --build . -- $BUILDARGS
|
||||
fi
|
||||
popd
|
||||
export APP_PATH="$PWD/build/${BUILD_DIR}/${APP}"
|
||||
echo "using APP_PATH: $APP_PATH"
|
||||
echo "using APP_PATH: ${APP_PATH}"
|
||||
|
||||
# See what we've actually built
|
||||
ldd $APP_PATH
|
||||
ldd ${APP_PATH}
|
||||
|
||||
function join_by { local IFS="$1"; shift; echo "$*"; }
|
||||
|
||||
@@ -123,24 +134,15 @@ if [[ ${APP} == "rippled" ]]; then
|
||||
else
|
||||
APP_ARGS+=" --unittest --quiet --unittest-log"
|
||||
fi
|
||||
# Only report on src/ripple files
|
||||
export LCOV_FILES="*/src/ripple/*"
|
||||
# Nothing to explicitly exclude
|
||||
export LCOV_EXCLUDE_FILES="LCOV_NO_EXCLUDE"
|
||||
if [[ ${coverage} == false && ${PARALLEL_TESTS:-} == true ]]; then
|
||||
APP_ARGS+=" --unittest-jobs ${JOBS}"
|
||||
fi
|
||||
else
|
||||
: ${LCOV_FILES:="*/src/*"}
|
||||
# Don't exclude anything
|
||||
: ${LCOV_EXCLUDE_FILES:="LCOV_NO_EXCLUDE"}
|
||||
fi
|
||||
|
||||
if [[ $coverage == true ]]; then
|
||||
export PATH=$PATH:$LCOV_ROOT/usr/bin
|
||||
|
||||
# Create baseline coverage data file
|
||||
lcov --no-external -c -i -d . -o baseline.info | grep -v "ignoring data for external file"
|
||||
if [[ ${coverage} == true ]]; then
|
||||
# Push the results (lcov.info) to codecov
|
||||
codecov -X gcov # don't even try and look for .gcov files ;)
|
||||
find . -name "*.gcda" | xargs rm -f
|
||||
fi
|
||||
|
||||
if [[ ${SKIP_TESTS:-} == true ]]; then
|
||||
@@ -148,45 +150,20 @@ if [[ ${SKIP_TESTS:-} == true ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ "${MAX_TIME:-}" == "" ]] ; then
|
||||
tcmd=""
|
||||
else
|
||||
tcmd="timeout ${MAX_TIME}"
|
||||
fi
|
||||
|
||||
if [[ ${DEBUGGER:-true} == "true" && -v GDB_ROOT && -x $GDB_ROOT/bin/gdb ]]; then
|
||||
$GDB_ROOT/bin/gdb -v
|
||||
if [[ ${DEBUGGER:-true} == "true" && -v GDB_ROOT && -x ${GDB_ROOT}/bin/gdb ]]; then
|
||||
${GDB_ROOT}/bin/gdb -v
|
||||
# Execute unit tests under gdb, printing a call stack
|
||||
# if we get a crash.
|
||||
export APP_ARGS
|
||||
$tcmd $GDB_ROOT/bin/gdb -return-child-result -quiet -batch \
|
||||
${timeout_cmd} ${GDB_ROOT}/bin/gdb -return-child-result -quiet -batch \
|
||||
-ex "set env MALLOC_CHECK_=3" \
|
||||
-ex "set print thread-events off" \
|
||||
-ex run \
|
||||
-ex "thread apply all backtrace full" \
|
||||
-ex "quit" \
|
||||
--args $APP_PATH $APP_ARGS
|
||||
--args ${APP_PATH} ${APP_ARGS}
|
||||
else
|
||||
$tcmd $APP_PATH $APP_ARGS
|
||||
fi
|
||||
|
||||
if [[ $coverage == true ]]; then
|
||||
# Create test coverage data file
|
||||
lcov --no-external -c -d . -o tests.info | grep -v "ignoring data for external file"
|
||||
|
||||
# Combine baseline and test coverage data
|
||||
lcov -a baseline.info -a tests.info -o lcov-all.info
|
||||
|
||||
# Included files
|
||||
lcov -e "lcov-all.info" "${LCOV_FILES}" -o lcov.pre.info
|
||||
|
||||
# Excluded files
|
||||
lcov --remove lcov.pre.info "${LCOV_EXCLUDE_FILES}" -o lcov.info
|
||||
|
||||
# Push the results (lcov.info) to codecov
|
||||
codecov -X gcov # don't even try and look for .gcov files ;)
|
||||
|
||||
find . -name "*.gcda" | xargs rm -f
|
||||
${timeout_cmd} ${APP_PATH} ${APP_ARGS}
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -24,8 +24,9 @@ then
|
||||
tar xzf /tmp/boost.tar.gz
|
||||
cd $BOOST_ROOT && \
|
||||
$time ./bootstrap.sh --prefix=$BOOST_ROOT && \
|
||||
$time ./b2 -d1 define=_GLIBCXX_USE_CXX11_ABI=0 -j$((2*${NUM_PROCESSORS:-2})) &&\
|
||||
$time ./b2 -d0 define=_GLIBCXX_USE_CXX11_ABI=0 install
|
||||
$time ./b2 cxxflags="-std=c++14" -j$((2*${NUM_PROCESSORS:-2})) &&\
|
||||
$time ./b2 install
|
||||
|
||||
else
|
||||
echo "Using cached boost at $BOOST_ROOT"
|
||||
fi
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
#
|
||||
# 7. Voting
|
||||
#
|
||||
# 8. Example Settings
|
||||
# 8. Misc Settings
|
||||
#
|
||||
# 9. Example Settings
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
@@ -32,14 +34,13 @@
|
||||
#
|
||||
# rippled.cfg
|
||||
#
|
||||
# For more information on where the rippled server instance searches for
|
||||
# the file please visit the Ripple wiki. Specifically, the section explaining
|
||||
# the --conf command line option:
|
||||
# For more information on where the rippled server instance searches for the
|
||||
# file, visit:
|
||||
#
|
||||
# https://ripple.com/wiki/Rippled#--conf.3Dpath
|
||||
# https://developers.ripple.com/commandline-usage.html#generic-options
|
||||
#
|
||||
# This file should be named rippled.cfg. This file is UTF-8 with Dos, UNIX,
|
||||
# or Mac style end of lines. Blank lines and lines beginning with '#' are
|
||||
# This file should be named rippled.cfg. This file is UTF-8 with DOS, UNIX,
|
||||
# or Mac style end of lines. Blank lines and lines beginning with '#' are
|
||||
# ignored. Undefined sections are reserved. No escapes are currently defined.
|
||||
#
|
||||
# Notation
|
||||
@@ -47,8 +48,8 @@
|
||||
# In this document a simple BNF notation is used. Angle brackets denote
|
||||
# required elements, square brackets denote optional elements, and single
|
||||
# quotes indicate string literals. A vertical bar separating 1 or more
|
||||
# elements is a logical "or"; Any one of the elements may be chosen.
|
||||
# Parenthesis are notational only, and used to group elements, they are not
|
||||
# elements is a logical "or"; any one of the elements may be chosen.
|
||||
# Parentheses are notational only, and used to group elements; they are not
|
||||
# part of the syntax unless they appear in quotes. White space may always
|
||||
# appear between elements, it has no effect on values.
|
||||
#
|
||||
@@ -124,13 +125,13 @@
|
||||
# port = 80
|
||||
#
|
||||
# [port_public]
|
||||
# ip=0.0.0.0
|
||||
# ip = 0.0.0.0
|
||||
# port = 443
|
||||
# protocol=peer,https
|
||||
# protocol = peer,https
|
||||
#
|
||||
# [port_private]
|
||||
# ip=127.0.0.1
|
||||
# protocol=http
|
||||
# ip = 127.0.0.1
|
||||
# protocol = http
|
||||
#
|
||||
# When rippled is used as a command line client (for example, issuing a
|
||||
# server stop command), the first port advertising the http or https
|
||||
@@ -146,7 +147,11 @@
|
||||
# ip = <IP-address>
|
||||
#
|
||||
# Required. Determines the IP address of the network interface to bind
|
||||
# to. To bind to all available interfaces, uses 0.0.0.0
|
||||
# to. To bind to all available IPv4 interfaces, use 0.0.0.0
|
||||
# To binding to all IPv4 and IPv6 interfaces, use ::
|
||||
#
|
||||
# NOTE if the ip value is ::, then any incoming IPv4 connections will
|
||||
# be made as mapped IPv4 addresses.
|
||||
#
|
||||
# port = <number>
|
||||
#
|
||||
@@ -198,11 +203,17 @@
|
||||
#
|
||||
# When set, grants administrative command access to the specified IP
|
||||
# addresses. These commands may be issued over http, https, ws, or wss
|
||||
# if configured on the port. If unspecified, the default is to not allow
|
||||
# if configured on the port. If not provided, the default is to not allow
|
||||
# administrative commands.
|
||||
#
|
||||
# NOTE A common configuration value for the admin field is "localhost".
|
||||
# If you are listening on all IPv4/IPv6 addresses by specifing
|
||||
# ip = :: then you can use admin = ::ffff:127.0.0.1,::1 to allow
|
||||
# administrative access from both IPv4 and IPv6 localhost
|
||||
# connections.
|
||||
#
|
||||
# *SECURITY WARNING*
|
||||
# 0.0.0.0 may be specified to allow access from any IP address. It must
|
||||
# 0.0.0.0 or :: may be used to allow access from any IP address. It must
|
||||
# be the only address specified and cannot be combined with other IPs.
|
||||
# Use of this address can compromise server security, please consider its
|
||||
# use carefully.
|
||||
@@ -280,7 +291,7 @@
|
||||
# keep rippled from connecting to other instances of rippled or
|
||||
# prevent RPC and WebSocket clients from connecting.
|
||||
#
|
||||
# send_queue_limit = = [1..65535]
|
||||
# send_queue_limit = [1..65535]
|
||||
#
|
||||
# A Websocket will disconnect when its send queue exceeds this limit.
|
||||
# The default is 100. A larger value may help with erratic disconnects but
|
||||
@@ -376,7 +387,10 @@
|
||||
# [ips]
|
||||
# r.ripple.com 51235
|
||||
#
|
||||
# The default is: [ips_fixed] addresses (if present) or r.ripple.com 51235
|
||||
# The default is:
|
||||
# [ips_fixed] addresses (if present)
|
||||
# or
|
||||
# ( r.ripple.com 51235 , zaphod.alloy.ee 51235 )
|
||||
#
|
||||
#
|
||||
# [ips_fixed]
|
||||
@@ -538,6 +552,20 @@
|
||||
# into the ledger at the minimum required fee before the required
|
||||
# fee escalates. Default: no maximum.
|
||||
#
|
||||
# normal_consensus_increase_percent = <number>
|
||||
#
|
||||
# (Optional) When the ledger has more transactions than "expected",
|
||||
# and performance is humming along nicely, the expected ledger size
|
||||
# is updated to the previous ledger size plus this percentage.
|
||||
# Default: 20
|
||||
#
|
||||
# slow_consensus_decrease_percent = <number>
|
||||
#
|
||||
# (Optional) When consensus takes longer than appropriate, the
|
||||
# expected ledger size is updated to the minimum of the previous
|
||||
# ledger size or the "expected" ledger size minus this percentage.
|
||||
# Default: 50
|
||||
#
|
||||
# maximum_txn_per_account = <number>
|
||||
#
|
||||
# Maximum number of transactions that one account can have in the
|
||||
@@ -800,13 +828,7 @@
|
||||
# RocksDB is an alternative backend for systems that don't use solid-state
|
||||
# drives. Because RocksDB's performance degrades as it stores more data,
|
||||
# keeping full history is not advised, and using online delete is
|
||||
# recommended. RocksDB is not available on Windows.
|
||||
#
|
||||
# The RocksDB backend also provides these optional parameters:
|
||||
#
|
||||
# compression 0 for none, 1 for Snappy compression
|
||||
#
|
||||
#
|
||||
# recommended.
|
||||
#
|
||||
# Required keys:
|
||||
# path Location to store the database (all types)
|
||||
@@ -826,7 +848,7 @@
|
||||
#
|
||||
# earliest_seq The default is 32570 to match the XRP ledger
|
||||
# network's earliest allowed sequence. Alternate
|
||||
# networks may set this value. Minimum value of 1.
|
||||
# networks may set this value. Minimum value of 1.
|
||||
#
|
||||
# Notes:
|
||||
# The 'node_db' entry configures the primary, persistent storage.
|
||||
@@ -846,22 +868,10 @@
|
||||
# ...
|
||||
#
|
||||
# Example:
|
||||
# type=nudb
|
||||
# path=db/shards/nudb
|
||||
#
|
||||
# The "type" field must be present and controls the choice of backend:
|
||||
#
|
||||
# type = NuDB
|
||||
# NuDB is recommended for shards.
|
||||
#
|
||||
# type = RocksDB
|
||||
#
|
||||
# The RocksDB backend also provides these optional parameters:
|
||||
#
|
||||
# compression 0 for none, 1 for Snappy compression
|
||||
#
|
||||
# Required keys:
|
||||
# path Location to store the database (all types)
|
||||
# path Location to store the database
|
||||
#
|
||||
# max_size_gb Maximum disk space the database will utilize (in gigabytes)
|
||||
#
|
||||
@@ -1004,7 +1014,7 @@
|
||||
#
|
||||
# 8. Misc Settings
|
||||
#
|
||||
#----------
|
||||
#-----------------
|
||||
#
|
||||
# [signing_support]
|
||||
#
|
||||
@@ -1025,6 +1035,50 @@
|
||||
# [signing_support]
|
||||
# true
|
||||
#
|
||||
# [crawl]
|
||||
#
|
||||
# List of options to control what data is reported through the /crawl endpoint
|
||||
# See https://developers.ripple.com/peer-protocol.html#peer-crawler
|
||||
#
|
||||
# <flag>
|
||||
#
|
||||
# Enable or disable access to /crawl requests. Default is '1' which
|
||||
# enables access.
|
||||
#
|
||||
# overlay = <flag>
|
||||
#
|
||||
# Report information about peers this server is connected to, similar
|
||||
# to the "peers" RPC API. Default is '1' which means to report peer
|
||||
# overlay info.
|
||||
#
|
||||
# server = <flag>
|
||||
#
|
||||
# Report information about the local server, similar to the "server_state"
|
||||
# RPC API. Default is '1' which means to report local server info.
|
||||
#
|
||||
# counts = <flag>
|
||||
#
|
||||
# Report information about the local server health counters, similar to
|
||||
# the "get_counts" RPC API. Default is '0' which means not to report
|
||||
# server counts.
|
||||
#
|
||||
# unl = <flag>
|
||||
#
|
||||
# Report information about the local server's validator lists, similar to
|
||||
# the "validators" and "validator_list_sites" RPC APIs. Default is '1'
|
||||
# which means to report server validator lists.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# [crawl]
|
||||
# 0
|
||||
#
|
||||
# [crawl]
|
||||
# overlay = 1
|
||||
# server = 1
|
||||
# counts = 0
|
||||
# unl = 1
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# 9. Example Settings
|
||||
@@ -1090,6 +1144,8 @@ protocol = http
|
||||
[port_peer]
|
||||
port = 51235
|
||||
ip = 0.0.0.0
|
||||
# alternatively, to accept connections on IPv4 + IPv6, use:
|
||||
#ip = ::
|
||||
protocol = peer
|
||||
|
||||
[port_ws_admin_local]
|
||||
@@ -1099,7 +1155,7 @@ admin = 127.0.0.1
|
||||
protocol = ws
|
||||
|
||||
#[port_ws_public]
|
||||
#port = 5005
|
||||
#port = 6005
|
||||
#ip = 127.0.0.1
|
||||
#protocol = wss
|
||||
|
||||
@@ -1129,7 +1185,6 @@ advisory_delete=0
|
||||
# NuDB requires SSD storage. Helpful information can be found here
|
||||
# https://ripple.com/build/history-sharding
|
||||
#[shard_db]
|
||||
#type=NuDB
|
||||
#path=/var/lib/rippled/db/shards/nudb
|
||||
#max_size_gb=500
|
||||
|
||||
@@ -1147,12 +1202,8 @@ time.apple.com
|
||||
time.nist.gov
|
||||
pool.ntp.org
|
||||
|
||||
# Where to find some other servers speaking the Ripple protocol.
|
||||
[ips]
|
||||
r.ripple.com 51235
|
||||
|
||||
# To use the XRP test network (see https://ripple.com/build/xrp-test-net/),
|
||||
# use the following [ips] section instead:
|
||||
# use the following [ips] section:
|
||||
# [ips]
|
||||
# r.altnet.rippletest.net 51235
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=Ripple Peer-to-Peer Network Daemon
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=nobody
|
||||
ExecStart=/usr/bin/rippled --conf=/etc/rippled/rippled.cfg
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
114
cfg/rippled.init
114
cfg/rippled.init
@@ -1,114 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ripple
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: starts the ripple network node
|
||||
# Description: starts rippled using start-stop-daemon
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
NAME=rippled
|
||||
USER="rippled"
|
||||
GROUP="rippled"
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
DAEMON=/usr/local/sbin/rippled
|
||||
DAEMON_OPTS="--conf /etc/ripple/rippled.cfg"
|
||||
NET_OPTS="--net $DAEMON_OPTS"
|
||||
LOGDIR="/var/log/rippled"
|
||||
DBDIR="/var/db/rippled/db/hyperldb"
|
||||
|
||||
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
|
||||
|
||||
# I wish it didn't come down to this, but this is the easiest way to ensure
|
||||
# sanity of an install.
|
||||
if [ ! -d $LOGDIR ]; then
|
||||
mkdir -p $LOGDIR
|
||||
chown $USER:$GROUP $LOGDIR
|
||||
fi
|
||||
if [ ! -d $DBDIR ]; then
|
||||
mkdir -p $DBDIR
|
||||
chown -R $USER:$GROUP $DBDIR
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting daemon: "$NAME
|
||||
start-stop-daemon --start --quiet --background -m --pidfile $PIDFILE \
|
||||
--exec $DAEMON --chuid $USER --group $GROUP --verbose -- $NET_OPTS
|
||||
echo "."
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo -n "Stopping daemon: "$NAME
|
||||
$DAEMON $DAEMON_OPTS stop
|
||||
rm -f $PIDFILE
|
||||
echo "."
|
||||
;;
|
||||
|
||||
restart)
|
||||
echo -n "Restarting daemon: "$NAME
|
||||
$DAEMON $DAEMON_OPTS stop
|
||||
rm -f $PIDFILE
|
||||
start-stop-daemon --start --quiet --background -m --pidfile $PIDFILE \
|
||||
--exec $DAEMON --chuid $USER --group $GROUP -- $NET_OPTS
|
||||
echo "."
|
||||
;;
|
||||
|
||||
status)
|
||||
echo "Status of $NAME:"
|
||||
echo -n "PID of $NAME: "
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
cat $PIDFILE
|
||||
$DAEMON $DAEMON_OPTS server_info
|
||||
else
|
||||
echo "$NAME not running."
|
||||
fi
|
||||
echo "."
|
||||
;;
|
||||
|
||||
fetch)
|
||||
echo "$NAME ledger fetching info:"
|
||||
$DAEMON $DAEMON_OPTS fetch_info
|
||||
echo "."
|
||||
;;
|
||||
|
||||
uptime)
|
||||
echo "$NAME uptime:"
|
||||
$DAEMON $DAEMON_OPTS get_counts
|
||||
echo "."
|
||||
;;
|
||||
|
||||
startconfig)
|
||||
echo "$NAME is being started with the following command line:"
|
||||
echo "$DAEMON $NET_OPTS"
|
||||
echo "."
|
||||
;;
|
||||
|
||||
command)
|
||||
# Truncate the script's argument vector by one position to get rid of
|
||||
# this entry.
|
||||
shift
|
||||
|
||||
# Pass the remainder of the argument vector to rippled.
|
||||
$DAEMON $DAEMON_OPTS "$@"
|
||||
echo "."
|
||||
;;
|
||||
|
||||
test)
|
||||
$DAEMON $DAEMON_OPTS ping
|
||||
echo "."
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status|fetch|uptime|startconfig|"
|
||||
echo " command|test}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -14,10 +14,8 @@
|
||||
#
|
||||
# List of the validation public keys of nodes to always accept as validators.
|
||||
#
|
||||
# The latest list of recommended validators can be obtained from
|
||||
# https://ripple.com/ripple.txt
|
||||
#
|
||||
# See also https://wiki.ripple.com/Ripple.txt
|
||||
# Manually listing validator keys is not recommended for production networks.
|
||||
# See validator_list_sites and validator_list_keys below.
|
||||
#
|
||||
# Examples:
|
||||
# n9KorY8QtTdRx7TVDpwnG9NvyxsDwHUKUEeDLY3AkiGncVaSXZi5
|
||||
@@ -27,9 +25,13 @@
|
||||
#
|
||||
# List of URIs serving lists of recommended validators.
|
||||
#
|
||||
# The latest list of recommended validator sites can be
|
||||
# obtained from https://ripple.com/ripple.txt
|
||||
#
|
||||
# Examples:
|
||||
# https://vl.ripple.com
|
||||
# http://127.0.0.1:8000
|
||||
# file:///etc/opt/ripple/vl.txt
|
||||
#
|
||||
# [validator_list_keys]
|
||||
#
|
||||
@@ -39,6 +41,9 @@
|
||||
# publisher key.
|
||||
# Validator list keys should be hex-encoded.
|
||||
#
|
||||
# The latest list of recommended validator keys can be
|
||||
# obtained from https://ripple.com/ripple.txt
|
||||
#
|
||||
# Examples:
|
||||
# ed499d732bded01504a7407c224412ef550cc1ade638a4de4eb88af7c36cb8b282
|
||||
# 0202d3f36a801349f3be534e3f64cfa77dede6e1b6310a0b48f40f20f955cec945
|
||||
|
||||
@@ -105,6 +105,9 @@ WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = \
|
||||
\
|
||||
../src/ripple/app/misc/TxQ.h \
|
||||
../src/ripple/app/tx/apply.h \
|
||||
../src/ripple/app/tx/applySteps.h \
|
||||
../src/ripple/protocol/STObject.h \
|
||||
../src/ripple/protocol/JsonFields.h \
|
||||
../src/test/jtx/AbstractClient.h \
|
||||
|
||||
@@ -16,15 +16,23 @@ Source folders:
|
||||
|
||||
| Folder | Upstream Repo | Description |
|
||||
|:----------------|:---------------------------------------------|:------------|
|
||||
| `beast` | https://github.com/boostorg/beast | Cross-platform library for WebSocket and HTTP built on [Boost.Asio](https://think-async.com/Asio) |
|
||||
| `beast` | N/A | legacy utility code that was formerly associated with boost::beast
|
||||
| `ed25519-donna` | https://github.com/floodyberry/ed25519-donna | [Ed25519](http://ed25519.cr.yp.to/) digital signatures |
|
||||
| `ripple` | N/A | **Core source code for `rippled`** |
|
||||
| `secp256k1` | https://github.com/bitcoin-core/secp256k1 | ECDSA digital signatures using the **secp256k1** curve |
|
||||
| `test` | N/A | **Unit tests for `rippled`** |
|
||||
|
||||
The following dependencies are downloaded and built using ExternalProject
|
||||
(or FetchContent, where possible). Refer to CMakeLists.txt file for
|
||||
details about how these sources are built :
|
||||
|
||||
| Name | Upstream Repo | Description |
|
||||
|:----------------|:---------------------------------------------|:------------|
|
||||
| `lz4` | https://github.com/lz4/lz4 | LZ4 lossless compression algorithm |
|
||||
| `nudb` | https://github.com/vinniefalco/NuDB | Constant-time insert-only key/value database for SSD drives (Less memory usage than RocksDB.) |
|
||||
| `protobuf` | https://github.com/google/protobuf | Protocol buffer data interchange format. Ripple has changed some names in order to support the unity-style of build (a single .cpp added to the project, instead of linking to a separately built static library). |
|
||||
| `ripple` | N/A | **Core source code for `rippled`** |
|
||||
| `rocksdb2` | https://github.com/facebook/rocksdb | Fast key/value database. (Supports rotational disks better than NuDB.) |
|
||||
| `secp256k1` | https://github.com/bitcoin-core/secp256k1 | ECDSA digital signatures using the **secp256k1** curve |
|
||||
| `snappy` | https://github.com/google/snappy | "Snappy" lossless compression algorithm. (Technically, the source is in `snappy/snappy`, while `snappy/` also has config options that aren't part of the upstream repository.) |
|
||||
| `snappy` | https://github.com/google/snappy | "Snappy" lossless compression algorithm. |
|
||||
| `soci` | https://github.com/SOCI/soci | Abstraction layer for database access. |
|
||||
| `sqlite` | https://www.sqlite.org/src | An embedded database engine that writes to simple files. (Technically not a subtree, just a direct copy of the [SQLite source distribution](http://sqlite.org/download.html).) |
|
||||
| `test` | N/A | **Unit tests for `rippled`** |
|
||||
| `sqlite` | https://www.sqlite.org/src | An embedded database engine that writes to simple files. |
|
||||
| `rocksdb` | https://github.com/facebook/rocksdb | Fast key/value database. (Supports rotational disks better than NuDB.) |
|
||||
| `protobuf` | https://github.com/google/protobuf | Protocol buffer data interchange format. Only downloaded/built if a suitable version is not found by find_package, or if the local_protobuf option is explicitly set |
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ private:
|
||||
|
||||
public:
|
||||
recorder() = default;
|
||||
recorder(recorder const&) = default;
|
||||
recorder& operator=(recorder const&) = default;
|
||||
|
||||
/** Returns a report with the results of all completed suites. */
|
||||
results const&
|
||||
|
||||
21
src/lz4/.gitattributes
vendored
21
src/lz4/.gitattributes
vendored
@@ -1,21 +0,0 @@
|
||||
# Set the default behavior
|
||||
* text eol=lf
|
||||
|
||||
# Explicitly declare source files
|
||||
*.c text eol=lf
|
||||
*.h text eol=lf
|
||||
|
||||
# Denote files that should not be modified.
|
||||
*.odt binary
|
||||
*.png binary
|
||||
|
||||
# Visual Studio
|
||||
*.sln text eol=crlf
|
||||
*.vcxproj* text eol=crlf
|
||||
*.vcproj* text eol=crlf
|
||||
*.suo binary
|
||||
*.rc text eol=crlf
|
||||
|
||||
# Windows
|
||||
*.bat text eol=crlf
|
||||
*.cmd text eol=crlf
|
||||
31
src/lz4/.gitignore
vendored
31
src/lz4/.gitignore
vendored
@@ -1,31 +0,0 @@
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
*.dSYM # apple
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
lz4
|
||||
|
||||
# IDE / editors files
|
||||
.clang_complete
|
||||
_codelite/
|
||||
_codelite_lz4/
|
||||
bin/
|
||||
*.zip
|
||||
|
||||
# Mac
|
||||
.DS_Store
|
||||
*.dSYM
|
||||
@@ -1,150 +0,0 @@
|
||||
language: c
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
# OS X Mavericks
|
||||
- os: osx
|
||||
install:
|
||||
- export CC=clang
|
||||
env: Ubu=OS_X_Mavericks Cmd='make -C tests test-lz4 MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion" && CFLAGS=-m32 make -C tests clean test-lz4-contentSize' COMPILER=clang
|
||||
|
||||
# Container-based 12.04 LTS Server Edition 64 bit (doesn't support 32-bit includes)
|
||||
- os: linux
|
||||
sudo: false
|
||||
env: Ubu=12.04cont Cmd='make -C tests test-lz4 test-lz4c test-fasttest test-fullbench' COMPILER=cc
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
env: Ubu=12.04cont Cmd='make -C tests test-frametest test-fuzzer' COMPILER=cc
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
env: Ubu=12.04cont Cmd="make gpptest && make clean examples && make clean cmake && make clean travis-install && make clean clangtest" COMPILER=cc
|
||||
|
||||
|
||||
# 14.04 LTS Server Edition 64 bit
|
||||
- env: Ubu=14.04 Cmd='make -C tests test MOREFLAGS=-mx32' COMPILER=cc
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libc6-dev-i386
|
||||
- gcc-multilib
|
||||
|
||||
- env: Ubu=14.04 Cmd='make usan' COMPILER=clang
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang
|
||||
|
||||
- env: Ubu=14.04 Cmd='make c_standards && make -C tests test-lz4 test-mem' COMPILER=cc
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- valgrind
|
||||
|
||||
- env: Ubu=14.04 Cmd='make -C tests test-lz4c32 test-fullbench32 versionsTest' COMPILER=cc
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- python3
|
||||
- libc6-dev-i386
|
||||
- gcc-multilib
|
||||
|
||||
- env: Ubu=14.04 Cmd='make -C tests test-frametest32 test-fuzzer32' COMPILER=cc
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libc6-dev-i386
|
||||
- gcc-multilib
|
||||
|
||||
- env: Ubu=14.04 Cmd='make c_standards CC=gcc-6 && make -C tests test-lz4 CC=gcc-6 MOREFLAGS=-Werror' COMPILER=gcc-6
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- gcc-6
|
||||
|
||||
- env: Ubu=14.04 Cmd='make platformTest CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static && make platformTest CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static' COMPILER=arm-linux-gnueabi-gcc
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- qemu-system-arm
|
||||
- qemu-user-static
|
||||
- gcc-arm-linux-gnueabi
|
||||
- libc6-dev-armel-cross
|
||||
- gcc-aarch64-linux-gnu
|
||||
- libc6-dev-arm64-cross
|
||||
|
||||
- env: Ubu=14.04 Cmd='make -C tests test-lz4 clean test-lz4c32 CC=gcc-5 MOREFLAGS=-Werror' COMPILER=gcc-5
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libc6-dev-i386
|
||||
- gcc-multilib
|
||||
- gcc-5
|
||||
- gcc-5-multilib
|
||||
|
||||
- env: Ubu=14.04 Cmd='make -C tests test-lz4 CC=clang-3.8' COMPILER=clang-3.8
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
packages:
|
||||
- clang-3.8
|
||||
|
||||
- env: Ubu=14.04 Cmd='make platformTest CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static && make platformTest CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS=-m64' COMPILER=powerpc-linux-gnu-gcc
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- qemu-system-ppc
|
||||
- qemu-user-static
|
||||
- gcc-powerpc-linux-gnu
|
||||
|
||||
- env: Ubu=14.04 Cmd='make staticAnalyze' COMPILER=clang
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang
|
||||
|
||||
- env: Ubu=14.04 Cmd='make clean all CC=gcc-4.4 MOREFLAGS=-Werror && make clean && CFLAGS=-fPIC LDFLAGS="-pie -fPIE -D_FORTIFY_SOURCE=2" make -C programs' COMPILER=gcc-4.4
|
||||
dist: trusty
|
||||
sudo: required
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libc6-dev-i386
|
||||
- gcc-multilib
|
||||
- gcc-4.4
|
||||
|
||||
script:
|
||||
- echo Cmd=$Cmd
|
||||
- $COMPILER -v
|
||||
- sh -c "$Cmd"
|
||||
@@ -1,15 +0,0 @@
|
||||
Installation
|
||||
=============
|
||||
|
||||
```
|
||||
make
|
||||
make install # this command may require root access
|
||||
```
|
||||
|
||||
LZ4's `Makefile` supports standard [Makefile conventions],
|
||||
including [staged installs], [redirection], or [command redefinition].
|
||||
|
||||
[Makefile conventions]: https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
|
||||
[staged installs]: https://www.gnu.org/prep/standards/html_node/DESTDIR.html
|
||||
[redirection]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
||||
[command redefinition]: https://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html
|
||||
BIN
src/lz4/LICENSE
BIN
src/lz4/LICENSE
Binary file not shown.
181
src/lz4/Makefile
181
src/lz4/Makefile
@@ -1,181 +0,0 @@
|
||||
# ################################################################
|
||||
# LZ4 - Makefile
|
||||
# Copyright (C) Yann Collet 2011-2016
|
||||
# All rights reserved.
|
||||
#
|
||||
# This Makefile is validated for Linux, macOS, *BSD, Hurd, Solaris, MSYS2 targets
|
||||
#
|
||||
# BSD license
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this
|
||||
# list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this
|
||||
# list of conditions and the following disclaimer in the documentation and/or
|
||||
# other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# You can contact the author at :
|
||||
# - LZ4 source repository : https://github.com/lz4/lz4
|
||||
# - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c
|
||||
# ################################################################
|
||||
|
||||
LZ4DIR = lib
|
||||
PRGDIR = programs
|
||||
TESTDIR = tests
|
||||
EXDIR = examples
|
||||
|
||||
|
||||
# Define nul output
|
||||
ifneq (,$(filter Windows%,$(OS)))
|
||||
EXT = .exe
|
||||
VOID = nul
|
||||
else
|
||||
EXT =
|
||||
VOID = /dev/null
|
||||
endif
|
||||
|
||||
|
||||
.PHONY: default
|
||||
default: lib-release lz4-release
|
||||
|
||||
.PHONY: all
|
||||
all: allmost manuals
|
||||
|
||||
.PHONY: allmost
|
||||
allmost: lib lz4 examples
|
||||
|
||||
.PHONY: lib lib-release
|
||||
lib lib-release:
|
||||
@$(MAKE) -C $(LZ4DIR) $@
|
||||
|
||||
.PHONY: lz4 lz4-release
|
||||
lz4 : lib
|
||||
lz4-release : lib-release
|
||||
lz4 lz4-release :
|
||||
@$(MAKE) -C $(PRGDIR) $@
|
||||
@cp $(PRGDIR)/lz4$(EXT) .
|
||||
|
||||
.PHONY: examples
|
||||
examples: lib lz4
|
||||
$(MAKE) -C $(EXDIR) test
|
||||
|
||||
.PHONY: manuals
|
||||
manuals:
|
||||
@$(MAKE) -C contrib/gen_manual $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@$(MAKE) -C $(LZ4DIR) $@ > $(VOID)
|
||||
@$(MAKE) -C $(PRGDIR) $@ > $(VOID)
|
||||
@$(MAKE) -C $(TESTDIR) $@ > $(VOID)
|
||||
@$(MAKE) -C $(EXDIR) $@ > $(VOID)
|
||||
@$(MAKE) -C contrib/gen_manual $@
|
||||
@$(RM) lz4$(EXT)
|
||||
@echo Cleaning completed
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# make install is validated only for Linux, OSX, BSD, Hurd and Solaris targets
|
||||
#-----------------------------------------------------------------------------
|
||||
ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS))
|
||||
HOST_OS = POSIX
|
||||
|
||||
.PHONY: install uninstall
|
||||
install uninstall:
|
||||
@$(MAKE) -C $(LZ4DIR) $@
|
||||
@$(MAKE) -C $(PRGDIR) $@
|
||||
|
||||
travis-install:
|
||||
$(MAKE) -j1 install DESTDIR=~/install_test_dir
|
||||
|
||||
cmake:
|
||||
@cd contrib/cmake_unofficial; cmake $(CMAKE_PARAMS) CMakeLists.txt; $(MAKE)
|
||||
|
||||
endif
|
||||
|
||||
|
||||
ifneq (,$(filter MSYS%,$(shell uname)))
|
||||
HOST_OS = MSYS
|
||||
CMAKE_PARAMS = -G"MSYS Makefiles"
|
||||
endif
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets
|
||||
#------------------------------------------------------------------------
|
||||
ifneq (,$(filter $(HOST_OS),MSYS POSIX))
|
||||
|
||||
.PHONY: list
|
||||
list:
|
||||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
$(MAKE) -C $(TESTDIR) $@
|
||||
|
||||
clangtest: clean
|
||||
clang -v
|
||||
@CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(LZ4DIR) all CC=clang
|
||||
@CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(PRGDIR) all CC=clang
|
||||
@CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(TESTDIR) all CC=clang
|
||||
|
||||
clangtest-native: clean
|
||||
clang -v
|
||||
@CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(LZ4DIR) all CC=clang
|
||||
@CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(PRGDIR) native CC=clang
|
||||
@CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(TESTDIR) native CC=clang
|
||||
|
||||
usan: clean
|
||||
CC=clang CFLAGS="-O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T1mn" NB_LOOPS=-i1
|
||||
|
||||
usan32: clean
|
||||
CFLAGS="-m32 -O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T1mn" NB_LOOPS=-i1
|
||||
|
||||
staticAnalyze: clean
|
||||
CFLAGS=-g scan-build --status-bugs -v $(MAKE) all
|
||||
|
||||
platformTest: clean
|
||||
@echo "\n ---- test lz4 with $(CC) compiler ----"
|
||||
@$(CC) -v
|
||||
CFLAGS="-O3 -Werror" $(MAKE) -C $(LZ4DIR) all
|
||||
CFLAGS="-O3 -Werror -static" $(MAKE) -C $(PRGDIR) all
|
||||
CFLAGS="-O3 -Werror -static" $(MAKE) -C $(TESTDIR) all
|
||||
$(MAKE) -C $(TESTDIR) test-platform
|
||||
|
||||
.PHONY: versionsTest
|
||||
versionsTest: clean
|
||||
$(MAKE) -C $(TESTDIR) $@
|
||||
|
||||
gpptest: clean
|
||||
g++ -v
|
||||
CC=g++ $(MAKE) -C $(LZ4DIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
|
||||
CC=g++ $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
|
||||
CC=g++ $(MAKE) -C $(TESTDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
|
||||
|
||||
gpptest32: clean
|
||||
g++ -v
|
||||
CC=g++ $(MAKE) -C $(LZ4DIR) all CFLAGS="-m32 -O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
|
||||
CC=g++ $(MAKE) -C $(PRGDIR) native CFLAGS="-m32 -O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
|
||||
CC=g++ $(MAKE) -C $(TESTDIR) native CFLAGS="-m32 -O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
|
||||
|
||||
c_standards: clean
|
||||
# note : lz4 is not C90 compatible, because it requires long long support
|
||||
CFLAGS="-std=gnu90 -Werror" $(MAKE) clean allmost
|
||||
CFLAGS="-std=c99 -Werror" $(MAKE) clean allmost
|
||||
CFLAGS="-std=gnu99 -Werror" $(MAKE) clean allmost
|
||||
CFLAGS="-std=c11 -Werror" $(MAKE) clean allmost
|
||||
|
||||
endif
|
||||
231
src/lz4/NEWS
231
src/lz4/NEWS
@@ -1,231 +0,0 @@
|
||||
v1.8.0
|
||||
cli : fix : do not modify /dev/null permissions, reported by @Maokaman1
|
||||
cli : added GNU separator -- specifying that all following arguments are files
|
||||
API : added LZ4_compress_HC_destSize(), by Oleg (@remittor)
|
||||
API : added LZ4F_resetDecompressionContext()
|
||||
API : lz4frame : negative compression levels trigger fast acceleration, request by Lawrence Chan
|
||||
API : lz4frame : can control block checksum and dictionary ID
|
||||
API : fix : expose obsolete decoding functions, reported by Chen Yufei
|
||||
API : experimental : lz4frame_static : new dictionary compression API
|
||||
build : fix : static lib installation, by Ido Rosen
|
||||
build : dragonFlyBSD, OpenBSD, NetBSD supported
|
||||
build : LZ4_MEMORY_USAGE can be modified at compile time, through external define
|
||||
doc : Updated LZ4 Frame format to v1.6.0, restoring Dictionary-ID field
|
||||
doc : lz4 api manual, by Przemyslaw Skibinski
|
||||
|
||||
v1.7.5
|
||||
lz4hc : new high compression mode : levels 10-12 compress more and slower, by Przemyslaw Skibinski
|
||||
lz4cat : fix : works with relative path (#284) and stdin (#285) (reported by @beiDei8z)
|
||||
cli : fix minor notification when using -r recursive mode
|
||||
API : lz4frame : LZ4F_frameBound(0) gives upper bound of *flush() and *End() operations (#290, #280)
|
||||
doc : markdown version of man page, by Takayuki Matsuoka (#279)
|
||||
build : Makefile : fix make -jX lib+exe concurrency (#277)
|
||||
build : cmake : improvements by Michał Górny (#296)
|
||||
|
||||
v1.7.4.2
|
||||
fix : Makefile : release build compatible with PIE and customized compilation directives provided through environment variables (#274, reported by Antoine Martin)
|
||||
|
||||
v1.7.4
|
||||
Improved : much better speed in -mx32 mode
|
||||
cli : fix : Large file support in 32-bits mode on Mac OS-X
|
||||
fix : compilation on gcc 4.4 (#272), reported by Antoine Martin
|
||||
|
||||
v1.7.3
|
||||
Changed : moved to versioning; package, cli and library have same version number
|
||||
Improved: Small decompression speed boost
|
||||
Improved: Small compression speed improvement on 64-bits systems
|
||||
Improved: Small compression ratio and speed improvement on small files
|
||||
Improved: Significant speed boost on ARMv6 and ARMv7
|
||||
Fix : better ratio on 64-bits big-endian targets
|
||||
Improved cmake build script, by Evan Nemerson
|
||||
New liblz4-dll project, by Przemyslaw Skibinki
|
||||
Makefile: Generates object files (*.o) for faster (re)compilation on low power systems
|
||||
cli : new : --rm and --help commands
|
||||
cli : new : preserved file attributes, by Przemyslaw Skibinki
|
||||
cli : fix : crash on some invalid inputs
|
||||
cli : fix : -t correctly validates lz4-compressed files, by Nick Terrell
|
||||
cli : fix : detects and reports fread() errors, thanks to Hiroshi Fujishima report #243
|
||||
cli : bench : new : -r recursive mode
|
||||
lz4cat : can cat multiple files in a single command line (#184)
|
||||
Added : doc/lz4_manual.html, by Przemyslaw Skibinski
|
||||
Added : dictionary compression and frame decompression examples, by Nick Terrell
|
||||
Added : Debianization, by Evgeniy Polyakov
|
||||
|
||||
r131
|
||||
New : Dos/DJGPP target, thanks to Louis Santillan (#114)
|
||||
Added : Example using lz4frame library, by Zbigniew Jędrzejewski-Szmek (#118)
|
||||
Changed: xxhash symbols are modified (namespace emulation) within liblz4
|
||||
|
||||
r130:
|
||||
Fixed : incompatibility sparse mode vs console, reported by Yongwoon Cho (#105)
|
||||
Fixed : LZ4IO exits too early when frame crc not present, reported by Yongwoon Cho (#106)
|
||||
Fixed : incompatibility sparse mode vs append mode, reported by Takayuki Matsuoka (#110)
|
||||
Performance fix : big compression speed boost for clang (+30%)
|
||||
New : cross-version test, by Takayuki Matsuoka
|
||||
|
||||
r129:
|
||||
Added : LZ4_compress_fast(), LZ4_compress_fast_continue()
|
||||
Added : LZ4_compress_destSize()
|
||||
Changed: New lz4 and lz4hc compression API. Previous function prototypes still supported.
|
||||
Changed: Sparse file support enabled by default
|
||||
New : LZ4 CLI improved performance compressing/decompressing multiple files (#86, kind contribution from Kyle J. Harper & Takayuki Matsuoka)
|
||||
Fixed : GCC 4.9+ optimization bug - Reported by Markus Trippelsdorf, Greg Slazinski & Evan Nemerson
|
||||
Changed: Enums converted to LZ4F_ namespace convention - by Takayuki Matsuoka
|
||||
Added : AppVeyor CI environment, for Visual tests - Suggested by Takayuki Matsuoka
|
||||
Modified:Obsolete functions generate warnings - Suggested by Evan Nemerson, contributed by Takayuki Matsuoka
|
||||
Fixed : Bug #75 (unfinished stream), reported by Yongwoon Cho
|
||||
Updated: Documentation converted to MarkDown format
|
||||
|
||||
r128:
|
||||
New : lz4cli sparse file support (Requested by Neil Wilson, and contributed by Takayuki Matsuoka)
|
||||
New : command -m, to compress multiple files in a single command (suggested by Kyle J. Harper)
|
||||
Fixed : Restored lz4hc compression ratio (slightly lower since r124)
|
||||
New : lz4 cli supports long commands (suggested by Takayuki Matsuoka)
|
||||
New : lz4frame & lz4cli frame content size support
|
||||
New : lz4frame supports skippable frames, as requested by Sergey Cherepanov
|
||||
Changed: Default "make install" directory is /usr/local, as notified by Ron Johnson
|
||||
New : lz4 cli supports "pass-through" mode, requested by Neil Wilson
|
||||
New : datagen can generate sparse files
|
||||
New : scan-build tests, thanks to kind help by Takayuki Matsuoka
|
||||
New : g++ compatibility tests
|
||||
New : arm cross-compilation test, thanks to kind help by Takayuki Matsuoka
|
||||
Fixed : Fuzzer + frametest compatibility with NetBSD (issue #48, reported by Thomas Klausner)
|
||||
Added : Visual project directory
|
||||
Updated: Man page & Specification
|
||||
|
||||
r127:
|
||||
N/A : added a file on SVN
|
||||
|
||||
r126:
|
||||
New : lz4frame API is now integrated into liblz4
|
||||
Fixed : GCC 4.9 bug on highest performance settings, reported by Greg Slazinski
|
||||
Fixed : bug within LZ4 HC streaming mode, reported by James Boyle
|
||||
Fixed : older compiler don't like nameless unions, reported by Cheyi Lin
|
||||
Changed : lz4 is C90 compatible
|
||||
Changed : added -pedantic option, fixed a few mminor warnings
|
||||
|
||||
r125:
|
||||
Changed : endian and alignment code
|
||||
Changed : directory structure : new "lib" directory
|
||||
Updated : lz4io, now uses lz4frame
|
||||
Improved: slightly improved decoding speed
|
||||
Fixed : LZ4_compress_limitedOutput(); Special thanks to Christopher Speller !
|
||||
Fixed : some alignment warnings under clang
|
||||
Fixed : deprecated function LZ4_slideInputBufferHC()
|
||||
|
||||
r124:
|
||||
New : LZ4 HC streaming mode
|
||||
Fixed : LZ4F_compressBound() using null preferencesPtr
|
||||
Updated : xxHash to r38
|
||||
Updated library number, to 1.4.0
|
||||
|
||||
r123:
|
||||
Added : experimental lz4frame API, thanks to Takayuki Matsuoka and Christopher Jackson for testings
|
||||
Fix : s390x support, thanks to Nobuhiro Iwamatsu
|
||||
Fix : test mode (-t) no longer requires confirmation, thanks to Thary Nguyen
|
||||
|
||||
r122:
|
||||
Fix : AIX & AIX64 support (SamG)
|
||||
Fix : mips 64-bits support (lew van)
|
||||
Added : Examples directory, using code examples from Takayuki Matsuoka
|
||||
Updated : Framing specification, to v1.4.1
|
||||
Updated : xxHash, to r36
|
||||
|
||||
r121:
|
||||
Added : Makefile : install for kFreeBSD and Hurd (Nobuhiro Iwamatsu)
|
||||
Fix : Makefile : install for OS-X and BSD, thanks to Takayuki Matsuoka
|
||||
|
||||
r120:
|
||||
Modified : Streaming API, using strong types
|
||||
Added : LZ4_versionNumber(), thanks to Takayuki Matsuoka
|
||||
Fix : OS-X : library install name, thanks to Clemens Lang
|
||||
Updated : Makefile : synchronize library version number with lz4.h, thanks to Takayuki Matsuoka
|
||||
Updated : Makefile : stricter compilation flags
|
||||
Added : pkg-config, thanks to Zbigniew Jędrzejewski-Szmek (issue 135)
|
||||
Makefile : lz4-test only test native binaries, as suggested by Michał Górny (issue 136)
|
||||
Updated : xxHash to r35
|
||||
|
||||
r119:
|
||||
Fix : Issue 134 : extended malicious address space overflow in 32-bits mode for some specific configurations
|
||||
|
||||
r118:
|
||||
New : LZ4 Streaming API (Fast version), special thanks to Takayuki Matsuoka
|
||||
New : datagen : parametrable synthetic data generator for tests
|
||||
Improved : fuzzer, support more test cases, more parameters, ability to jump to specific test
|
||||
fix : support ppc64le platform (issue 131)
|
||||
fix : Issue 52 (malicious address space overflow in 32-bits mode when using large custom format)
|
||||
fix : Makefile : minor issue 130 : header files permissions
|
||||
|
||||
r117:
|
||||
Added : man pages for lz4c and lz4cat
|
||||
Added : automated tests on Travis, thanks to Takayuki Matsuoka !
|
||||
fix : block-dependency command line (issue 127)
|
||||
fix : lz4fullbench (issue 128)
|
||||
|
||||
r116:
|
||||
hotfix (issue 124 & 125)
|
||||
|
||||
r115:
|
||||
Added : lz4cat utility, installed on POSX systems (issue 118)
|
||||
OS-X compatible compilation of dynamic library (issue 115)
|
||||
|
||||
r114:
|
||||
Makefile : library correctly compiled with -O3 switch (issue 114)
|
||||
Makefile : library compilation compatible with clang
|
||||
Makefile : library is versioned and linked (issue 119)
|
||||
lz4.h : no more static inline prototypes (issue 116)
|
||||
man : improved header/footer (issue 111)
|
||||
Makefile : Use system default $(CC) & $(MAKE) variables (issue 112)
|
||||
xxhash : updated to r34
|
||||
|
||||
r113:
|
||||
Large decompression speed improvement for GCC 32-bits. Thanks to Valery Croizier !
|
||||
LZ4HC : Compression Level is now a programmable parameter (CLI from 4 to 9)
|
||||
Separated IO routines from command line (lz4io.c)
|
||||
Version number into lz4.h (suggested by Francesc Alted)
|
||||
|
||||
r112:
|
||||
quickfix
|
||||
|
||||
r111 :
|
||||
Makefile : added capability to install libraries
|
||||
Modified Directory tree, to better separate libraries from programs.
|
||||
|
||||
r110 :
|
||||
lz4 & lz4hc : added capability to allocate state & stream state with custom allocator (issue 99)
|
||||
fuzzer & fullbench : updated to test new functions
|
||||
man : documented -l command (Legacy format, for Linux kernel compression) (issue 102)
|
||||
cmake : improved version by Mika Attila, building programs and libraries (issue 100)
|
||||
xxHash : updated to r33
|
||||
Makefile : clean also delete local package .tar.gz
|
||||
|
||||
r109 :
|
||||
lz4.c : corrected issue 98 (LZ4_compress_limitedOutput())
|
||||
Makefile : can specify version number from makefile
|
||||
|
||||
r108 :
|
||||
lz4.c : corrected compression efficiency issue 97 in 64-bits chained mode (-BD) for streams > 4 GB (thanks Roman Strashkin for reporting)
|
||||
|
||||
r107 :
|
||||
Makefile : support DESTDIR for staged installs. Thanks Jorge Aparicio.
|
||||
Makefile : make install installs both lz4 and lz4c (Jorge Aparicio)
|
||||
Makefile : removed -Wno-implicit-declaration compilation switch
|
||||
lz4cli.c : include <stduni.h> for isatty() (Luca Barbato)
|
||||
lz4.h : introduced LZ4_MAX_INPUT_SIZE constant (Shay Green)
|
||||
lz4.h : LZ4_compressBound() : unified macro and inline definitions (Shay Green)
|
||||
lz4.h : LZ4_decompressSafe_partial() : clarify comments (Shay Green)
|
||||
lz4.c : LZ4_compress() verify input size condition (Shay Green)
|
||||
bench.c : corrected a bug in free memory size evaluation
|
||||
cmake : install into bin/ directory (Richard Yao)
|
||||
cmake : check for just C compiler (Elan Ruusamae)
|
||||
|
||||
r106 :
|
||||
Makefile : make dist modify text files in the package to respect Unix EoL convention
|
||||
lz4cli.c : corrected small display bug in HC mode
|
||||
|
||||
r105 :
|
||||
Makefile : New install script and man page, contributed by Prasad Pandit
|
||||
lz4cli.c : Minor modifications, for easier extensibility
|
||||
COPYING : added license file
|
||||
LZ4_Streaming_Format.odt : modified file name to remove white space characters
|
||||
Makefile : .exe suffix now properly added only for Windows target
|
||||
@@ -1,114 +0,0 @@
|
||||
LZ4 - Extremely fast compression
|
||||
================================
|
||||
|
||||
LZ4 is lossless compression algorithm,
|
||||
providing compression speed at 400 MB/s per core,
|
||||
scalable with multi-cores CPU.
|
||||
It features an extremely fast decoder,
|
||||
with speed in multiple GB/s per core,
|
||||
typically reaching RAM speed limits on multi-core systems.
|
||||
|
||||
Speed can be tuned dynamically, selecting an "acceleration" factor
|
||||
which trades compression ratio for more speed up.
|
||||
On the other end, a high compression derivative, LZ4_HC, is also provided,
|
||||
trading CPU time for improved compression ratio.
|
||||
All versions feature the same decompression speed.
|
||||
|
||||
LZ4 library is provided as open-source software using BSD 2-Clause license.
|
||||
|
||||
|
||||
|Branch |Status |
|
||||
|------------|---------|
|
||||
|master | [![Build Status][travisMasterBadge]][travisLink] [![Build status][AppveyorMasterBadge]][AppveyorLink] [![coverity][coverBadge]][coverlink] |
|
||||
|dev | [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] |
|
||||
|
||||
[travisMasterBadge]: https://travis-ci.org/lz4/lz4.svg?branch=master "Continuous Integration test suite"
|
||||
[travisDevBadge]: https://travis-ci.org/lz4/lz4.svg?branch=dev "Continuous Integration test suite"
|
||||
[travisLink]: https://travis-ci.org/lz4/lz4
|
||||
[AppveyorMasterBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=master&svg=true "Windows test suite"
|
||||
[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=dev&svg=true "Windows test suite"
|
||||
[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/lz4-1lndh
|
||||
[coverBadge]: https://scan.coverity.com/projects/4735/badge.svg "Static code analysis of Master branch"
|
||||
[coverlink]: https://scan.coverity.com/projects/4735
|
||||
|
||||
> **Branch Policy:**
|
||||
> - The "master" branch is considered stable, at all times.
|
||||
> - The "dev" branch is the one where all contributions must be merged
|
||||
before being promoted to master.
|
||||
> + If you plan to propose a patch, please commit into the "dev" branch,
|
||||
or its own feature branch.
|
||||
Direct commit to "master" are not permitted.
|
||||
|
||||
Benchmarks
|
||||
-------------------------
|
||||
|
||||
The benchmark uses [lzbench], from @inikep
|
||||
compiled with GCC v6.2.0 on Linux 64-bits.
|
||||
The reference system uses a Core i7-3930K CPU @ 4.5GHz.
|
||||
Benchmark evaluates the compression of reference [Silesia Corpus]
|
||||
in single-thread mode.
|
||||
|
||||
[lzbench]: https://github.com/inikep/lzbench
|
||||
[Silesia Corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
|
||||
|
||||
| Compressor | Ratio | Compression | Decompression |
|
||||
| ---------- | ----- | ----------- | ------------- |
|
||||
| memcpy | 1.000 | 7300 MB/s | 7300 MB/s |
|
||||
|**LZ4 fast 8 (v1.7.3)**| 1.799 |**911 MB/s** | **3360 MB/s** |
|
||||
|**LZ4 default (v1.7.3)**|**2.101**|**625 MB/s** | **3220 MB/s** |
|
||||
| LZO 2.09 | 2.108 | 620 MB/s | 845 MB/s |
|
||||
| QuickLZ 1.5.0 | 2.238 | 510 MB/s | 600 MB/s |
|
||||
| Snappy 1.1.3 | 2.091 | 450 MB/s | 1550 MB/s |
|
||||
| LZF v3.6 | 2.073 | 365 MB/s | 820 MB/s |
|
||||
| [Zstandard] 1.1.1 -1 | 2.876 | 330 MB/s | 930 MB/s |
|
||||
| [Zstandard] 1.1.1 -3 | 3.164 | 200 MB/s | 810 MB/s |
|
||||
| [zlib] deflate 1.2.8 -1| 2.730 | 100 MB/s | 370 MB/s |
|
||||
|**LZ4 HC -9 (v1.7.3)** |**2.720**| 34 MB/s | **3240 MB/s** |
|
||||
| [zlib] deflate 1.2.8 -6| 3.099 | 33 MB/s | 390 MB/s |
|
||||
|
||||
[zlib]: http://www.zlib.net/
|
||||
[Zstandard]: http://www.zstd.net/
|
||||
|
||||
LZ4 is also compatible and well optimized for x32 mode, for which it provides an additional +10% speed performance.
|
||||
|
||||
|
||||
Installation
|
||||
-------------------------
|
||||
|
||||
```
|
||||
make
|
||||
make install # this command may require root access
|
||||
```
|
||||
|
||||
LZ4's `Makefile` supports standard [Makefile conventions],
|
||||
including [staged installs], [redirection], or [command redefinition].
|
||||
|
||||
[Makefile conventions]: https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
|
||||
[staged installs]: https://www.gnu.org/prep/standards/html_node/DESTDIR.html
|
||||
[redirection]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
||||
[command redefinition]: https://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html
|
||||
|
||||
|
||||
Documentation
|
||||
-------------------------
|
||||
|
||||
The raw LZ4 block compression format is detailed within [lz4_Block_format].
|
||||
|
||||
To compress an arbitrarily long file or data stream, multiple blocks are required.
|
||||
Organizing these blocks and providing a common header format to handle their content
|
||||
is the purpose of the Frame format, defined into [lz4_Frame_format].
|
||||
Interoperable versions of LZ4 must respect this frame format.
|
||||
|
||||
[lz4_Block_format]: doc/lz4_Block_format.md
|
||||
[lz4_Frame_format]: doc/lz4_Frame_format.md
|
||||
|
||||
|
||||
Other source versions
|
||||
-------------------------
|
||||
|
||||
Beyond the C reference source,
|
||||
many contributors have created versions of lz4 in multiple languages
|
||||
(Java, C#, Python, Perl, Ruby, etc.).
|
||||
A list of known source ports is maintained on the [LZ4 Homepage].
|
||||
|
||||
[LZ4 Homepage]: http://www.lz4.org
|
||||
@@ -1,141 +0,0 @@
|
||||
version: 1.0.{build}
|
||||
environment:
|
||||
matrix:
|
||||
- COMPILER: "visual"
|
||||
CONFIGURATION: "Debug"
|
||||
PLATFORM: "x64"
|
||||
- COMPILER: "visual"
|
||||
CONFIGURATION: "Debug"
|
||||
PLATFORM: "Win32"
|
||||
- COMPILER: "visual"
|
||||
CONFIGURATION: "Release"
|
||||
PLATFORM: "x64"
|
||||
- COMPILER: "visual"
|
||||
CONFIGURATION: "Release"
|
||||
PLATFORM: "Win32"
|
||||
- COMPILER: "gcc"
|
||||
PLATFORM: "mingw64"
|
||||
- COMPILER: "gcc"
|
||||
PLATFORM: "mingw32"
|
||||
- COMPILER: "gcc"
|
||||
PLATFORM: "clang"
|
||||
|
||||
install:
|
||||
- ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION%
|
||||
- MKDIR bin
|
||||
- if [%COMPILER%]==[gcc] SET PATH_ORIGINAL=%PATH%
|
||||
- if [%COMPILER%]==[gcc] (
|
||||
SET "PATH_MINGW32=c:\MinGW\bin;c:\MinGW\usr\bin" &&
|
||||
SET "PATH_MINGW64=c:\msys64\mingw64\bin;c:\msys64\usr\bin" &&
|
||||
COPY C:\MinGW\bin\mingw32-make.exe C:\MinGW\bin\make.exe &&
|
||||
COPY C:\MinGW\bin\gcc.exe C:\MinGW\bin\cc.exe
|
||||
) else (
|
||||
IF [%PLATFORM%]==[x64] (SET ADDITIONALPARAM=/p:LibraryPath="C:\Program Files\Microsoft SDKs\Windows\v7.1\lib\x64;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\lib\amd64;")
|
||||
)
|
||||
|
||||
build_script:
|
||||
- if [%PLATFORM%]==[mingw32] SET PATH=%PATH_MINGW32%;%PATH_ORIGINAL%
|
||||
- if [%PLATFORM%]==[mingw64] SET PATH=%PATH_MINGW64%;%PATH_ORIGINAL%
|
||||
- if [%PLATFORM%]==[clang] SET PATH=%PATH_MINGW64%;%PATH_ORIGINAL%
|
||||
- ECHO *** &&
|
||||
ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION% &&
|
||||
ECHO ***
|
||||
- if [%PLATFORM%]==[clang] (clang -v)
|
||||
- if [%COMPILER%]==[gcc] (gcc -v)
|
||||
- if [%COMPILER%]==[gcc] (
|
||||
echo ----- &&
|
||||
make -v &&
|
||||
echo ----- &&
|
||||
if not [%PLATFORM%]==[clang] (
|
||||
make -C programs lz4 && make -C tests fullbench && make -C lib lib
|
||||
) ELSE (
|
||||
make -C programs lz4 CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion" &&
|
||||
make -C tests fullbench CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion" &&
|
||||
make -C lib lib CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion"
|
||||
)
|
||||
)
|
||||
- if [%COMPILER%]==[gcc] if not [%PLATFORM%]==[clang] (
|
||||
MKDIR bin\dll bin\static bin\example bin\include &&
|
||||
COPY tests\fullbench.c bin\example\ &&
|
||||
COPY lib\xxhash.c bin\example\ &&
|
||||
COPY lib\xxhash.h bin\example\ &&
|
||||
COPY lib\lz4.h bin\include\ &&
|
||||
COPY lib\lz4hc.h bin\include\ &&
|
||||
COPY lib\lz4frame.h bin\include\ &&
|
||||
COPY lib\liblz4.a bin\static\liblz4_static.lib &&
|
||||
COPY lib\dll\liblz4.* bin\dll\ &&
|
||||
COPY lib\dll\example\Makefile bin\example\ &&
|
||||
COPY lib\dll\example\fullbench-dll.* bin\example\ &&
|
||||
COPY lib\dll\example\README.md bin\ &&
|
||||
COPY programs\lz4.exe bin\lz4.exe
|
||||
)
|
||||
- if [%COMPILER%]==[gcc] if [%PLATFORM%]==[mingw64] (
|
||||
7z.exe a bin\lz4_x64.zip NEWS .\bin\lz4.exe .\bin\README.md .\bin\example .\bin\dll .\bin\static .\bin\include &&
|
||||
appveyor PushArtifact bin\lz4_x64.zip
|
||||
)
|
||||
- if [%COMPILER%]==[gcc] if [%PLATFORM%]==[mingw32] (
|
||||
7z.exe a bin\lz4_x86.zip NEWS .\bin\lz4.exe .\bin\README.md .\bin\example .\bin\dll .\bin\static .\bin\include &&
|
||||
appveyor PushArtifact bin\lz4_x86.zip
|
||||
)
|
||||
- if [%COMPILER%]==[gcc] (COPY tests\fullbench.exe programs\)
|
||||
- if [%COMPILER%]==[visual] (
|
||||
ECHO *** &&
|
||||
ECHO *** Building Visual Studio 2010 %PLATFORM%\%CONFIGURATION% &&
|
||||
ECHO *** &&
|
||||
msbuild "visual\VS2010\lz4.sln" %ADDITIONALPARAM% /m /verbosity:minimal /property:PlatformToolset=v100 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
|
||||
ECHO *** &&
|
||||
ECHO *** Building Visual Studio 2012 %PLATFORM%\%CONFIGURATION% &&
|
||||
ECHO *** &&
|
||||
msbuild "visual\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
|
||||
ECHO *** &&
|
||||
ECHO *** Building Visual Studio 2013 %PLATFORM%\%CONFIGURATION% &&
|
||||
ECHO *** &&
|
||||
msbuild "visual\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v120 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
|
||||
ECHO *** &&
|
||||
ECHO *** Building Visual Studio 2015 %PLATFORM%\%CONFIGURATION% &&
|
||||
ECHO *** &&
|
||||
msbuild "visual\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
|
||||
COPY visual\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe programs\
|
||||
)
|
||||
|
||||
test_script:
|
||||
- ECHO *** &&
|
||||
ECHO Testing %COMPILER% %PLATFORM% %CONFIGURATION% &&
|
||||
ECHO ***
|
||||
- if not [%COMPILER%]==[unknown] (
|
||||
CD programs &&
|
||||
lz4 -h &&
|
||||
lz4 -i1b lz4.exe &&
|
||||
lz4 -i1b5 lz4.exe &&
|
||||
lz4 -i1b10 lz4.exe &&
|
||||
lz4 -i1b15 lz4.exe &&
|
||||
echo ------- lz4 tested ------- &&
|
||||
fullbench.exe -i1 fullbench.exe
|
||||
)
|
||||
|
||||
artifacts:
|
||||
- path: bin\lz4_x64.zip
|
||||
- path: bin\lz4_x86.zip
|
||||
|
||||
deploy:
|
||||
- provider: GitHub
|
||||
artifact: bin\lz4_x64.zip
|
||||
auth_token:
|
||||
secure: w6UJaGie0qbZvffr/fqyhO/Vj8rMiQWnv9a8qm3gxfngdHDTMT42wYupqJpIExId
|
||||
force_update: true
|
||||
prerelease: true
|
||||
on:
|
||||
COMPILER: gcc
|
||||
PLATFORM: "mingw64"
|
||||
appveyor_repo_tag: true
|
||||
|
||||
- provider: GitHub
|
||||
artifact: bin\lz4_x86.zip
|
||||
auth_token:
|
||||
secure: w6UJaGie0qbZvffr/fqyhO/Vj8rMiQWnv9a8qm3gxfngdHDTMT42wYupqJpIExId
|
||||
force_update: true
|
||||
prerelease: true
|
||||
on:
|
||||
COMPILER: gcc
|
||||
PLATFORM: "mingw32"
|
||||
appveyor_repo_tag: true
|
||||
@@ -1,39 +0,0 @@
|
||||
dependencies:
|
||||
override:
|
||||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; sudo apt-get -y -qq update
|
||||
- sudo apt-get -y install qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu
|
||||
- sudo apt-get -y install qemu-system-arm gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
||||
- sudo apt-get -y install libc6-dev-i386 clang gcc-5 gcc-5-multilib gcc-6 valgrind
|
||||
|
||||
test:
|
||||
override:
|
||||
# Tests compilers and C standards
|
||||
- clang -v; make clangtest && make clean
|
||||
- g++ -v; make gpptest && make clean
|
||||
- gcc -v; make c_standards && make clean
|
||||
- gcc-5 -v; make -C tests test-lz4 CC=gcc-5 MOREFLAGS=-Werror && make clean
|
||||
- gcc-5 -v; make -C tests test-lz4c32 CC=gcc-5 MOREFLAGS="-I/usr/include/x86_64-linux-gnu -Werror" && make clean
|
||||
- gcc-6 -v; make c_standards CC=gcc-6 && make clean
|
||||
- gcc-6 -v; make -C tests test-lz4 CC=gcc-6 MOREFLAGS=-Werror && make clean
|
||||
# Shorter tests
|
||||
- make cmake && make clean
|
||||
- make -C tests test-lz4
|
||||
- make -C tests test-lz4c
|
||||
- make -C tests test-fasttest
|
||||
- make -C tests test-frametest
|
||||
- make -C tests test-fullbench
|
||||
- make -C tests test-fuzzer && make clean
|
||||
- make -C lib all && make clean
|
||||
- pyenv global 3.4.4; CFLAGS=-I/usr/include/x86_64-linux-gnu make versionsTest && make clean
|
||||
- make travis-install && make clean
|
||||
# Longer tests
|
||||
- gcc -v; make -C tests test32 MOREFLAGS="-I/usr/include/x86_64-linux-gnu" && make clean
|
||||
- make usan && make clean
|
||||
- clang -v; make staticAnalyze && make clean
|
||||
# Valgrind tests
|
||||
- make -C tests test-mem && make clean
|
||||
# ARM, AArch64, PowerPC, PowerPC64 tests
|
||||
- make platformTest CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static && make clean
|
||||
- make platformTest CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS=-m64 && make clean
|
||||
- make platformTest CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static && make clean
|
||||
- make platformTest CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static && make clean
|
||||
9
src/lz4/contrib/cmake_unofficial/.gitignore
vendored
9
src/lz4/contrib/cmake_unofficial/.gitignore
vendored
@@ -1,9 +0,0 @@
|
||||
# cmake artefact
|
||||
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
*.cmake
|
||||
Makefile
|
||||
liblz4.pc
|
||||
lz4c
|
||||
install_manifest.txt
|
||||
@@ -1,221 +0,0 @@
|
||||
# CMake support for LZ4
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all
|
||||
# copyright and related and neighboring rights to this software to
|
||||
# the public domain worldwide. This software is distributed without
|
||||
# any warranty.
|
||||
#
|
||||
# For details, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
#
|
||||
# LZ4's CMake support is maintained by Evan Nemerson; when filing
|
||||
# bugs please mention @nemequ to make sure I see it.
|
||||
|
||||
set(LZ4_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")
|
||||
|
||||
# Parse version information
|
||||
file(STRINGS "${LZ4_TOP_SOURCE_DIR}/lib/lz4.h" LZ4_VERSION_MAJOR REGEX "^#define LZ4_VERSION_MAJOR +([0-9]+) +.*$")
|
||||
string(REGEX REPLACE "^#define LZ4_VERSION_MAJOR +([0-9]+) +.*$" "\\1" LZ4_VERSION_MAJOR "${LZ4_VERSION_MAJOR}")
|
||||
file(STRINGS "${LZ4_TOP_SOURCE_DIR}/lib/lz4.h" LZ4_VERSION_MINOR REGEX "^#define LZ4_VERSION_MINOR +([0-9]+) +.*$")
|
||||
string(REGEX REPLACE "^#define LZ4_VERSION_MINOR +([0-9]+) +.*$" "\\1" LZ4_VERSION_MINOR "${LZ4_VERSION_MINOR}")
|
||||
file(STRINGS "${LZ4_TOP_SOURCE_DIR}/lib/lz4.h" LZ4_VERSION_RELEASE REGEX "^#define LZ4_VERSION_RELEASE +([0-9]+) +.*$")
|
||||
string(REGEX REPLACE "^#define LZ4_VERSION_RELEASE +([0-9]+) +.*$" "\\1" LZ4_VERSION_RELEASE "${LZ4_VERSION_RELEASE}")
|
||||
set(LZ4_VERSION_STRING "${LZ4_VERSION_MAJOR}.${LZ4_VERSION_MINOR}.${LZ4_VERSION_RELEASE}")
|
||||
mark_as_advanced(LZ4_VERSION_STRING LZ4_VERSION_MAJOR LZ4_VERSION_MINOR LZ4_VERSION_RELEASE)
|
||||
|
||||
if("${CMAKE_VERSION}" VERSION_LESS "3.0")
|
||||
project(LZ4 C)
|
||||
else()
|
||||
cmake_policy (SET CMP0048 NEW)
|
||||
project(LZ4
|
||||
VERSION ${LZ4_VERSION_STRING}
|
||||
LANGUAGES C)
|
||||
endif()
|
||||
|
||||
cmake_minimum_required (VERSION 2.8.6)
|
||||
|
||||
# If LZ4 is being bundled in another project, we don't want to
|
||||
# install anything. However, we want to let people override this, so
|
||||
# we'll use the LZ4_BUNDLED_MODE variable to let them do that; just
|
||||
# set it to OFF in your project before you add_subdirectory(lz4/contrib/cmake_unofficial).
|
||||
get_directory_property(LZ4_PARENT_DIRECTORY PARENT_DIRECTORY)
|
||||
if("${LZ4_BUNDLED_MODE}" STREQUAL "")
|
||||
# Bundled mode hasn't been set one way or the other, set the default
|
||||
# depending on whether or not we are the top-level project.
|
||||
if("${LZ4_PARENT_DIRECTORY}" STREQUAL "")
|
||||
set(LZ4_BUNDLED_MODE OFF)
|
||||
else()
|
||||
set(LZ4_BUNDLED_MODE ON)
|
||||
endif()
|
||||
endif()
|
||||
mark_as_advanced(LZ4_BUNDLED_MODE)
|
||||
|
||||
# CPack
|
||||
if(NOT LZ4_BUNDLED_MODE AND NOT CPack_CMake_INCLUDED)
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LZ4 compression library")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${LZ4_TOP_SOURCE_DIR}/README.md")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${LZ4_TOP_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${LZ4_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${LZ4_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${LZ4_VERSION_RELEASE})
|
||||
include(CPack)
|
||||
endif(NOT LZ4_BUNDLED_MODE AND NOT CPack_CMake_INCLUDED)
|
||||
|
||||
# Allow people to choose whether to build shared or static libraries
|
||||
# via the BUILD_SHARED_LIBS option unless we are in bundled mode, in
|
||||
# which case we always use static libraries.
|
||||
include(CMakeDependentOption)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON "NOT LZ4_BUNDLED_MODE" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_STATIC_LIBS "Build static libraries" OFF "BUILD_SHARED_LIBS" ON)
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS)
|
||||
message(FATAL_ERROR "Both BUILD_SHARED_LIBS and BUILD_STATIC_LIBS have been disabled")
|
||||
endif()
|
||||
|
||||
set(LZ4_LIB_SOURCE_DIR "${LZ4_TOP_SOURCE_DIR}/lib")
|
||||
set(LZ4_PROG_SOURCE_DIR "${LZ4_TOP_SOURCE_DIR}/programs")
|
||||
|
||||
include_directories("${LZ4_LIB_SOURCE_DIR}")
|
||||
|
||||
# CLI sources
|
||||
set(LZ4_SOURCES
|
||||
"${LZ4_LIB_SOURCE_DIR}/lz4.c"
|
||||
"${LZ4_LIB_SOURCE_DIR}/lz4hc.c"
|
||||
"${LZ4_LIB_SOURCE_DIR}/lz4.h"
|
||||
"${LZ4_LIB_SOURCE_DIR}/lz4hc.h"
|
||||
"${LZ4_LIB_SOURCE_DIR}/lz4frame.c"
|
||||
"${LZ4_LIB_SOURCE_DIR}/lz4frame.h"
|
||||
"${LZ4_LIB_SOURCE_DIR}/xxhash.c")
|
||||
set(LZ4_CLI_SOURCES
|
||||
"${LZ4_PROG_SOURCE_DIR}/bench.c"
|
||||
"${LZ4_PROG_SOURCE_DIR}/lz4cli.c"
|
||||
"${LZ4_PROG_SOURCE_DIR}/lz4io.c"
|
||||
"${LZ4_PROG_SOURCE_DIR}/datagen.c")
|
||||
|
||||
# Whether to use position independent code for the static library. If
|
||||
# we're building a shared library this is ignored and PIC is always
|
||||
# used.
|
||||
option(LZ4_POSITION_INDEPENDENT_LIB "Use position independent code for static library (if applicable)" ON)
|
||||
|
||||
# liblz4
|
||||
set(LZ4_LIBRARIES_BUILT)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(lz4_shared SHARED ${LZ4_SOURCES})
|
||||
set_target_properties(lz4_shared PROPERTIES
|
||||
OUTPUT_NAME lz4
|
||||
SOVERSION "${LZ4_VERSION_MAJOR}"
|
||||
VERSION "${LZ4_VERSION_STRING}")
|
||||
list(APPEND LZ4_LIBRARIES_BUILT lz4_shared)
|
||||
endif()
|
||||
if(BUILD_STATIC_LIBS)
|
||||
add_library(lz4_static STATIC ${LZ4_SOURCES})
|
||||
set_target_properties(lz4_static PROPERTIES
|
||||
OUTPUT_NAME lz4
|
||||
POSITION_INDEPENDENT_CODE ${LZ4_POSITION_INDEPENDENT_LIB})
|
||||
list(APPEND LZ4_LIBRARIES_BUILT lz4_static)
|
||||
endif()
|
||||
|
||||
# link to shared whenever possible, to static otherwise
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(LZ4_LINK_LIBRARY lz4_shared)
|
||||
else()
|
||||
set(LZ4_LINK_LIBRARY lz4_static)
|
||||
endif()
|
||||
|
||||
# lz4
|
||||
add_executable(lz4cli ${LZ4_CLI_SOURCES})
|
||||
set_target_properties(lz4cli PROPERTIES OUTPUT_NAME lz4)
|
||||
target_link_libraries(lz4cli ${LZ4_LINK_LIBRARY})
|
||||
|
||||
# lz4c
|
||||
add_executable(lz4c ${LZ4_CLI_SOURCES})
|
||||
set_target_properties(lz4c PROPERTIES COMPILE_DEFINITIONS "ENABLE_LZ4C_LEGACY_OPTIONS")
|
||||
target_link_libraries(lz4c ${LZ4_LINK_LIBRARY})
|
||||
|
||||
# Extra warning flags
|
||||
include (CheckCCompilerFlag)
|
||||
foreach (flag
|
||||
# GCC-style
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wundef
|
||||
-Wcast-qual
|
||||
-Wcast-align
|
||||
-Wshadow
|
||||
-Wswitch-enum
|
||||
-Wdeclaration-after-statement
|
||||
-Wstrict-prototypes
|
||||
-Wpointer-arith
|
||||
|
||||
# MSVC-style
|
||||
/W4)
|
||||
# Because https://gcc.gnu.org/wiki/FAQ#wnowarning
|
||||
string(REGEX REPLACE "\\-Wno\\-(.+)" "-W\\1" flag_to_test "${flag}")
|
||||
string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" test_name "CFLAG_${flag_to_test}")
|
||||
|
||||
check_c_compiler_flag("${ADD_COMPILER_FLAGS_PREPEND} ${flag_to_test}" ${test_name})
|
||||
|
||||
if(${test_name})
|
||||
set(CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
unset(test_name)
|
||||
unset(flag_to_test)
|
||||
endforeach (flag)
|
||||
|
||||
if(NOT LZ4_BUNDLED_MODE)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
install(TARGETS lz4cli lz4c
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
install(TARGETS ${LZ4_LIBRARIES_BUILT}
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
install(FILES
|
||||
"${LZ4_LIB_SOURCE_DIR}/lz4.h"
|
||||
"${LZ4_LIB_SOURCE_DIR}/lz4frame.h"
|
||||
"${LZ4_LIB_SOURCE_DIR}/lz4hc.h"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
install(FILES "${LZ4_PROG_SOURCE_DIR}/lz4.1"
|
||||
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblz4.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
|
||||
# install lz4cat and unlz4 symlinks on *nix
|
||||
if(UNIX)
|
||||
install(CODE "
|
||||
foreach(f lz4cat unlz4)
|
||||
set(dest \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/\${f}\")
|
||||
message(STATUS \"Symlinking: \${dest} -> lz4\")
|
||||
execute_process(
|
||||
COMMAND \"${CMAKE_COMMAND}\" -E create_symlink lz4 \"\${dest}\")
|
||||
endforeach()
|
||||
")
|
||||
|
||||
# create manpage aliases
|
||||
foreach(f lz4cat unlz4)
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${f}.1" ".so man1/lz4.1\n")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${f}.1"
|
||||
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
|
||||
endforeach()
|
||||
endif(UNIX)
|
||||
endif(NOT LZ4_BUNDLED_MODE)
|
||||
|
||||
# pkg-config
|
||||
set(PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
if("${CMAKE_INSTALL_FULL_LIBDIR}" STREQUAL "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
||||
set(LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
|
||||
else()
|
||||
set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_INSTALL_FULL_INCLUDEDIR}" STREQUAL "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
set(INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
else()
|
||||
set(INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
|
||||
endif()
|
||||
|
||||
# for liblz4.pc substitution
|
||||
set(VERSION ${LZ4_VERSION_STRING})
|
||||
configure_file(${LZ4_LIB_SOURCE_DIR}/liblz4.pc.in liblz4.pc @ONLY)
|
||||
@@ -1,10 +0,0 @@
|
||||
liblz4 (1.7.2) unstable; urgency=low
|
||||
|
||||
* Changed : moved to versioning; package, cli and library have same version number
|
||||
* Improved: Small decompression speed boost (+4%)
|
||||
* Improved: Performance on ARMv6 and ARMv7
|
||||
* Added : Debianization, by Evgeniy Polyakov
|
||||
* Makefile: Generates object files (*.o) for faster (re)compilation on low power systems
|
||||
* Fix : cli : crash on some invalid inputs
|
||||
|
||||
-- Yann Collet <Cyan4973@github.com> Sun, 28 Jun 2015 01:00:00 +0000
|
||||
@@ -1 +0,0 @@
|
||||
7
|
||||
@@ -1,23 +0,0 @@
|
||||
Source: liblz4
|
||||
Section: devel
|
||||
Priority: optional
|
||||
Maintainer: Evgeniy Polyakov <zbr@ioremap.net>
|
||||
Build-Depends:
|
||||
cmake (>= 2.6),
|
||||
debhelper (>= 7.0.50~),
|
||||
cdbs
|
||||
Standards-Version: 3.8.0
|
||||
Homepage: http://www.lz4.org/
|
||||
Vcs-Git: git://github.com/lz4/lz4.git
|
||||
Vcs-Browser: https://github.com/lz4/lz4
|
||||
|
||||
Package: liblz4
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Extremely Fast Compression algorithm http://www.lz4.org
|
||||
|
||||
Package: liblz4-dev
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Extremely Fast Compression algorithm http://www.lz4.org
|
||||
Development files.
|
||||
@@ -1,9 +0,0 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: liblz4
|
||||
Upstream-Contact: Yann Collet <Cyan4973@github.com>
|
||||
Source: https://github.com/lz4/lz4
|
||||
|
||||
Files: *
|
||||
Copyright: (C) 2011+ Yann Collet
|
||||
License: GPL-2+
|
||||
The full text of license: https://github.com/Cyan4973/lz4/blob/master/lib/LICENSE
|
||||
@@ -1 +0,0 @@
|
||||
usr/bin
|
||||
@@ -1,2 +0,0 @@
|
||||
usr/include/lz4*
|
||||
usr/lib/liblz4.so
|
||||
@@ -1,2 +0,0 @@
|
||||
usr/lib/liblz4.so.*
|
||||
usr/bin/*
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
||||
include /usr/share/cdbs/1/class/cmake.mk
|
||||
|
||||
|
||||
DEB_CMAKE_EXTRA_FLAGS := -DCMAKE_BUILD_TYPE=RelWithDebInfo ../cmake_unofficial
|
||||
|
||||
Binary file not shown.
@@ -1,130 +0,0 @@
|
||||
# Copyright (c) 2015, Louis P. Santillan <lpsantil@gmail.com>
|
||||
# All rights reserved.
|
||||
# See LICENSE for licensing details.
|
||||
DESTDIR ?= /opt/local
|
||||
|
||||
# Pulled the code below from lib/Makefile. Might be nicer to derive this somehow without sed
|
||||
# Version numbers
|
||||
VERSION ?= 129
|
||||
RELEASE ?= r$(VERSION)
|
||||
LIBVER_MAJOR=$(shell sed -n '/define LZ4_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lib/lz4.h)
|
||||
LIBVER_MINOR=$(shell sed -n '/define LZ4_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lib/lz4.h)
|
||||
LIBVER_PATCH=$(shell sed -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lib/lz4.h)
|
||||
LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH)
|
||||
|
||||
######################################################################
|
||||
|
||||
CROSS ?= i586-pc-msdosdjgpp
|
||||
CC = $(CROSS)-gcc
|
||||
AR = $(CROSS)-ar
|
||||
LD = $(CROSS)-gcc
|
||||
|
||||
CFLAGS ?= -O3 -std=gnu99 -Wall -Wextra -Wundef -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"$(RELEASE)\"
|
||||
LDFLAGS ?= -s
|
||||
SRC = programs/bench.c programs/lz4io.c programs/lz4cli.c
|
||||
OBJ = $(SRC:.c=.o)
|
||||
SDEPS = $(SRC:.c=.d)
|
||||
IDIR = lib
|
||||
EDIR = .
|
||||
EXE = lz4.exe
|
||||
LNK = lz4
|
||||
LDIR = lib
|
||||
LSRC = lib/lz4.c lib/lz4hc.c lib/lz4frame.c lib/xxhash.c
|
||||
INC = $(LSRC:.c=.h)
|
||||
LOBJ = $(LSRC:.c=.o)
|
||||
LSDEPS = $(LSRC:.c=.d)
|
||||
LIB = $(LDIR)/lib$(LNK).a
|
||||
|
||||
# Since LDFLAGS defaults to "-s", probably better to override unless
|
||||
# you have a default you would like to maintain
|
||||
ifeq ($(WITH_DEBUG), 1)
|
||||
CFLAGS += -g
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
# Since LDFLAGS defaults to "-s", probably better to override unless
|
||||
# you have a default you would like to maintain
|
||||
ifeq ($(WITH_PROFILING), 1)
|
||||
CFLAGS += -pg
|
||||
LDFLAGS += -pg
|
||||
endif
|
||||
|
||||
%.o: %.c $(INC) Makefile
|
||||
$(CC) $(CFLAGS) -MMD -MP -I$(IDIR) -c $< -o $@
|
||||
|
||||
%.exe: %.o $(LIB) Makefile
|
||||
$(LD) $< -L$(LDIR) -l$(LNK) $(LDFLAGS) $(LIBDEP) -o $@
|
||||
|
||||
######################################################################
|
||||
######################## DO NOT MODIFY BELOW #########################
|
||||
######################################################################
|
||||
|
||||
.PHONY: all install uninstall showconfig gstat gpush
|
||||
|
||||
all: $(LIB) $(EXE)
|
||||
|
||||
$(LIB): $(LOBJ)
|
||||
$(AR) -rcs $@ $^
|
||||
|
||||
$(EXE): $(LOBJ) $(OBJ)
|
||||
$(LD) $(LDFLAGS) $(LOBJ) $(OBJ) -o $(EDIR)/$@
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(EXE) $(LOBJ) $(LIB) *.tmp $(SDEPS) $(LSDEPS) $(TSDEPS)
|
||||
|
||||
install: $(INC) $(LIB) $(EXE)
|
||||
mkdir -p $(DESTDIR)/bin $(DESTDIR)/include $(DESTDIR)/lib
|
||||
rm -f .footprint
|
||||
echo $(DESTDIR)/bin/$(EXE) >> .footprint
|
||||
cp -v $(EXE) $(DESTDIR)/bin/
|
||||
@for T in $(LIB); \
|
||||
do ( \
|
||||
echo $(DESTDIR)/$$T >> .footprint; \
|
||||
cp -v --parents $$T $(DESTDIR) \
|
||||
); done
|
||||
@for T in $(INC); \
|
||||
do ( \
|
||||
echo $(DESTDIR)/include/`basename -a $$T` >> .footprint; \
|
||||
cp -v $$T $(DESTDIR)/include/ \
|
||||
); done
|
||||
|
||||
uninstall: .footprint
|
||||
@for T in $(shell cat .footprint); do rm -v $$T; done
|
||||
|
||||
-include $(SDEPS) $(LSDEPS)
|
||||
|
||||
showconfig:
|
||||
@echo "PWD="$(PWD)
|
||||
@echo "VERSION="$(VERSION)
|
||||
@echo "RELEASE="$(RELEASE)
|
||||
@echo "LIBVER_MAJOR="$(LIBVER_MAJOR)
|
||||
@echo "LIBVER_MINOR="$(LIBVER_MINOR)
|
||||
@echo "LIBVER_PATCH="$(LIBVER_PATCH)
|
||||
@echo "LIBVER="$(LIBVER)
|
||||
@echo "CROSS="$(CROSS)
|
||||
@echo "CC="$(CC)
|
||||
@echo "AR="$(AR)
|
||||
@echo "LD="$(LD)
|
||||
@echo "DESTDIR="$(DESTDIR)
|
||||
@echo "CFLAGS="$(CFLAGS)
|
||||
@echo "LDFLAGS="$(LDFLAGS)
|
||||
@echo "SRC="$(SRC)
|
||||
@echo "OBJ="$(OBJ)
|
||||
@echo "IDIR="$(IDIR)
|
||||
@echo "INC="$(INC)
|
||||
@echo "EDIR="$(EDIR)
|
||||
@echo "EXE="$(EXE)
|
||||
@echo "LDIR="$(LDIR)
|
||||
@echo "LSRC="$(LSRC)
|
||||
@echo "LOBJ="$(LOBJ)
|
||||
@echo "LNK="$(LNK)
|
||||
@echo "LIB="$(LIB)
|
||||
@echo "SDEPS="$(SDEPS)
|
||||
@echo "LSDEPS="$(LSDEPS)
|
||||
|
||||
gstat:
|
||||
git status
|
||||
|
||||
gpush:
|
||||
git commit
|
||||
git push
|
||||
@@ -1,21 +0,0 @@
|
||||
# lz4 for DOS/djgpp
|
||||
This file details on how to compile lz4.exe, and liblz4.a for use on DOS/djgpp using
|
||||
Andrew Wu's build-djgpp cross compilers ([GH][0], [Binaries][1]) on OSX, Linux.
|
||||
|
||||
## Setup
|
||||
* Download a djgpp tarball [binaries][1] for your platform.
|
||||
* Extract and install it (`tar jxvf djgpp-linux64-gcc492.tar.bz2`). Note the path. We'll assume `/home/user/djgpp`.
|
||||
* Add the `bin` folder to your `PATH`. In bash, do `export PATH=/home/user/djgpp/bin:$PATH`.
|
||||
* The `Makefile` in `contrib/djgpp/` sets up `CC`, `AR`, `LD` for you. So, `CC=i586-pc-msdosdjgpp-gcc`, `AR=i586-pc-msdosdjgpp-ar`, `LD=i586-pc-msdosdjgpp-gcc`.
|
||||
|
||||
## Building LZ4 for DOS
|
||||
In the base dir of lz4 and with `contrib/djgpp/Makefile`, try:
|
||||
Try:
|
||||
* `make -f contrib/djgpp/Makefile`
|
||||
* `make -f contrib/djgpp/Makefile liblz4.a`
|
||||
* `make -f contrib/djgpp/Makefile lz4.exe`
|
||||
* `make -f contrib/djgpp/Makefile DESTDIR=/home/user/dos install`, however it doesn't make much sense on a \*nix.
|
||||
* You can also do `make -f contrib/djgpp/Makefile uninstall`
|
||||
|
||||
[0]: https://github.com/andrewwutw/build-djgpp
|
||||
[1]: https://github.com/andrewwutw/build-djgpp/releases
|
||||
2
src/lz4/contrib/gen_manual/.gitignore
vendored
2
src/lz4/contrib/gen_manual/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
# build artefact
|
||||
gen_manual
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user