refactor: Organize libspark proj w/ stuttering include

This new structure provides several benefits:

* Allows us to install multiple CMake projects in the same destination
  dir (without include path conflicts).
  - This makes shipping the trading algo sdk a trivial excercise. Simply
    copy the lib and include dirs from the install dest. That's it!
* Puts us in a position to break up the monolithic libspark into smaller
  modules, which are easier to manage.
This commit is contained in:
John Colvin committed 2024-10-21 13:39:59 +00:00
1 parent 5d0b8ac1ab
commit 13bd79de75
1726 files changed
+5875 -6856

No files matched your search

+5 -5
View File
@@ -215,12 +215,12 @@
"preLaunchTask": "Build Sparkd (Debug | Clang)",
"program": "",
"linux": {
"program": "${workspaceFolder}/build/sparkd-debug-clang/server/sparkd",
"program": "${workspaceFolder}/build/sparkd-debug-clang/src/app_sparkd/sparkd",
},
"args": [
"run"
],
"cwd": "${workspaceFolder}/build/sparkd-debug-clang/server",
"cwd": "${workspaceFolder}/build/sparkd-debug-clang/src/app_sparkd",
"stopAtEntry": false,
"externalConsole": false,
"MIMode": "gdb",
@@ -243,12 +243,12 @@
"request": "launch",
"program": "",
"linux": {
"program": "${workspaceFolder}/build/sparkd-debug-clang/server/sparkd",
"program": "${workspaceFolder}/build/sparkd-debug-clang/src/app_sparkd/sparkd",
},
"args": [
"run"
],
"cwd": "${workspaceFolder}/build/sparkd-debug-clang/server",
"cwd": "${workspaceFolder}/build/sparkd-debug-clang/src/app_sparkd",
"stopAtEntry": false,
"externalConsole": false,
"MIMode": "gdb",
@@ -264,7 +264,7 @@
"ignoreFailures": true
}
]
}
},
],
"inputs": [
{
+8 -44
View File
@@ -19,9 +19,9 @@ set(
# can run simultaneously without fighting over the same shm files (e.g., sparkd,
# api server, etc.).
set(SHARED_MEMORY_PREFIX "bts" CACHE STRING "Prefix to use when creating shared memory files")
set(SPARK_BIN "${EXTERNALS_ROOT}/bin")
set(SPARK_INCLUDE "${EXTERNALS_ROOT}/include")
set(SPARK_LIB "${EXTERNALS_ROOT}/lib/$<CONFIG>")
set(EXTERNALS_BIN "${EXTERNALS_ROOT}/bin")
set(EXTERNALS_INCLUDE "${EXTERNALS_ROOT}/include")
set(EXTERNALS_LIB "${EXTERNALS_ROOT}/lib/$<CONFIG>")
set(BUILD_DOCS OFF CACHE BOOL "Build documentation")
set(BUILD_SDK OFF CACHE BOOL "Build the sdk")
set(EXPORT_MD_CONSUMER OFF CACHE BOOL "Export (extern) C functions for MD consumer interop")
@@ -33,8 +33,8 @@ else()
set(BUILD_ADMIN_WEB_APP ON CACHE BOOL "Build the Admin WebApp")
endif()
include_directories(BEFORE SYSTEM ${SPARK_INCLUDE} ${EXTERNALS_ROOT}/include/zlib)
link_directories(${SPARK_LIB})
include_directories(BEFORE SYSTEM ${EXTERNALS_INCLUDE} ${EXTERNALS_ROOT}/include/zlib)
link_directories(${EXTERNALS_LIB})
add_compile_definitions(SHARED_MEMORY_PREFIX="${SHARED_MEMORY_PREFIX}")
if(DEFINED APP_DATA_DIR)
@@ -43,14 +43,8 @@ endif()
add_compile_definitions(EXPORT_MD_CONSUMER="${EXPORT_MD_CONSUMER}")
if(WIN32)
# subdirs
add_subdirectory(src/lib)
add_subdirectory(src/lib_spark)
else()
# make sparkd look for libspark.so in its directory
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH ".")
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install")
set(SPARK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/$<CONFIG>")
if(BUILD_SPARKD)
# Note: All macros that begin w/ 'CCAPI' are ccapi's macros (defined and/or
# read by their code). We override some below.
@@ -110,10 +104,10 @@ else()
# subdirs
if (BUILD_SPARKD)
add_subdirectory(src/server/sparkd)
add_subdirectory(src/app_sparkd)
add_subdirectory(src/data_files)
endif()
add_subdirectory(src/lib)
add_subdirectory(src/lib_spark)
if (BUILD_ADMIN_WEB_APP)
add_subdirectory(src/Spark.Admin.WebApp)
endif()
@@ -123,34 +117,4 @@ else()
if(BUILD_SDK)
add_subdirectory(src/sdk)
endif()
if(BUILD_SPARKD)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/server
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/server
COMMAND ln ARGS -sf ${CMAKE_BINARY_DIR}/src/server/sparkd/sparkd ${CMAKE_BINARY_DIR}/server
COMMAND ln ARGS -sf ${CMAKE_BINARY_DIR}/data_files ${CMAKE_BINARY_DIR}/server
COMMAND ln ARGS -sf ${CMAKE_BINARY_DIR}/src/lib/libspark.so ${CMAKE_BINARY_DIR}/server
COMMAND ln ARGS -sf ${EXTERNALS_ROOT}/lib/${CMAKE_BUILD_TYPE}/libonixs-fix-engine.so.4 ${CMAKE_BINARY_DIR}/server
COMMAND
ln ARGS -sf
${EXTERNALS_ROOT}/lib/Release/libOnixS.IceImpactMulticastPriceFeedHandlerCpp.so.3.16.0.0
${CMAKE_BINARY_DIR}/server
COMMAND ln ARGS -sf ${EXTERNALS_ROOT}/lib/Release/libACE-5.7.5.so ${CMAKE_BINARY_DIR}/server
COMMAND mkdir ARGS -p ${CMAKE_BINARY_DIR}/server/plugins
COMMENT "Creating server runtime layout"
DEPENDS sparkd data_files_dir)
add_custom_target(server_layout ALL DEPENDS ${CMAKE_BINARY_DIR}/server)
install(
DIRECTORY "${CMAKE_BINARY_DIR}/server/plugins"
DESTINATION "${SPARK_INSTALL_PREFIX}/bin")
install(
FILES
"${SPARK_LIB}/libACE-5.7.5.so"
"${SPARK_LIB}/libOnixS.IceImpactMulticastPriceFeedHandlerCpp.so.3.16.0.0"
DESTINATION "${SPARK_INSTALL_PREFIX}/bin")
endif()
endif()
+2 -18
View File
@@ -49,13 +49,8 @@
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"platform": "",
"CMAKE_BUILD_WITH_INSTALL_RPATH": {
"type": "BOOL",
"value": "ON"
},
"CMAKE_CXX_STANDARD": "20",
"CMAKE_INSTALL_RPATH": ".",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}/sparkd",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}",
"CMAKE_EXE_LINKER_FLAGS": "-Wno-undef",
"EXTERNALS_ROOT": "${sourceDir}/externals/linux",
"BUILD_SDK": {
@@ -171,7 +166,6 @@
"type": "BOOL",
"value": "ON"
},
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}",
"CONFIG_DEFAULTS_PATH": "config/profiles/default/*.conf",
"DOTNET_BINARY_DIR": "${sourceDir}/build/Spark.Api.Server/$<CONFIG>/bin/net7.0",
"EXPORT_MD_CONSUMER": {
@@ -244,7 +238,6 @@
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_FLAGS_DEBUG": "-g -fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers --std=c++20 -fdiagnostics-color -DDEBUG",
"CMAKE_CXX_FLAGS_RELEASE": "-fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers --std=c++20 -fdiagnostics-color -fno-omit-frame-pointer -DNDEBUG -O3",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}",
"CONFIG_DEFAULTS_PATH": "config/profiles/default/*.conf;config/profiles/data_stream/*.conf",
"CONFIG_PROFILES": "default;data_stream",
"DOTNET_BINARY_DIR": "${sourceDir}/build/$<CONFIG>/bin/net7.0;${sourceDir}/build/$<CONFIG>/bin/net8.0",
@@ -290,16 +283,7 @@
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"hidden": true,
"targets": [
"data_files_dir",
"admin_web_app_bundle",
"install",
"libspark",
"rapidjson_project",
"server_layout",
"sparkd"
]
"hidden": true
},
{
+7
View File
@@ -0,0 +1,7 @@
include_guard(GLOBAL)
macro(export_to_parent)
foreach(var IN ITEMS ${ARGN})
set(${var} ${${var}} PARENT_SCOPE)
endforeach()
endmacro()
+95
View File
@@ -0,0 +1,95 @@
include_guard(DIRECTORY)
include(${CMAKE_SOURCE_DIR}/cmake/ExportToParent.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/InstallBasic.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/SetFirstDefined.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/safe_dep_glob.cmake)
function(init_library)
set(_options SHARED STATIC)
set(_one_value_args NAME SOURCE_DIR INCLUDE_DIR)
set(_multi_value_args)
cmake_parse_arguments(_ARGS "${_options}" "${_one_value_args}" "${_multi_value_args}" ${ARGN})
if (_ARGS_SHARED AND _ARGS_STATIC)
message(FATAL_ERROR "Invalid args passed to init_library: cannot specify STATIC and SHARED")
endif()
set_first_defined(_name _ARGS_NAME PROJECT_NAME)
set_first_defined(_source_dir _ARGS_SOURCE_DIR _name)
set_first_defined(_include_dir _ARGS_INCLUDE_DIR _source_dir)
# Cpp sources
file(
GLOB_RECURSE ${_name}_SOURCES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${_source_dir}/*.cpp
)
# Note: cpp files inside 'tests' dir(s) are considered tests.
# Remove tests from main sources, and add them to test sources
foreach(item ${${_name}_SOURCES})
if(${item} MATCHES "tests/.*\.cpp$")
list(APPEND ${_name}_TEST_SOURCES ${item})
endif()
endforeach()
foreach(item ${${_name}_TEST_SOURCES})
list(REMOVE_ITEM ${_name}_SOURCES ${item})
endforeach()
export_to_parent(
${_name}_SOURCES
${_name}_TEST_SOURCES
)
# Add main lib
if (_ARGS_STATIC)
add_library(${_name} STATIC ${${_name}_SOURCES})
elseif(_ARGS_SHARED)
add_library(${_name} SHARED ${${_name}_SOURCES})
else()
add_library(${_name} ${${_name}_SOURCES})
endif()
target_include_directories(
${_name}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_directories(
${_name}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}>
)
# Install main lib
install_basic(
NAME ${_name}
INCLUDE_DIR ${_include_dir}
)
# Add tests executable (if there are any)
if (${_name}_TEST_SOURCES)
add_executable(${_name}-tests ${${_name}_TEST_SOURCES})
get_target_property(_lib_type ${_name} TYPE)
if (_lib_type STREQUAL "SHARED_LIBRARY")
# Set RPATH so the tests exe knows where to find the shared lib.
set_target_properties(
${_name}-tests
PROPERTIES
BUILD_RPATH "$ORIGIN"
INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
)
endif()
# Link main lib
target_link_directories(
${_name}-tests
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}>
)
target_link_libraries(${_name}-tests PRIVATE ${_name})
# Catch2
find_package(Catch2 CONFIG REQUIRED COMPONENTS Catch2WithMain)
target_link_libraries(${_name}-tests PRIVATE Catch2::Catch2WithMain)
endif()
endfunction()
+39
View File
@@ -0,0 +1,39 @@
include_guard(DIRECTORY)
include(GNUInstallDirs)
include(${CMAKE_SOURCE_DIR}/cmake/PackBasic.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/SetFirstDefined.cmake)
function(install_basic)
set(_options)
set(_one_value_args NAME INCLUDE_DIR)
set(_multi_value_args)
cmake_parse_arguments(_ARGS "${_options}" "${_one_value_args}" "${_multi_value_args}" ${ARGN})
set_first_defined(_name _ARGS_NAME PROJECT_NAME)
set_first_defined(_include_dir _ARGS_INCLUDE_DIR _name)
file(
GLOB_RECURSE ${_name}_HEADERS
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${_include_dir}/*.h)
target_sources(${_name}
PUBLIC
FILE_SET HEADERS FILES ${${_name}_HEADERS})
install(
TARGETS ${_name}
EXPORT ${_name}Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
EXPORT ${_name}Targets
FILE ${_name}Targets.cmake
NAMESPACE ${_name}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${_name})
pack_basic()
endfunction()
+44
View File
@@ -0,0 +1,44 @@
include_guard(DIRECTORY)
include(CMakePackageConfigHelpers)
include(${CMAKE_SOURCE_DIR}/cmake/SetFirstDefined.cmake)
function(pack_basic)
set(_options)
set(_one_value_args NAME)
set(_multi_value_args)
cmake_parse_arguments(_ARGS "${_options}" "${_one_value_args}" "${_multi_value_args}" ${ARGN})
set_first_defined(_name _ARGS_NAME PROJECT_NAME)
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
if(NOT GIT_FOUND OR PROJECT_VERSION STREQUAL "")
set(PROJECT_VERSION "0.0.0")
endif()
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${_name}ConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${_name}Config.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${_name}
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${_name}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${_name}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${_name})
endfunction()
+82 -63
View File
@@ -1,12 +1,23 @@
set(Protobuf_PROTOC_EXECUTABLE "${SPARK_BIN}/protoc")
set(PROTOBUF_INCLUDE_DIRS "${SPARK_INCLUDE}")
set(Protobuf_PROTOC_EXECUTABLE "${EXTERNALS_BIN}/protoc")
set(PROTOBUF_INCLUDE_DIRS "${EXTERNALS_INCLUDE}")
set(PROTOBUF_STATIC_LIB "libprotobuf")
set(_protobuf_src_dir ${CMAKE_SOURCE_DIR}/src/lib_spark)
set(_protobuf_bin_dir ${CMAKE_BINARY_DIR}/src/lib_spark)
function(Protobuf_Generate_Cpp SRCS HDRS)
set(${SRCS})
set(${HDRS})
function(Protobuf_Generate_Cpp)
set(_options)
set(_one_value_args CXX_SOURCES CXX_HEADERS CXX_OUT_DIR)
set(_multi_value_args PROTO_INCLUDE_DIRS PROTO_SOURCES)
cmake_parse_arguments(_ARGS "${_options}" "${_one_value_args}" "${_multi_value_args}" ${ARGN})
set(${_ARGS_CXX_SOURCES})
set(${_ARGS_CXX_HEADERS})
foreach(FIL ${ARGN})
set(_proto_include_cli_args)
foreach(_dir ${_ARGS_PROTO_INCLUDE_DIRS})
list(APPEND _proto_include_cli_args -I ${_dir})
endforeach()
foreach(FIL ${_ARGS_PROTO_SOURCES})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
get_filename_component(FIL_DIR ${FIL} DIRECTORY)
@@ -14,48 +25,56 @@ function(Protobuf_Generate_Cpp SRCS HDRS)
set(FIL_WE "${FIL_DIR}/${FIL_WE}")
endif()
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
list(APPEND ${_ARGS_CXX_SOURCES} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${_ARGS_CXX_HEADERS} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.h")
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
OUTPUT "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.h"
COMMAND
${Protobuf_PROTOC_EXECUTABLE} ARGS --cpp_out=${CMAKE_BINARY_DIR}/src -I
${PROTOBUF_INCLUDE_DIRS} -I ${CMAKE_SOURCE_DIR}/src ${ABS_FIL}
${Protobuf_PROTOC_EXECUTABLE} ARGS --cpp_out=${_ARGS_CXX_OUT_DIR} ${_proto_include_cli_args} ${ABS_FIL}
DEPENDS ${ABS_FIL}
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
VERBATIM)
endforeach()
set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
set_source_files_properties(${${_ARGS_CXX_SOURCES}} ${${_ARGS_CXX_HEADERS}} PROPERTIES GENERATED TRUE)
# remove some warnings from protobuf generated files
if(WIN32)
set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS
set_source_files_properties(${${_ARGS_CXX_SOURCES}} PROPERTIES COMPILE_FLAGS
"/wd4309 /wd4838")
else()
set_source_files_properties(
${${SRCS}}
${${_ARGS_CXX_SOURCES}}
PROPERTIES
COMPILE_FLAGS
"-Wno-unused-parameter -Wno-effc++ -Wno-pedantic -Wno-sign-compare -Wno-uninitialized"
)
endif()
set(${SRCS}
${${SRCS}}
set(${_ARGS_CXX_SOURCES}
${${_ARGS_CXX_SOURCES}}
PARENT_SCOPE)
set(${HDRS}
${${HDRS}}
set(${_ARGS_CXX_HEADERS}
${${_ARGS_CXX_HEADERS}}
PARENT_SCOPE)
endfunction()
function(Service_Compiler_Generate_Cpp SRCS HDRS)
set(${SRCS})
set(${HDRS})
function(Service_Compiler_Generate_Cpp)
set(_options)
set(_one_value_args CXX_SOURCES CXX_HEADERS CXX_OUT_DIR)
set(_multi_value_args PROTO_INCLUDE_DIRS PROTO_SOURCES)
cmake_parse_arguments(_ARGS "${_options}" "${_one_value_args}" "${_multi_value_args}" ${ARGN})
set(${_ARGS_CXX_SOURCES})
set(${_ARGS_CXX_HEADERS})
foreach(FIL ${ARGN})
set(_proto_include_cli_args)
foreach(_dir ${_ARGS_PROTO_INCLUDE_DIRS})
list(APPEND _proto_include_cli_args -I ${_dir})
endforeach()
foreach(FIL ${_ARGS_PROTO_SOURCES})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
get_filename_component(FIL_DIR ${FIL} DIRECTORY)
@@ -63,58 +82,58 @@ function(Service_Compiler_Generate_Cpp SRCS HDRS)
set(FIL_WE "${FIL_DIR}/${FIL_WE}")
endif()
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
list(APPEND ${_ARGS_CXX_SOURCES} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${_ARGS_CXX_HEADERS} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.h")
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.client.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.client.pb.h")
list(APPEND ${_ARGS_CXX_SOURCES} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.cc")
list(APPEND ${_ARGS_CXX_HEADERS} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.h")
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.server.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.server.pb.h")
list(APPEND ${_ARGS_CXX_SOURCES} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.cc")
list(APPEND ${_ARGS_CXX_HEADERS} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.h")
set(TEMPLATES
${CMAKE_CURRENT_SOURCE_DIR}/api/service_compiler/templates/cpp/client.pb.cc
${CMAKE_CURRENT_SOURCE_DIR}/api/service_compiler/templates/cpp/client.pb.h
${CMAKE_CURRENT_SOURCE_DIR}/api/service_compiler/templates/cpp/server.pb.cc
${CMAKE_CURRENT_SOURCE_DIR}/api/service_compiler/templates/cpp/server.pb.h
${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/templates/cpp/client.pb.cc
${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/templates/cpp/client.pb.h
${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/templates/cpp/server.pb.cc
${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/templates/cpp/server.pb.h
)
set(_plugin_py ${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/plugin.py)
if(WIN32)
set(_plugin_cmd ${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/plugin.cmd)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.client.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.client.pb.h"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.server.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.server.pb.h"
OUTPUT "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.h"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.h"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.h"
COMMAND SET PYTHONPATH=${SPARK_PYTHON}
COMMAND ${CMAKE_SOURCE_DIR}/.venv/Scripts/activate.bat
COMMAND
${Protobuf_PROTOC_EXECUTABLE} ARGS --cpp_out=${CMAKE_BINARY_DIR}/src
--plugin=protoc-gen-service=${CMAKE_SOURCE_DIR}/src/lib/api/service_compiler/plugin.cmd
--service_out=lang=cpp:${CMAKE_BINARY_DIR}/src -I
${PROTOBUF_INCLUDE_DIRS} -I ${CMAKE_SOURCE_DIR}/src ${ABS_FIL}
DEPENDS ${ABS_FIL} ${TEMPLATES}
${CMAKE_CURRENT_SOURCE_DIR}/api/service_compiler/plugin.py
${Protobuf_PROTOC_EXECUTABLE} ARGS --cpp_out=${_ARGS_CXX_OUT_DIR}
--plugin=protoc-gen-service=${_plugin_cmd}
--service_out=lang=cpp:${_ARGS_CXX_OUT_DIR} -I
${PROTOBUF_INCLUDE_DIRS} -I ${_protobuf_src_dir} ${ABS_FIL}
DEPENDS ${ABS_FIL} ${TEMPLATES} ${_plugin_cmd} ${_plugin_py}
COMMENT "Running C++ service compiler on ${FIL}"
VERBATIM)
else()
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.client.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.client.pb.h"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.server.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.server.pb.h"
OUTPUT "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.h"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.h"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.h"
COMMAND ${CMAKE_SOURCE_DIR}/tools/venv_exec.sh
ARGS
${Protobuf_PROTOC_EXECUTABLE}
--cpp_out=${CMAKE_BINARY_DIR}/src
--plugin=protoc-gen-service=${CMAKE_SOURCE_DIR}/src/lib/api/service_compiler/plugin.py
--service_out=lang=cpp,make_file_name=${ABS_FIL}:${CMAKE_BINARY_DIR}/src
-I ${PROTOBUF_INCLUDE_DIRS} -I ${CMAKE_SOURCE_DIR}/src ${ABS_FIL}
DEPENDS ${ABS_FIL} ${TEMPLATES}
${CMAKE_CURRENT_SOURCE_DIR}/api/service_compiler/plugin.py
--cpp_out=${_ARGS_CXX_OUT_DIR}
--plugin=protoc-gen-service=${_plugin_py}
--service_out=lang=cpp,make_file_name=${ABS_FIL}:${_ARGS_CXX_OUT_DIR}
${_proto_include_cli_args} ${ABS_FIL}
DEPENDS ${ABS_FIL} ${TEMPLATES} ${_plugin_py}
COMMENT "Running C++ service compiler on ${FIL}"
VERBATIM)
endif()
@@ -123,22 +142,22 @@ function(Service_Compiler_Generate_Cpp SRCS HDRS)
# remove some warnings from protobuf generated files
if(WIN32)
set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS
set_source_files_properties(${${_ARGS_CXX_SOURCES}} PROPERTIES COMPILE_FLAGS
"/wd4309 /wd4838")
else()
set_source_files_properties(
${${SRCS}}
${${_ARGS_CXX_SOURCES}}
PROPERTIES
COMPILE_FLAGS
"-Wno-unused-parameter -Wno-effc++ -Wno-pedantic -Wno-sign-compare -Wno-uninitialized"
)
endif()
set(${SRCS}
${${SRCS}}
set(${_ARGS_CXX_SOURCES}
${${_ARGS_CXX_SOURCES}}
PARENT_SCOPE)
set(${HDRS}
${${HDRS}}
set(${_ARGS_CXX_HEADERS}
${${_ARGS_CXX_HEADERS}}
PARENT_SCOPE)
endfunction()
+10
View File
@@ -0,0 +1,10 @@
include_guard(GLOBAL)
macro(set_first_defined RESULT)
foreach(_arg ${ARGN})
if (DEFINED ${_arg})
set(${RESULT} ${${_arg}})
break()
endif()
endforeach()
endmacro()
+29
View File
@@ -0,0 +1,29 @@
include_guard(DIRECTORY)
include(${CMAKE_SOURCE_DIR}/cmake/TernaryOperator.cmake)
function(sym_link_dir)
set(_options)
set(_one_value_args TARGET_NAME SOURCE DEST COMMENT)
set(_multi_value_args)
cmake_parse_arguments(_ARGS "${_options}" "${_one_value_args}" "${_multi_value_args}" ${ARGN})
add_custom_command(
OUTPUT ${_ARGS_DEST}
COMMAND ln ARGS -sf ${_ARGS_SOURCE} ${_ARGS_DEST}
)
set_ternary(_comment _ARGS_COMMENT "${_ARGS_COMMENT}" "linking dir ${_ARGS_SOURCE} -> ${_ARGS_DEST}")
add_custom_target(
${_ARGS_TARGET_NAME} ALL
DEPENDS ${_ARGS_DEST}
COMMENT "${_comment}"
)
endfunction()
function(sym_link_local_lib LIB_NAME)
set(_lib_file_name "${CMAKE_SHARED_LIBRARY_PREFIX}${LIB_NAME}.so")
file(
CREATE_LINK
"${CMAKE_BINARY_DIR}/src/lib_${LIB_NAME}/${_lib_file_name}"
"${CMAKE_CURRENT_BINARY_DIR}/${_lib_file_name}"
SYMBOLIC
)
endfunction()
+9
View File
@@ -0,0 +1,9 @@
include_guard(GLOBAL)
macro(set_ternary RESULT CONDITION TRUE_VALUE FALSE_VALUE)
if(${CONDITION})
set(${RESULT} ${TRUE_VALUE})
else()
set(${RESULT} ${FALSE_VALUE})
endif()
endmacro()
+4 -1
View File
@@ -1,7 +1,10 @@
services:
sparkd:
build:
dockerfile: src/server/sparkd/Dockerfile
dockerfile: src/app_sparkd/sparkd/Dockerfile
args:
- SOURCE_DIR=install/sparkd-release-gcc
- CONF_FILE=src/app_sparkd/spark.current.conf
command: [ "./sparkd", "run" ]
ports:
- 8000:8000
+8 -7
View File
@@ -3,14 +3,15 @@ project(Spark.Admin.WebApp)
include(${CMAKE_SOURCE_DIR}/cmake/safe_dep_glob.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/Protobuf.cmake)
include(GNUInstallDirs)
# dependencies
set(PROTO_GLOBS
../lib/api/*.proto
../lib/api/services/*.proto
../lib/domain_model/*.proto
../lib/sparkproto/*.proto
../lib/md/protos/*.proto
../lib_spark/spark/api/*.proto
../lib_spark/spark/api/services/*.proto
../lib_spark/spark/domain_model/*.proto
../lib_spark/spark/sparkproto/*.proto
../lib_spark/spark/md/protos/*.proto
../../externals/linux/include/google/protobuf/descriptor.proto
../../externals/linux/include/google/protobuf/timestamp.proto)
@@ -58,7 +59,7 @@ set(_build_admin_web_app_deps
${_build_admin_web_app_py}
${CMAKE_CURRENT_SOURCE_DIR}/src/Spark.Admin.WebApp.fsproj
${CMAKE_CURRENT_SOURCE_DIR}/webpack.config.js
${CMAKE_SOURCE_DIR}/src/lib/api/service_compiler/templates/fs/fable.fs
${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/templates/fs/fable.fs
${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json
${_proto_rel_SOURCES}
${_api_ts_SOURCES}
@@ -105,4 +106,4 @@ add_custom_command(
add_custom_target(admin_web_app_bundle ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bundle.js)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" DESTINATION "${SPARK_INSTALL_PREFIX}/bin")
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" DESTINATION "${CMAKE_INSTALL_BINDIR}")
@@ -4,6 +4,12 @@ project(sparkd)
include(FetchContent)
include(${CMAKE_SOURCE_DIR}/cmake/safe_dep_glob.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/Protobuf.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/InstallBasic.cmake)
include(GNUInstallDirs)
if (NOT DEFINED PROJECT_VERSION)
set(PROJECT_VERSION 1.0.0)
endif()
# dependencies
file(
@@ -16,15 +22,24 @@ file(
*.cpp *.c)
update_deps_file("${Protos};${Sparkd_Sources}")
protobuf_generate_cpp(Proto_Srcs PROTO_HDRS ${Protos})
protobuf_generate_cpp(
CXX_SOURCES Proto_Srcs
CXX_HEADERS PROTO_HDRS
CXX_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/include
PROTO_INCLUDE_DIRS
${EXTERNALS_INCLUDE}
${CMAKE_SOURCE_DIR}/src/lib_spark
${CMAKE_CURRENT_SOURCE_DIR}
PROTO_SOURCES
${Protos})
add_executable(sparkd ${Sparkd_Sources} ${Proto_Srcs})
# include paths
target_include_directories(
sparkd PUBLIC
${CMAKE_SOURCE_DIR}/src/server/sparkd/cmds/spartan
${CMAKE_SOURCE_DIR}/src
${CMAKE_BINARY_DIR}/src/server/sparkd/cmds/spartan ${emumba-deribit-connector-library_INCLUDE_DIRS})
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>/include
$<BUILD_INTERFACE:${emumba-deribit-connector-library_INCLUDE_DIRS}>)
find_package(PkgConfig REQUIRED)
pkg_check_modules(emumba-deribit-connector-library REQUIRED emumba-deribit-connector)
@@ -32,7 +47,10 @@ pkg_check_modules(emumba-deribit-connector-library REQUIRED emumba-deribit-conne
# This dir contains rapidjsonConfig.cmake
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
find_package(rapidjson REQUIRED)
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${rapidjson_INCLUDE_DIR})
target_include_directories(
${PROJECT_NAME} SYSTEM PUBLIC
$<BUILD_INTERFACE:${rapidjson_INCLUDE_DIR}>
)
add_dependencies(${PROJECT_NAME} rapidjson_project)
# databento
@@ -73,9 +91,23 @@ else()
message("-- Building of DERIBIT_DEMO_LOG_LEVEL=TRACE")
endif()
# linking
target_link_libraries(sparkd PUBLIC
libspark
target_link_directories(
${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}>
)
# Set RPATH so sparkd knows where to find our shared libs (e.g., libspark).
# The dirs are relative to sparkd's path, represented by "$ORIGIN".
set_target_properties(
${PROJECT_NAME} PROPERTIES
BUILD_RPATH "$ORIGIN/../lib_spark"
INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
)
target_link_libraries(
sparkd
spark
databento::databento
${emumba-deribit-connector-library_LIBRARIES}
ssl
@@ -95,10 +127,10 @@ target_link_libraries(sparkd PUBLIC
-static-libstdc++
-pthread)
add_custom_command(
TARGET sparkd
POST_BUILD
COMMAND ln -fs ${CMAKE_BINARY_DIR}/src/lib/libspark.so ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ln ARGS -sf ${EXTERNALS_ROOT}/../src/emumba/sparkd.lic ${CMAKE_BINARY_DIR}/src/server/sparkd)
install(TARGETS sparkd DESTINATION "${SPARK_INSTALL_PREFIX}/bin")
install_basic()
install(
FILES
"${EXTERNALS_LIB}/libOnixS.IceImpactMulticastPriceFeedHandlerCpp.so.3.16.0.0"
"${EXTERNALS_LIB}/libACE-5.7.5.so"
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
+5
View File
@@ -0,0 +1,5 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/sparkdTargets.cmake")
check_required_components(libspark)
+19
View File
@@ -0,0 +1,19 @@
FROM bluetradingsystems/linux_dotnet7
ARG SOURCE_DIR="install/sparkd-release-gcc"
ARG CONF_FILE="src/app_sparkd/spark.current.conf"
USER "root"
RUN apt-get update \
&& apt-get install -y liblttng-ust-dev
RUN apt-get update \
&& apt-get install -y libpcap0.8-dev
RUN apt-get update \
&& apt-get install -y python3.10-dev
USER "bts"
COPY --chown=bts:bts "${SOURCE_DIR}" "."
COPY --chown=bts:bts "${CONF_FILE}" ".local/share/bts/sparkd/conf/spark.conf"
WORKDIR "/home/bts/bin"
File renamed without changes.
File renamed without changes.
@@ -1,16 +1,16 @@
#pragma once
#include "lib/api/public/ServiceContext.h"
#include "lib/api/services/AlgoDefinitionService.server.pb.h"
#include "lib/api/services/OrderService.client.pb.h"
#include "lib/api/services/OrderService.pb.h"
#include "lib/logging/logging.h"
#include "lib/persistence/IStore.h"
#include "lib/persistence/SqliteStore.h"
#include "lib/utils/PBUtils.h"
#include "lib/utils/TimeStamp.h"
#include "lib/utils/bts_assert.h"
#include "lib/utils/bts_no_copy.h"
#include "spark/api/public/ServiceContext.h"
#include "spark/api/services/AlgoDefinitionService.server.pb.h"
#include "spark/api/services/OrderService.client.pb.h"
#include "spark/api/services/OrderService.pb.h"
#include "spark/logging/logging.h"
#include "spark/persistence/IStore.h"
#include "spark/persistence/SqliteStore.h"
#include "spark/utils/PBUtils.h"
#include "spark/utils/TimeStamp.h"
#include "spark/utils/bts_assert.h"
#include "spark/utils/bts_no_copy.h"
#include <memory>
#include <boost/tokenizer.hpp>
@@ -1,21 +1,19 @@
#include "AnalyticsServiceServer.h"
#include "lib/api/apicore.pb.h"
#include "lib/api/services/AnalyticsService.pb.h"
#include "lib/api/services/AnalyticsService.server.pb.h"
#include "lib/api/services/ShellLatencyService.pb.h"
#include "lib/logging/logging.h"
#include "lib/persistence/IStore.h"
#include "lib/persistence/SqliteStore.h"
#include "lib/utils/PBUtils.h"
#include "lib/utils/Puid.h"
#include "lib/utils/TimeStamp.h"
#include "lib/utils/bts_assert.h"
#include "server/sparkd/algo/AlgoDefinitionServiceServer.h"
#include "spark/api/apicore.pb.h"
#include "spark/api/services/AnalyticsService.pb.h"
#include "spark/api/services/AnalyticsService.server.pb.h"
#include "spark/logging/logging.h"
#include "spark/persistence/IStore.h"
#include "spark/persistence/SqliteStore.h"
#include "spark/utils/PBUtils.h"
#include "spark/utils/TimeStamp.h"
#include "spark/utils/bts_assert.h"
#include "sparkd/algo/AlgoDefinitionServiceServer.h"
#include <boost/algorithm/string.hpp>
#include <boost/tokenizer.hpp>
#include <chrono>
#include <cstdint>
#include <locale>
#include <memory>
#include <string>
#include <tuple>
@@ -1,7 +1,7 @@
#pragma once
#include "lib/api/services/AnalyticsService.server.pb.h"
#include "lib/utils/bts_no_copy.h"
#include "spark/api/services/AnalyticsService.server.pb.h"
#include "spark/utils/bts_no_copy.h"
namespace bts {
namespace api {
@@ -1,13 +1,13 @@
#include "AdminReport.h"
#include "lib/api/public/ServiceContext.h"
#include "lib/config/config.h"
#include "lib/config/protos/logging.pb.h"
#include "lib/logging/logging.h"
#include "lib/quickbus/quickbus.h"
#include "spark/api/public/ServiceContext.h"
#include "spark/config/config.h"
#include "spark/config/protos/logging.pb.h"
#include "spark/logging/logging.h"
#include "spark/quickbus/quickbus.h"
#include "lib/api/service_helpers/AdminServiceUtils.h"
#include "lib/api/services/AdminService.client.pb.h"
#include "spark/api/service_helpers/AdminServiceUtils.h"
#include "spark/api/services/AdminService.client.pb.h"
#include <algorithm>
#include <boost/algorithm/string.hpp>
@@ -1,12 +1,12 @@
#include "AutoCert.h"
#include "lib/utils/PBUtils.h"
#include "spark/utils/PBUtils.h"
#include "lib/jetfix/common/InMsgBuffer.h"
#include "lib/utils/bts_chrono.h"
#include "lib/utils/datetime.h"
#include "spark/jetfix/common/InMsgBuffer.h"
#include "spark/utils/bts_chrono.h"
#include "spark/utils/datetime.h"
#include "lib/jetfix/codec/i32_toa.h"
#include "lib/utils/SecureLogon.h"
#include "spark/jetfix/codec/i32_toa.h"
#include "spark/utils/SecureLogon.h"
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/filesystem.hpp>
File renamed without changes.
@@ -1,13 +1,13 @@
#include "CMECert.h"
#include "lib/logging/logging.h"
#include "lib/orderman/ilink3/IL3Dispatcher.h"
#include "lib/orderman/ilink3/IL3GW.h"
#include "lib/orderman/ilink3/IL3Reactor.h"
#include "lib/orderman/ilink3/ILink3Utils.h"
#include "lib/os/os.h"
#include "lib/utils/Dispatcher.h"
#include "lib/utils/SecureLogon.h"
#include "lib/utils/TimeStamp.h"
#include "spark/logging/logging.h"
#include "spark/orderman/ilink3/IL3Dispatcher.h"
#include "spark/orderman/ilink3/IL3GW.h"
#include "spark/orderman/ilink3/IL3Reactor.h"
#include "spark/orderman/ilink3/ILink3Utils.h"
#include "spark/os/os.h"
#include "spark/utils/Dispatcher.h"
#include "spark/utils/SecureLogon.h"
#include "spark/utils/TimeStamp.h"
#include <chrono>
#include <fstream>
#include <future>
File renamed without changes.
@@ -1,6 +1,6 @@
#include "ConfigCmd.h"
#include "lib/config/ConfigQuerier.h"
#include "lib/config/config.h"
#include "spark/config/ConfigQuerier.h"
#include "spark/config/config.h"
namespace bts::cmds {
File renamed without changes.
@@ -1,5 +1,5 @@
#include "server/sparkd/cmds/FIXSim.h"
#include "server/sparkd/exchange_sim/ExchangeSim.h"
#include "sparkd/cmds/FIXSim.h"
#include "sparkd/exchange_sim/ExchangeSim.h"
namespace bts::cmds {
File renamed without changes.
@@ -1,18 +1,18 @@
#include "KeyCmd.h"
#include "lib/config/config.h"
#include "lib/config/protos/keycode.pb.h"
#include "lib/logging/logging.h"
#include "lib/os/os.h"
#include "lib/utils/AuthToken.h"
#include "lib/utils/FileUtils.h"
#include "lib/utils/bts_assert.h"
#include "lib/utils/crypto/CryptoInit.h"
#include "lib/utils/crypto/KeyCodeHelper.h"
#include "lib/utils/crypto/PrivateKey.h"
#include "lib/utils/crypto/PublicKey.h"
#include "lib/utils/datetime.h"
#include "lib/utils/helper_macros.h"
#include "spark/config/config.h"
#include "spark/config/protos/keycode.pb.h"
#include "spark/logging/logging.h"
#include "spark/os/os.h"
#include "spark/utils/AuthToken.h"
#include "spark/utils/FileUtils.h"
#include "spark/utils/bts_assert.h"
#include "spark/utils/crypto/CryptoInit.h"
#include "spark/utils/crypto/KeyCodeHelper.h"
#include "spark/utils/crypto/PrivateKey.h"
#include "spark/utils/crypto/PublicKey.h"
#include "spark/utils/datetime.h"
#include "spark/utils/helper_macros.h"
#include <boost/algorithm/string/replace.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,10 +1,10 @@
#include "ParseHistoricalFIX.h"
#include "lib/jetfix/codec/FIXMsg.h"
#include "lib/jetfix/codec/FIXParser.h"
#include "lib/jetfix/codec/Fields.h"
#include "lib/jetfix/codec/Group.h"
#include "lib/jetfix/codec/MessageTypes.h"
#include "lib/utils/bts_chrono.h"
#include "spark/jetfix/codec/FIXMsg.h"
#include "spark/jetfix/codec/FIXParser.h"
#include "spark/jetfix/codec/Fields.h"
#include "spark/jetfix/codec/Group.h"
#include "spark/jetfix/codec/MessageTypes.h"
#include "spark/utils/bts_chrono.h"
#include <fstream>
#include <unordered_map>
@@ -1,7 +1,7 @@
#include "server/sparkd/cmds/PrintHedgeOrders.h"
#include "lib/api/services/OrderService.pb.h"
#include "lib/persistence/SqliteStore.h"
#include "lib/utils/PBUtils.h"
#include "PrintHedgeOrders.h"
#include "spark/api/services/OrderService.pb.h"
#include "spark/persistence/SqliteStore.h"
#include "spark/utils/PBUtils.h"
namespace bts::cmds {
@@ -1,5 +1,5 @@
#include "QuickTest.h"
#include "lib/logging/logging.h"
#include "spark/logging/logging.h"
#include <thread>
File renamed without changes.
@@ -1,49 +1,42 @@
#include "Run.h"
#include "lib/api/public/ServiceContext.h"
#include "lib/config/config.h"
#include "lib/config/protos/ports.pb.h"
#include "lib/config/protos/quickbus_cfg.pb.h"
#include "lib/config/protos/toggles.pb.h"
#include "lib/logging/logging.h"
#include "lib/md/MBOProcessor.h"
#include "lib/md/MBOServiceServer.h"
#include "lib/md/MDClient.h"
#include "lib/md/SyntheticSecurityService.h"
#include "lib/md/relay/QueryServer.h"
#include "lib/md/service/MarketDataServiceServer.h"
#include "lib/metrics/metrics.h"
#include "lib/metrics/system_metrics.h"
#include "lib/orderman/OrderServiceServer.h"
#include "lib/orderman/gateways/sim/SimExecutionGatewayFactory.h"
#include "lib/orderman/order_factory/DynamicOrderRegistry.h"
#include "lib/orderman/orders/algo/algo_orders/ProRataAlgo.h"
#include "lib/orderman/orders/algo/algo_orders/ScratchAlgo.h"
#include "lib/os/os.h"
#include "lib/persistence/PersistenceServiceServer.h"
#include "lib/plugin/SparkServices.h"
#include "lib/plugin/plugin.h"
#include "lib/quickbus/quickbus.h"
#include "lib/tracing/PerfLog.h"
#include "lib/utils/Dispatcher.h"
#include "lib/utils/thread_manager.h"
#include "spark/api/public/ServiceContext.h"
#include "spark/config/config.h"
#include "spark/config/protos/ports.pb.h"
#include "spark/config/protos/quickbus_cfg.pb.h"
#include "spark/logging/logging.h"
#include "spark/md/MBOProcessor.h"
#include "spark/md/MBOServiceServer.h"
#include "spark/md/MDClient.h"
#include "spark/md/SyntheticSecurityService.h"
#include "spark/md/relay/QueryServer.h"
#include "spark/md/service/MarketDataServiceServer.h"
#include "spark/metrics/metrics.h"
#include "spark/metrics/system_metrics.h"
#include "spark/orderman/OrderServiceServer.h"
#include "spark/orderman/events/TradeSummarySignalDispatcher.h"
#include "spark/orderman/order_factory/DynamicOrderRegistry.h"
#include "spark/persistence/PersistenceServiceServer.h"
#include "spark/plugin/SparkServices.h"
#include "spark/plugin/plugin.h"
#include "spark/quickbus/core/Quickbus.h"
#include "spark/tracing/PerfLog.h"
#include "spark/utils/Dispatcher.h"
#include "md/cmds/Run.h"
#include "server/sparkd/algo/AlgoDefinitionServiceServer.h"
#include "server/sparkd/analytics/AnalyticsServiceServer.h"
#include "server/sparkd/http/WebServer.h"
#include "server/sparkd/md/MarketDataAuxiliaryServiceServer.h"
#include "server/sparkd/md/platforms/mdp3_onixs/TradeSummarySignalDispatcher.h"
#include "server/sparkd/md/recording/MDRecorder.h"
#include "server/sparkd/position/MarginServiceServer.h"
#include "server/sparkd/position/PositionServiceServer.h"
#include "server/sparkd/position/import/BasePositionServiceServer.h"
#include "server/sparkd/position/import/MoneyFileServiceServer.h"
#include "server/sparkd/subprocess/SubProcessRunner.h"
#include "server/sparkd/support/ErrorReportService.h"
#include "server/sparkd/support/ShellLatencyServer.h"
#include "server/sparkd/user/AdminServiceServer.h"
#include "server/sparkd/user/AuthServiceServer.h"
#include "sparkd/algo/AlgoDefinitionServiceServer.h"
#include "sparkd/analytics/AnalyticsServiceServer.h"
#include "sparkd/http/WebServer.h"
#include "sparkd/md/MarketDataAuxiliaryServiceServer.h"
#include "sparkd/md/recording/MDRecorder.h"
#include "sparkd/position/MarginServiceServer.h"
#include "sparkd/position/PositionServiceServer.h"
#include "sparkd/position/import/BasePositionServiceServer.h"
#include "sparkd/position/import/MoneyFileServiceServer.h"
#include "sparkd/subprocess/SubProcessRunner.h"
#include "sparkd/support/ErrorReportService.h"
#include "sparkd/support/ShellLatencyServer.h"
#include "sparkd/user/AdminServiceServer.h"
#include "sparkd/user/AuthServiceServer.h"
#include <thread>
namespace bts::cmds {
File renamed without changes.
@@ -1,17 +1,17 @@
#include "Span.h"
#include "server/sparkd/position/MarginServiceCore.h"
#include "server/sparkd/position/Position.h"
#include "server/sparkd/position/PositionAggregator.h"
#include "sparkd/position/MarginServiceCore.h"
#include "sparkd/position/Position.h"
#include "sparkd/position/PositionAggregator.h"
#include "lib/orderman/orderman_utils/orderman_common.h"
#include "spark/orderman/orderman_utils/orderman_common.h"
#include "lib/api/public/ServiceContext.h"
#include "lib/api/services/AuthService.client.pb.h"
#include "lib/config/config.h"
#include "lib/domain_model/Security.pb.h"
#include "lib/utils/Dispatcher.h"
#include "lib/utils/helper_macros.h"
#include "spark/api/public/ServiceContext.h"
#include "spark/api/services/AuthService.client.pb.h"
#include "spark/config/config.h"
#include "spark/domain_model/Security.pb.h"
#include "spark/utils/Dispatcher.h"
#include "spark/utils/helper_macros.h"
#include <condition_variable>
#include <future>
File renamed without changes.
@@ -1,28 +1,27 @@
#include "Web.h"
#include "lib/api/public/ServiceContext.h"
#include "lib/api/services/MarketDataService.pb.h"
#include "lib/api/services/SyntheticSecurityService.pb.h"
#include "lib/config/config.h"
#include "lib/config/protos/market_data.pb.h"
#include "lib/config/protos/ports.pb.h"
#include "lib/config/protos/quickbus_cfg.pb.h"
#include "lib/md/MBOProcessor.h"
#include "lib/md/MDClient.h"
#include "lib/md/SyntheticSecurityService.h"
#include "lib/md/relay/QueryServer.h"
#include "lib/metrics/metrics.h"
#include "lib/metrics/system_metrics.h"
#include "lib/quickbus/quickbus.h"
#include "lib/tracing/PerfLog.h"
#include "lib/utils/Dispatcher.h"
#include "lib/utils/thread_manager.h"
#include "spark/api/public/ServiceContext.h"
#include "spark/api/services/MarketDataService.pb.h"
#include "spark/api/services/SyntheticSecurityService.pb.h"
#include "spark/config/config.h"
#include "spark/config/protos/market_data.pb.h"
#include "spark/config/protos/ports.pb.h"
#include "spark/config/protos/quickbus_cfg.pb.h"
#include "spark/md/MBOProcessor.h"
#include "spark/md/MDClient.h"
#include "spark/md/SyntheticSecurityService.h"
#include "spark/md/relay/QueryServer.h"
#include "spark/metrics/metrics.h"
#include "spark/metrics/system_metrics.h"
#include "spark/quickbus/quickbus.h"
#include "spark/tracing/PerfLog.h"
#include "spark/utils/Dispatcher.h"
#include "spark/utils/thread_manager.h"
#include "md/cmds/Cleanup.h"
#include "md/cmds/Run.h"
#include "server/sparkd/exchange_sim/ExchangeSim.h"
#include "server/sparkd/http/WebServer.h"
#include "server/sparkd/md/platforms/mdp3_onixs/TradeSummarySignalDispatcher.h"
#include "server/sparkd/user/AdminServiceServer.h"
#include "server/sparkd/user/AuthServiceServer.h"
#include "sparkd/exchange_sim/ExchangeSim.h"
#include "sparkd/http/WebServer.h"
#include "sparkd/user/AdminServiceServer.h"
#include "sparkd/user/AuthServiceServer.h"
#include <optional>
#include <string>
#include <vector>
File renamed without changes.
@@ -1,5 +1,5 @@
#include "Validators.h"
#include "lib/utils/FileUtils.h"
#include "spark/utils/FileUtils.h"
#include <fmt/format.h>
namespace bts::cmds {
@@ -1,13 +1,12 @@
#include "DeribitDemo.h"
#include "DeribitDemoConfiguration.h"
#include "lib/logging/logging.h"
#include "server/sparkd/cmds/crypto/DeribitDemoListener.h"
#include "spark/logging/logging.h"
#include "sparkd/cmds/crypto/DeribitDemoListener.h"
#include <csignal>
#include <emumba-deribit-connector/deribit_exception.h>
#include <emumba-deribit-connector/deribit_handler.h>
#include <emumba-deribit-connector/deribit_listener.h>
#include <emumba-deribit-connector/trading_session_interface.h>
#include <list>
namespace bts::cmds {
@@ -1,7 +1,7 @@
#include "DeribitDemoCmd.h"
#include "DeribitDemo.h"
#include "lib/config/config.h"
#include "lib/os/os.h"
#include "spark/config/config.h"
#include "spark/os/os.h"
#include <CLI11/CLI11.hpp>
#include <functional>
#include <optional>
@@ -1,6 +1,6 @@
#include "DeribitDemoConfiguration.h"
#include "RapidJsonReader.h"
#include "lib/logging/logging.h"
#include "spark/logging/logging.h"
#include "rapidjson/istreamwrapper.h"
#include <emumba-deribit-connector/deribit_utils.h>
#include <fstream>
@@ -1,6 +1,6 @@
#pragma once
#include "lib/core/FMT_IMPL.h"
#include "spark/core/FMT_IMPL.h"
#include <emumba-deribit-connector/deribit_utils.h>
#include <iostream>
@@ -1,12 +1,12 @@
// #include "DeribitDemoListener.h"
// #include "lib/utils/UNUSED_PARAM.h"
// #include "lib/utils/overloaded.h"
// #include "spark/utils/UNUSED_PARAM.h"
// #include "spark/utils/overloaded.h"
// #include "rapidjson/istreamwrapper.h"
// #include "rapidjson/ostreamwrapper.h"
// #include "rapidjson/stringbuffer.h"
// #include "rapidjson/writer.h"
// #include "server/sparkd/cmds/crypto/DeribitDemoConfiguration.h"
// #include "server/sparkd/cmds/spartan/utils/FileUtils.h"
// #include "sparkd/cmds/crypto/DeribitDemoConfiguration.h"
// #include "sparkd/cmds/spartan/utils/FileUtils.h"
// #include <cassert>
// #include <emumba-deribit-connector/deribit_exception.h>
// #include <emumba-deribit-connector/deribit_utils.h>
@@ -1,9 +1,9 @@
#include "LiveLadderDemo.h"
#include "lib/api/md/MarketDataConfig.pb.h"
#include "server/sparkd/md/MarketDataGateway.h"
#include "server/sparkd/md/MarketDataRegistration.h"
#include "server/sparkd/md/listeners/LiveLadderPrinter.h"
#include <vector>
#include "spark/api/md/MarketDataConfig.pb.h"
#include "sparkd/md/MarketDataGateway.h"
#include "sparkd/md/listeners/LiveLadderPrinter.h"
#include <thread>
namespace bts::cmds {
@@ -1,11 +1,11 @@
#ifdef SPARK_ENABLE_CCAPI
#include "LiveLadderDemoCmd.h"
#include "LiveLadderDemo.h"
#include "lib/api/md/MarketDataConfig.pb.h"
#include "lib/io/ProtoReader.h"
#include "lib/logging/logging.h"
#include "server/sparkd/cmds/common/Validators.h"
#include "server/sparkd/cmds/crypto/LiveLadderDemo.h"
#include "spark/api/md/MarketDataConfig.pb.h"
#include "spark/io/ProtoReader.h"
#include "spark/logging/logging.h"
#include "sparkd/cmds/common/Validators.h"
#include "sparkd/cmds/crypto/LiveLadderDemo.h"
#include <CLI11/CLI11.hpp>
#include <optional>
@@ -1,5 +1,5 @@
#pragma once
#include "lib/utils/bts_assert.h"
#include "spark/utils/bts_assert.h"
#include <rapidjson/document.h>
#include <string>
@@ -1,5 +1,5 @@
#include "Channels.h"
#include "lib/md/cme/MDP3Utils.h"
#include "spark/md/cme/MDP3Utils.h"
namespace bts::cmds::md::cmds {
@@ -1,9 +1,9 @@
#include "Cleanup.h"
#include "lib/config/config.h"
#include "lib/config/protos/market_data.pb.h"
#include "lib/logging/logging.h"
#include "lib/md/ShmSegmentName.h"
#include "lib/md/protos/co2.pb.h"
#include "spark/config/config.h"
#include "spark/config/protos/market_data.pb.h"
#include "spark/logging/logging.h"
#include "spark/md/ShmSegmentName.h"
#include "spark/md/protos/co2.pb.h"
#include <boost/filesystem.hpp>
#include <string>
@@ -1,12 +1,12 @@
#include "Dump.h"
#include "../common/SecurityTypeOption.h"
#include "../common/VenueOption.h"
#include "lib/config/config.h"
#include "lib/config/protos/market_data.pb.h"
#include "lib/domain_model/Security.pb.h"
#include "lib/md/Diag/ShmDumper.h"
#include "lib/md/ShmSegmentName.h"
#include "lib/md/protos/co2.pb.h"
#include "spark/config/config.h"
#include "spark/config/protos/market_data.pb.h"
#include "spark/domain_model/Security.pb.h"
#include "spark/md/Diag/ShmDumper.h"
#include "spark/md/ShmSegmentName.h"
#include "spark/md/protos/co2.pb.h"
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <map>
@@ -1,10 +1,10 @@
#include "DumpSecurity.h"
#include "lib/config/protos/market_data.pb.h"
#include "lib/domain_model/Security.pb.h"
#include "lib/md/Diag/ShmDumper.h"
#include "lib/md/SecurityDB.h"
#include "lib/md/SymbolLoader.h"
#include "lib/md/UserSymbol.h"
#include "spark/config/protos/market_data.pb.h"
#include "spark/domain_model/Security.pb.h"
#include "spark/md/Diag/ShmDumper.h"
#include "spark/md/SecurityDB.h"
#include "spark/md/SymbolLoader.h"
#include "spark/md/UserSymbol.h"
#include <unordered_set>
#include <vector>
@@ -1,5 +1,5 @@
#include "Record.h"
#include "lib/md/relay/RelayRecorder.h"
#include "spark/md/relay/RelayRecorder.h"
#include <boost/filesystem.hpp>
namespace bts::cmds::md::cmds {
@@ -1,5 +1,5 @@
#include "Relay.h"
#include "lib/md/relay/RelayClient.h"
#include "spark/md/relay/RelayClient.h"
namespace bts::cmds::md::cmds {
@@ -1,5 +1,5 @@
#include "Replay.h"
#include "lib/md/relay/RelayRecorder.h"
#include "spark/md/relay/RelayRecorder.h"
namespace bts::cmds::md::cmds {
@@ -1,18 +1,18 @@
#include "Run.h"
#include "Cleanup.h"
#include "lib/config/protos/market_data.pb.h"
#include "lib/domain/SecurityCriteria.h"
#include "lib/logging/logging.h"
#include "lib/md/SymbolLoader.h"
#include "lib/md/UserSymbol.h"
#include "lib/md/relay/RelayRecorder.h"
#include "lib/os/os.h"
#include "lib/utils/bts_assert.h"
#include "lib/utils/thread_manager.h"
#include "server/sparkd/md/MarketDataGateway.h"
#include "server/sparkd/md/platforms/IMDPlatform.h"
#include "server/sparkd/md/platforms/ice_onixs/ICEMain.h"
#include "server/sparkd/md/platforms/mdp3_onixs/MDP3Main.h"
#include "spark/config/protos/market_data.pb.h"
#include "spark/domain/SecurityCriteria.h"
#include "spark/logging/logging.h"
#include "spark/md/SymbolLoader.h"
#include "spark/md/UserSymbol.h"
#include "spark/md/relay/RelayRecorder.h"
#include "spark/os/os.h"
#include "spark/utils/bts_assert.h"
#include "spark/utils/thread_manager.h"
#include "sparkd/md/MarketDataGateway.h"
#include "sparkd/md/platforms/IMDPlatform.h"
#include "sparkd/md/platforms/ice_onixs/ICEMain.h"
#include "sparkd/md/platforms/mdp3_onixs/MDP3Main.h"
#include <string>
namespace bts::cmds::md::cmds {
@@ -1,6 +1,5 @@
#pragma once
#include "lib/md/MBOProcessor.h"
#include "server/sparkd/md/platforms/mdp3_onixs/TradeSummarySignalDispatcher.h"
#include <CLI11/CLI11.hpp>
namespace bts::cmds::md::cmds {
@@ -1,12 +1,12 @@
#include "Tail.h"
#include "lib/api/domain/SecurityType.pb.h"
#include "lib/api/domain/Venue.pb.h"
#include "lib/config/protos/market_data.pb.h"
#include "lib/domain/SecurityCriteria.h"
#include "lib/md/Diag/MDPeriodicDumper.h"
#include "lib/md/Diag/ShmDumper.h"
#include "lib/md/SymbolLoader.h"
#include "lib/md/UserSymbol.h"
#include "spark/api/domain/SecurityType.pb.h"
#include "spark/api/domain/Venue.pb.h"
#include "spark/config/protos/market_data.pb.h"
#include "spark/domain/SecurityCriteria.h"
#include "spark/md/Diag/MDPeriodicDumper.h"
#include "spark/md/Diag/ShmDumper.h"
#include "spark/md/SymbolLoader.h"
#include "spark/md/UserSymbol.h"
#include <map>
namespace bts::cmds::md::cmds {
@@ -1,5 +1,5 @@
#include "Print.h"
#include "lib/md/relay/RelayRecorder.h"
#include "spark/md/relay/RelayRecorder.h"
namespace bts::cmds::md::cmds::rec_tool::cmds {
@@ -1,5 +1,5 @@
#include "Trace.h"
#include "lib/md/relay/RelayRecorder.h"
#include "spark/md/relay/RelayRecorder.h"
namespace bts::cmds::md::cmds::rec_tool::cmds {
@@ -1,5 +1,5 @@
#include "Unprint.h"
#include "lib/md/relay/RelayRecorder.h"
#include "spark/md/relay/RelayRecorder.h"
namespace bts::cmds::md::cmds::rec_tool::cmds {
@@ -1,6 +1,6 @@
#pragma once
#include "../../common/EnumOptionNames.h"
#include "lib/domain_model/Security.pb.h"
#include "spark/domain_model/Security.pb.h"
#include <map>
#include <string>
@@ -1,5 +1,5 @@
#include "VenueOption.h"
#include "lib/domain_model/Security.pb.h"
#include "spark/domain_model/Security.pb.h"
namespace bts::cmds::md {
@@ -1,6 +1,6 @@
#pragma once
#include "../../common/EnumOptionNames.h"
#include "lib/domain_model/Security.pb.h"
#include "spark/domain_model/Security.pb.h"
#include <map>
#include <string>
Loaded 100 of 1726 files, more files were not shown because too many files have changed in this diff. Show more