From d7aabcbee868ca19efee5f02113ede3597d09566 Mon Sep 17 00:00:00 2001 From: Milan Hauth Date: Mon, 15 Jul 2024 14:52:32 +0200 Subject: [PATCH] use shared libraries --- .gitmodules | 39 ---- CMakeLists.txt | 264 +++++++----------------- boost_checkout_lite.sh | 19 -- nano/ipc_flatbuffers_lib/CMakeLists.txt | 10 +- nano/lib/CMakeLists.txt | 13 +- nano/lib/logging.cpp | 4 +- nano/lib/stats.cpp | 3 +- nano/lib/threading.cpp | 1 + nano/load_test/CMakeLists.txt | 3 +- nano/nano_node/CMakeLists.txt | 3 +- nano/node/CMakeLists.txt | 8 +- nano/node/ipc/flatbuffers_handler.cpp | 2 +- nano/node/ipc/flatbuffers_handler.hpp | 3 +- nano/node/ipc/ipc_broker.cpp | 2 +- nano/node/portmapping.cpp | 4 +- nano/node/portmapping.hpp | 2 +- nano/rpc/CMakeLists.txt | 3 +- nano/store/CMakeLists.txt | 13 +- nano/store/lmdb/account.hpp | 2 +- nano/store/lmdb/block.hpp | 2 +- nano/store/lmdb/confirmation_height.hpp | 2 +- nano/store/lmdb/db_val.hpp | 2 +- nano/store/lmdb/final_vote.hpp | 2 +- nano/store/lmdb/iterator.hpp | 2 +- nano/store/lmdb/lmdb.hpp | 2 +- nano/store/lmdb/online_weight.hpp | 2 +- nano/store/lmdb/peer.hpp | 2 +- nano/store/lmdb/pending.hpp | 2 +- nano/store/lmdb/pruned.hpp | 2 +- nano/store/lmdb/rep_weight.hpp | 2 +- nano/store/lmdb/transaction_impl.hpp | 2 +- nano/store/lmdb/version.hpp | 2 +- nano/store/lmdb/wallet_value.cpp | 2 + nano/store/lmdb/wallet_value.hpp | 2 +- nano/store/versioning.cpp | 2 +- 35 files changed, 140 insertions(+), 290 deletions(-) delete mode 100644 .gitmodules delete mode 100755 boost_checkout_lite.sh diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index c1d9a0bf26..0000000000 --- a/.gitmodules +++ /dev/null @@ -1,39 +0,0 @@ -[submodule "miniupnp"] - path = submodules/miniupnp - url = https://github.com/miniupnp/miniupnp.git -[submodule "lmdb"] - path = submodules/lmdb - url = https://github.com/LMDB/lmdb.git -[submodule "cryptopp"] - path = submodules/cryptopp - url = https://github.com/weidai11/cryptopp.git -[submodule "phc-winner-argon2"] - path = submodules/phc-winner-argon2 - url = https://github.com/nanocurrency/phc-winner-argon2.git -[submodule "gtest"] - path = submodules/gtest - url = https://github.com/google/googletest.git -[submodule "cpptoml"] - path = submodules/cpptoml - url = https://github.com/cryptocode/cpptoml.git -[submodule "flatbuffers"] - path = submodules/flatbuffers - url = https://github.com/google/flatbuffers.git -[submodule "rocksdb"] - path = submodules/rocksdb - url = https://github.com/facebook/rocksdb.git -[submodule "boost"] - path = submodules/boost - url = https://github.com/boostorg/boost.git -[submodule "magic_enum"] - path = submodules/magic_enum - url = https://github.com/Neargye/magic_enum.git -[submodule "submodules/gtest-parallel"] - path = submodules/gtest-parallel - url = https://github.com/google/gtest-parallel.git -[submodule "submodules/spdlog"] - path = submodules/spdlog - url = https://github.com/gabime/spdlog.git -[submodule "submodules/fmt"] - path = submodules/fmt - url = https://github.com/fmtlib/fmt.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 10d92541ca..cc46eb7673 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.27) if(CMAKE_VERSION VERSION_GREATER 3.12 OR CMAKE_VERSION VERSION_EQUAL 3.12) # find_package uses _ROOT variables @@ -223,6 +223,8 @@ endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) +find_package(PkgConfig REQUIRED) + find_package(Threads) # Sanitizers @@ -399,107 +401,50 @@ endif() include_directories(${CMAKE_SOURCE_DIR}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules") -set(Boost_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/submodules/boost/libs/config/include) -set(BOOST_MODULE_LIBS - algorithm - align - any - array - asio - assert - atomic - beast - bind - chrono - circular_buffer - concept_check - config - container - container_hash - context - conversion - core - coroutine - date_time - describe - detail - dll - dynamic_bitset - endian - exception +set(Boost_USE_STATIC_LIBS OFF) +set(Boost_USE_STATIC_RUNTIME OFF) +set(Boost_NO_BOOST_CMAKE ON) +add_definitions(-DBOOST_ALL_DYN_LINK) +set(Boost_USE_STATIC_LIBS OFF) +set(Boost_USE_STATIC_RUNTIME OFF) +set(Boost_NO_BOOST_CMAKE ON) +add_definitions(-DBOOST_ALL_DYN_LINK) +set(Boost_USE_MULTITHREADED ON) +# Could NOT find Boost (missing: beast circular_buffer process) (found +set(Boost_NO_BOOST_CMAKE ON) +find_package(Boost 1.70.0 REQUIRED + COMPONENTS filesystem - foreach - format - function - function_types - functional - fusion - integer - interprocess - intrusive - io iostreams - iterator - lexical_cast - property_tree log - logic - math - move - mp11 - mpl - multi_index - multiprecision - numeric/conversion - optional - parameter - phoenix - pool - predef - preprocessor - process + log_setup + thread program_options - proto - random - range - ratio - rational - regex - serialization - smart_ptr - spirit - stacktrace - static_assert - static_string system - thread - throw_exception - tokenizer - tuple - type_index - type_traits - typeof - unordered - utility - variant - variant2 - winapi) - -add_definitions(-DBOOST_ALL_NO_LIB) # Disable automatic boost linking -foreach(lib IN LISTS BOOST_MODULE_LIBS) - add_subdirectory(submodules/boost/libs/${lib} EXCLUDE_FROM_ALL) -endforeach() + # Boost::boost + #asio + #beast + #circular_buffer + #endian + #process + #stacktrace +) +#set(Boost_USE_MULTITHREADED ON) + +#add_library(boost_circular_buffer INTERFACE) +#add_library(Boost::circular_buffer ALIAS boost_circular_buffer) + include_directories(${BOOST_LIBRARY_INCLUDES}) -add_library(Boost::stacktrace ALIAS boost_stacktrace_basic) +#add_library(Boost::stacktrace ALIAS boost_stacktrace_basic) add_definitions(-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED) # Workaround for missing reference errata in the boost property_tree module -target_link_libraries(boost_property_tree INTERFACE Boost::any) -target_link_libraries(boost_property_tree INTERFACE Boost::format) -target_link_libraries(boost_property_tree INTERFACE Boost::multi_index) +#target_link_libraries(boost_property_tree INTERFACE Boost::any) +#target_link_libraries(boost_property_tree INTERFACE Boost::format) +#target_link_libraries(boost_property_tree INTERFACE Boost::multi_index) # RocksDB -include_directories(submodules/rocksdb/include) +#include_directories(submodules/rocksdb/include) set(USE_RTTI ON CACHE BOOL "") @@ -530,13 +475,19 @@ else() 1 CACHE BOOL "" FORCE) endif() -add_subdirectory(submodules/rocksdb EXCLUDE_FROM_ALL) +#add_subdirectory(submodules/rocksdb EXCLUDE_FROM_ALL) +find_package(RocksDB REQUIRED) +include_directories(${ROCKSDB_LIBRARY_INCLUDES}) # cpptoml -include_directories(submodules/cpptoml/include) +#include_directories(submodules/cpptoml/include) +find_package(cpptoml REQUIRED) +include_directories(${CPPTOML_LIBRARY_INCLUDES}) # magic_enum -include_directories(submodules/magic_enum/include/magic_enum) +#include_directories(submodules/magic_enum/include/magic_enum) +find_package(magic_enum REQUIRED) +include_directories(${MAGIC_ENUM_LIBRARY_INCLUDES}) add_subdirectory(crypto/ed25519-donna) @@ -544,19 +495,22 @@ add_subdirectory(nano/ipc_flatbuffers_lib) add_subdirectory(nano/ipc_flatbuffers_test) # fmt -add_subdirectory(submodules/fmt EXCLUDE_FROM_ALL) -include_directories(submodules/fmt/include) +#add_subdirectory(submodules/fmt EXCLUDE_FROM_ALL) +#include_directories(submodules/fmt/include) +find_package(fmt REQUIRED) +include_directories(${FMT_LIBRARY_INCLUDES}) # spdlog add_definitions(-DSPDLOG_FMT_EXTERNAL) -add_subdirectory(submodules/spdlog EXCLUDE_FROM_ALL) -include_directories(submodules/spdlog/include) +#add_subdirectory(submodules/spdlog EXCLUDE_FROM_ALL) +#include_directories(submodules/spdlog/include) +find_package(spdlog REQUIRED) +include_directories(${SPDLOG_LIBRARY_INCLUDES}) # miniupnp -set(UPNPC_BUILD_SHARED - OFF - CACHE BOOL "") -add_subdirectory(submodules/miniupnp/miniupnpc EXCLUDE_FROM_ALL) +#add_subdirectory(submodules/miniupnp/miniupnpc EXCLUDE_FROM_ALL) +find_package(miniupnpc REQUIRED) +include_directories(${MINIUPNPC_LIBRARY_INCLUDES}) set(BUILD_SHARED OFF @@ -567,15 +521,11 @@ set(BUILD_TESTING set(USE_INTERMEDIATE_OBJECTS_TARGET OFF CACHE BOOL "") -set(CRYPTOPP_EXTRA "") if(WIN32) add_definitions(-DCRYPTOPP_DISABLE_ASM -DCRYPTOPP_DISABLE_SSSE3 -DCRYPTOPP_DISABLE_AESNI) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND (NANO_SIMD_OPTIMIZATIONS OR RAIBLOCKS_SIMD_OPTIMIZATIONS)) - set(CRYPTOPP_EXTRA - submodules/cryptopp/crc_simd.cpp submodules/cryptopp/gcm_simd.cpp - submodules/cryptopp/gf2n_simd.cpp submodules/cryptopp/neon_simd.cpp) add_definitions(-DCRYPTOPP_NO_CPU_FEATURE_PROBES) endif() # Some Clang cannot handle mixed asm with positional arguments, where the body @@ -594,83 +544,20 @@ add_definitions(-DCRYPTOPP_DISABLE_SHANI) # https://github.com/weidai11/cryptopp/commit/df9fa62205f2d341e2b1b26595a3a1b6377c60c5 add_definitions(-DCRYPTOPP_DISABLE_CLMUL) -set(CRYPTOPP_LIBRARY cryptopp) -add_library( - cryptopp - submodules/cryptopp/aes.h - submodules/cryptopp/algparam.cpp - submodules/cryptopp/allocate.cpp - submodules/cryptopp/asn.cpp - submodules/cryptopp/basecode.cpp - submodules/cryptopp/cpu.cpp - submodules/cryptopp/cryptlib.cpp - submodules/cryptopp/default.cpp - submodules/cryptopp/des.cpp - submodules/cryptopp/dessp.cpp - submodules/cryptopp/dll.cpp - submodules/cryptopp/ec2n.cpp - submodules/cryptopp/ecp.cpp - submodules/cryptopp/filters.cpp - submodules/cryptopp/fips140.cpp - submodules/cryptopp/gcm.cpp - submodules/cryptopp/gf2n.cpp - submodules/cryptopp/gfpcrypt.cpp - submodules/cryptopp/hex.cpp - submodules/cryptopp/hmac.cpp - submodules/cryptopp/hrtimer.cpp - submodules/cryptopp/integer.cpp - submodules/cryptopp/iterhash.cpp - submodules/cryptopp/misc.h - submodules/cryptopp/misc.cpp - submodules/cryptopp/modes.h - submodules/cryptopp/modes.cpp - submodules/cryptopp/mqueue.cpp - submodules/cryptopp/nbtheory.cpp - submodules/cryptopp/oaep.cpp - submodules/cryptopp/osrng.h - submodules/cryptopp/osrng.cpp - submodules/cryptopp/pubkey.cpp - submodules/cryptopp/queue.cpp - submodules/cryptopp/randpool.cpp - submodules/cryptopp/rdtables.cpp - submodules/cryptopp/rijndael.cpp - submodules/cryptopp/rijndael_simd.cpp - submodules/cryptopp/rng.cpp - submodules/cryptopp/sha.cpp - submodules/cryptopp/sha_simd.cpp - submodules/cryptopp/simple.cpp - submodules/cryptopp/sse_simd.cpp - submodules/cryptopp/seckey.h - submodules/cryptopp/siphash.h - submodules/cryptopp/words.h - ${CRYPTOPP_EXTRA}) - -target_include_directories(cryptopp PUBLIC submodules) +# cryptopp +#find_package(libcryptopp REQUIRED) +pkg_check_modules(LIBCRYPTOPP REQUIRED libcryptopp) +include_directories(${LIBCRYPTOPP_LIBRARY_INCLUDES}) -if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86(_64)?)$") - set(ARGON_CORE submodules/phc-winner-argon2/src/opt.c) -else() - set(ARGON_CORE submodules/phc-winner-argon2/src/ref.c) -endif() +# argon2 +#find_package(libargon2 REQUIRED) +pkg_check_modules(LIBARGON2 REQUIRED libargon2) +include_directories(${LIBARGON2_ENUM_LIBRARY_INCLUDES}) -add_library( - argon2 - submodules/phc-winner-argon2/src/argon2.c - submodules/phc-winner-argon2/include/argon2.h - submodules/phc-winner-argon2/src/core.c - submodules/phc-winner-argon2/src/thread.c - submodules/phc-winner-argon2/src/encoding.c - ${ARGON_CORE}) - -target_include_directories(argon2 PUBLIC submodules/phc-winner-argon2/include) -target_include_directories(argon2 PUBLIC submodules/phc-winner-argon2/src) -target_include_directories(argon2 PUBLIC crypto/blake2) - -add_library( - lmdb - submodules/lmdb/libraries/liblmdb/lmdb.h - submodules/lmdb/libraries/liblmdb/mdb.c - submodules/lmdb/libraries/liblmdb/midl.c) +# lmdb +#find_package(lmdb REQUIRED) +pkg_check_modules(LMDB REQUIRED lmdb) +include_directories(${LMDB_ENUM_LIBRARY_INCLUDES}) if(WIN32) target_link_libraries(lmdb ntdll) @@ -729,13 +616,15 @@ if(NANO_TEST OR RAIBLOCKS_TEST) # FIXME: This fixes googletest GOOGLETEST_VERSION requirement set(GOOGLETEST_VERSION 1.11.0) - add_subdirectory(submodules/gtest/googletest) + #add_subdirectory(submodules/gtest/googletest) # FIXME: This fixes gtest include directories without modifying gtest's # CMakeLists.txt. Ideally we should use GTest::GTest and GTest::Main as # dependencies but it requires building gtest differently - set_target_properties( - gtest PROPERTIES INTERFACE_INCLUDE_DIRECTORIES - "${CMAKE_SOURCE_DIR}/submodules/gtest/googletest/include") + #set_target_properties( + # gtest PROPERTIES INTERFACE_INCLUDE_DIRECTORIES + # "${CMAKE_SOURCE_DIR}/submodules/gtest/googletest/include") + find_package(GTest REQUIRED) + include_directories(${GTEST_LIBRARY_INCLUDES}) add_subdirectory(nano/test_common) add_subdirectory(nano/core_test) @@ -784,7 +673,7 @@ if(NANO_GUI OR RAIBLOCKS_GUI) node secure nano_lib - libminiupnpc-static + miniupnpc Qt5::Gui Qt5::Widgets) @@ -816,7 +705,8 @@ if(NANO_GUI OR RAIBLOCKS_GUI) nano_wallet ${PLATFORM_GUI_TARGET_PROPERTIES} ${PLATFORM_WALLET_SOURCE} nano/nano_wallet/entry.cpp nano/nano_wallet/icon.hpp ${RES}) - target_link_libraries(nano_wallet Boost::process rpc node qt) + #target_link_libraries(nano_wallet Boost::process rpc node qt) + target_link_libraries(nano_wallet Boost::boost rpc node qt) if(WIN32) target_link_libraries(nano_wallet Qt5::WinExtras) diff --git a/boost_checkout_lite.sh b/boost_checkout_lite.sh deleted file mode 100755 index 18fe59588f..0000000000 --- a/boost_checkout_lite.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -#set -x -#Check out boost submodule with minimum set of modules to reduce size - -# flattened boost libs dependency list -dependencies=("algorithm" "align" "any" "array" "asio" "assert" "atomic" "beast" "bind" "chrono" "circular_buffer" "concept_check" "config" "container" "container_hash" "context" "conversion" "core" "coroutine" "date_time" "describe" "detail" "dll" "dynamic_bitset" "endian" "exception" "filesystem" "foreach" "format" "function" "function_types" "functional" "fusion" "integer" "interprocess" "intrusive" "io" "iostreams" "iterator" "lexical_cast" "log" "logic" "math" "move" "mp11" "mpl" "multi_index" "multiprecision" "numeric_conversion" "optional" "parameter" "phoenix" "pool" "predef" "preprocessor" "process" "program_options" "property_tree" "proto" "random" "range" "ratio" "rational" "regex" "serialization" "smart_ptr" "spirit" "stacktrace" "static_assert" "static_string" "system" "thread" "throw_exception" "tokenizer" "tuple" "type_index" "type_traits" "typeof" "unordered" "utility" "variant" "variant2" "winapi") - -git submodule init boost -cd boost -# deactivate all boost submodules -git submodule foreach 'git config submodule.$sm_path.active false' -# selectively activate required dependencies -for i in ${dependencies[@]} -do - git config submodule.$i.active true -done -cd .. -# Update all submodules recursively. Deactivated modules will be skipped by --recursive -git submodule update --jobs 16 --recursive --recommend-shallow --single-branch diff --git a/nano/ipc_flatbuffers_lib/CMakeLists.txt b/nano/ipc_flatbuffers_lib/CMakeLists.txt index f5323c47e5..8012929596 100644 --- a/nano/ipc_flatbuffers_lib/CMakeLists.txt +++ b/nano/ipc_flatbuffers_lib/CMakeLists.txt @@ -21,8 +21,12 @@ mark_as_advanced( FLATBUFFERS_PACKAGE_DEBIAN FLATBUFFERS_PACKAGE_REDHAT FLATBUFFERS_STATIC_FLATC) -add_subdirectory(../../submodules/flatbuffers - ${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build EXCLUDE_FROM_ALL) + +# add_subdirectory(../../submodules/flatbuffers +# ${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build EXCLUDE_FROM_ALL) + +find_package(flatbuffers REQUIRED) +include_directories(${FLATBUFFERS_LIBRARY_INCLUDES}) # Generate Flatbuffers files into the ipc_flatbuffers_lib library, which will be # rebuilt whenever any of the fbs files change. Note that while this supports @@ -59,7 +63,7 @@ foreach(file ${files}) OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/generated/flatbuffers/${flatbuffers_filename}_generated.h COMMAND - "$" --force-empty-vectors --reflect-names --gen-mutable + flatc --force-empty-vectors --reflect-names --gen-mutable --gen-name-strings --gen-object-api --strict-json --cpp -o ${CMAKE_CURRENT_SOURCE_DIR}/generated/flatbuffers ${CMAKE_CURRENT_SOURCE_DIR}/../../api/flatbuffers/${flatbuffers_filename}.fbs diff --git a/nano/lib/CMakeLists.txt b/nano/lib/CMakeLists.txt index 144e1adfd4..ad181e11e0 100644 --- a/nano/lib/CMakeLists.txt +++ b/nano/lib/CMakeLists.txt @@ -123,13 +123,14 @@ target_link_libraries( fmt::fmt spdlog::spdlog Boost::iostreams - Boost::asio - Boost::circular_buffer - Boost::dll - Boost::multiprecision + Boost::boost # asio + #Boost::boost # circular_buffer + #Boost::boost # dll + #Boost::boost # multiprecision Boost::program_options - Boost::property_tree - Boost::stacktrace) + #Boost::boost # property_tree + #Boost::boost # stacktrace +) if(NANO_STACKTRACE_BACKTRACE) target_link_libraries(nano_lib backtrace) diff --git a/nano/lib/logging.cpp b/nano/lib/logging.cpp index 0953007fa0..80c1de3e24 100644 --- a/nano/lib/logging.cpp +++ b/nano/lib/logging.cpp @@ -12,6 +12,8 @@ #include #include +#include + nano::logger & nano::default_logger () { static nano::logger logger{ "default" }; @@ -588,4 +590,4 @@ nano::log::logger_id nano::log::parse_logger_id (const std::string & logger_name return { nano::log::parse_type (parts[0]), nano::log::parse_detail (parts[1]) }; } throw std::invalid_argument ("Invalid logger name: " + logger_name); -} \ No newline at end of file +} diff --git a/nano/lib/stats.cpp b/nano/lib/stats.cpp index fa3bd13146..f0caf613d4 100644 --- a/nano/lib/stats.cpp +++ b/nano/lib/stats.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -446,4 +447,4 @@ nano::error nano::stats_config::deserialize_toml (nano::tomlconfig & toml) } return toml.get_error (); -} \ No newline at end of file +} diff --git a/nano/lib/threading.cpp b/nano/lib/threading.cpp index 504c2628d8..31f77102b1 100644 --- a/nano/lib/threading.cpp +++ b/nano/lib/threading.cpp @@ -3,6 +3,7 @@ #include #include +#include #include /* diff --git a/nano/load_test/CMakeLists.txt b/nano/load_test/CMakeLists.txt index 0864ac6cfe..79ac9e9cd2 100644 --- a/nano/load_test/CMakeLists.txt +++ b/nano/load_test/CMakeLists.txt @@ -1,6 +1,7 @@ add_executable(load_test entry.cpp) -target_link_libraries(load_test test_common Boost::process) +#target_link_libraries(load_test test_common Boost::process) +target_link_libraries(load_test test_common Boost::boost) include_directories(${CMAKE_SOURCE_DIR}/submodules) include_directories(${CMAKE_SOURCE_DIR}/submodules/gtest/googletest/include) diff --git a/nano/nano_node/CMakeLists.txt b/nano/nano_node/CMakeLists.txt index 48d42d3586..6656daf86e 100644 --- a/nano/nano_node/CMakeLists.txt +++ b/nano/nano_node/CMakeLists.txt @@ -1,6 +1,7 @@ add_executable(nano_node daemon.cpp daemon.hpp entry.cpp) -target_link_libraries(nano_node node Boost::process ${PLATFORM_LIBS}) +#target_link_libraries(nano_node node Boost::process ${PLATFORM_LIBS}) +target_link_libraries(nano_node node Boost::boost ${PLATFORM_LIBS}) include_directories(${CMAKE_SOURCE_DIR}/submodules) diff --git a/nano/node/CMakeLists.txt b/nano/node/CMakeLists.txt index 4cafc54bde..15926d6914 100644 --- a/nano/node/CMakeLists.txt +++ b/nano/node/CMakeLists.txt @@ -206,12 +206,14 @@ target_link_libraries( nano_store secure rpc - libminiupnpc-static + miniupnpc + cryptopp argon2 lmdb - Boost::beast + Boost::boost # beast + Boost::filesystem Boost::program_options - Boost::stacktrace + #Boost::boost # stacktrace Boost::system Boost::thread rocksdb diff --git a/nano/node/ipc/flatbuffers_handler.cpp b/nano/node/ipc/flatbuffers_handler.cpp index 6589298d66..c6b654e995 100644 --- a/nano/node/ipc/flatbuffers_handler.cpp +++ b/nano/node/ipc/flatbuffers_handler.cpp @@ -100,7 +100,7 @@ std::function const &)> const & response_hand process (parser->builder_.GetBufferPointer (), parser->builder_.GetSize (), [parser = parser, response_handler] (std::shared_ptr const & fbb) { // Convert response to JSON auto json (std::make_shared ()); - if (!flatbuffers::GenerateText (*parser, fbb->GetBufferPointer (), json.get ())) + if (!flatbuffers::GenText (*parser, fbb->GetBufferPointer (), json.get ())) { throw nano::error ("Couldn't serialize response to JSON"); } diff --git a/nano/node/ipc/flatbuffers_handler.hpp b/nano/node/ipc/flatbuffers_handler.hpp index 8437d6e952..e302729cde 100644 --- a/nano/node/ipc/flatbuffers_handler.hpp +++ b/nano/node/ipc/flatbuffers_handler.hpp @@ -1,5 +1,7 @@ #pragma once +#include + #include #include #include @@ -7,7 +9,6 @@ namespace flatbuffers { -class FlatBufferBuilder; class Parser; } namespace nano diff --git a/nano/node/ipc/ipc_broker.cpp b/nano/node/ipc/ipc_broker.cpp index 15ba718cca..0ea8c6ecf9 100644 --- a/nano/node/ipc/ipc_broker.cpp +++ b/nano/node/ipc/ipc_broker.cpp @@ -190,7 +190,7 @@ void nano::ipc::broker::broadcast (std::shared_ptr // Convert response to JSON auto json (std::make_shared ()); - if (!flatbuffers::GenerateText (*parser, fb->GetBufferPointer (), json.get ())) + if (!flatbuffers::GenText (*parser, fb->GetBufferPointer (), json.get ())) { throw nano::error ("Couldn't serialize response to JSON"); } diff --git a/nano/node/portmapping.cpp b/nano/node/portmapping.cpp index 135c4bbadf..d95ba30c8e 100644 --- a/nano/node/portmapping.cpp +++ b/nano/node/portmapping.cpp @@ -2,8 +2,8 @@ #include #include -#include -#include +#include +#include #include diff --git a/nano/node/portmapping.hpp b/nano/node/portmapping.hpp index 6e47dd1395..d890bde0d7 100644 --- a/nano/node/portmapping.hpp +++ b/nano/node/portmapping.hpp @@ -2,7 +2,7 @@ #include -#include +#include #include diff --git a/nano/rpc/CMakeLists.txt b/nano/rpc/CMakeLists.txt index 6b62ad6111..8445b1d85a 100644 --- a/nano/rpc/CMakeLists.txt +++ b/nano/rpc/CMakeLists.txt @@ -9,4 +9,5 @@ add_library( rpc_request_processor.hpp rpc_request_processor.cpp) -target_link_libraries(rpc nano_lib Boost::beast) +#target_link_libraries(rpc nano_lib Boost::beast) +target_link_libraries(rpc nano_lib Boost::boost) diff --git a/nano/store/CMakeLists.txt b/nano/store/CMakeLists.txt index 68cde103a1..60038461f2 100644 --- a/nano/store/CMakeLists.txt +++ b/nano/store/CMakeLists.txt @@ -99,10 +99,11 @@ add_library( target_link_libraries( nano_store nano_lib - Boost::circular_buffer - Boost::endian + Boost::boost # circular_buffer + #Boost::boost # endian Boost::iostreams - Boost::multiprecision - Boost::pool - Boost::stacktrace - Boost::variant) + #Boost::boost # multiprecision + #Boost::boost # pool + #Boost::boost # stacktrace + #Boost::boost # variant +) diff --git a/nano/store/lmdb/account.hpp b/nano/store/lmdb/account.hpp index 6faaf3cfe8..287fe9bdcf 100644 --- a/nano/store/lmdb/account.hpp +++ b/nano/store/lmdb/account.hpp @@ -2,7 +2,7 @@ #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/block.hpp b/nano/store/lmdb/block.hpp index 575803d831..55679773d3 100644 --- a/nano/store/lmdb/block.hpp +++ b/nano/store/lmdb/block.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/confirmation_height.hpp b/nano/store/lmdb/confirmation_height.hpp index 4674f81137..c921fb92ab 100644 --- a/nano/store/lmdb/confirmation_height.hpp +++ b/nano/store/lmdb/confirmation_height.hpp @@ -2,7 +2,7 @@ #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/db_val.hpp b/nano/store/lmdb/db_val.hpp index 3b4966f5c7..3c02fd0b3d 100644 --- a/nano/store/lmdb/db_val.hpp +++ b/nano/store/lmdb/db_val.hpp @@ -2,7 +2,7 @@ #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/final_vote.hpp b/nano/store/lmdb/final_vote.hpp index 92fc5253fd..7e204eff30 100644 --- a/nano/store/lmdb/final_vote.hpp +++ b/nano/store/lmdb/final_vote.hpp @@ -2,7 +2,7 @@ #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/iterator.hpp b/nano/store/lmdb/iterator.hpp index ff7cb0977c..b7c631502f 100644 --- a/nano/store/lmdb/iterator.hpp +++ b/nano/store/lmdb/iterator.hpp @@ -6,7 +6,7 @@ #include #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/lmdb.hpp b/nano/store/lmdb/lmdb.hpp index 8cf9d94bc3..b99ecb40b5 100644 --- a/nano/store/lmdb/lmdb.hpp +++ b/nano/store/lmdb/lmdb.hpp @@ -24,7 +24,7 @@ #include -#include +#include namespace nano { diff --git a/nano/store/lmdb/online_weight.hpp b/nano/store/lmdb/online_weight.hpp index 0567c63d9b..9d2bc2f996 100644 --- a/nano/store/lmdb/online_weight.hpp +++ b/nano/store/lmdb/online_weight.hpp @@ -2,7 +2,7 @@ #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/peer.hpp b/nano/store/lmdb/peer.hpp index 8197c00bee..bffab2c92f 100644 --- a/nano/store/lmdb/peer.hpp +++ b/nano/store/lmdb/peer.hpp @@ -2,7 +2,7 @@ #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/pending.hpp b/nano/store/lmdb/pending.hpp index 13cd9172d2..02955bfe17 100644 --- a/nano/store/lmdb/pending.hpp +++ b/nano/store/lmdb/pending.hpp @@ -2,7 +2,7 @@ #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/pruned.hpp b/nano/store/lmdb/pruned.hpp index 0aa2d7fc20..d1b4a69aed 100644 --- a/nano/store/lmdb/pruned.hpp +++ b/nano/store/lmdb/pruned.hpp @@ -2,7 +2,7 @@ #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/rep_weight.hpp b/nano/store/lmdb/rep_weight.hpp index 2a6ef53c5c..fe996ed9ad 100644 --- a/nano/store/lmdb/rep_weight.hpp +++ b/nano/store/lmdb/rep_weight.hpp @@ -2,7 +2,7 @@ #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/transaction_impl.hpp b/nano/store/lmdb/transaction_impl.hpp index 06a4e1d414..ae290104d6 100644 --- a/nano/store/lmdb/transaction_impl.hpp +++ b/nano/store/lmdb/transaction_impl.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/version.hpp b/nano/store/lmdb/version.hpp index 7ec10b8183..0ec2ae7b3c 100644 --- a/nano/store/lmdb/version.hpp +++ b/nano/store/lmdb/version.hpp @@ -2,7 +2,7 @@ #include -#include +#include namespace nano::store::lmdb { diff --git a/nano/store/lmdb/wallet_value.cpp b/nano/store/lmdb/wallet_value.cpp index 60aefabe25..0115ac8e0d 100644 --- a/nano/store/lmdb/wallet_value.cpp +++ b/nano/store/lmdb/wallet_value.cpp @@ -4,6 +4,8 @@ nano::wallet_value::wallet_value (nano::store::db_val const & val_a) { debug_assert (val_a.size () == sizeof (*this)); std::copy (reinterpret_cast (val_a.data ()), reinterpret_cast (val_a.data ()) + sizeof (key), key.chars.begin ()); + // NOTE gcc bug: warning: writing 1 byte into a region of size 0 + // https://stackoverflow.com/questions/75184243 std::copy (reinterpret_cast (val_a.data ()) + sizeof (key), reinterpret_cast (val_a.data ()) + sizeof (key) + sizeof (work), reinterpret_cast (&work)); } diff --git a/nano/store/lmdb/wallet_value.hpp b/nano/store/lmdb/wallet_value.hpp index d272ae96d4..4190427354 100644 --- a/nano/store/lmdb/wallet_value.hpp +++ b/nano/store/lmdb/wallet_value.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include namespace nano { diff --git a/nano/store/versioning.cpp b/nano/store/versioning.cpp index 16433e0982..9a568f06f1 100644 --- a/nano/store/versioning.cpp +++ b/nano/store/versioning.cpp @@ -2,4 +2,4 @@ #include -#include +#include