Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MDAPI-26] Update Graal SDK to v1.1.21 #51

Merged
merged 16 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 47 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ project(dxFeedGraalCxxApi)

set(DXFCXX_VERSION "v2.0.0" CACHE STRING "The dxFeed Graal CXX API package version")

set(DXFEED_GRAAL_NATIVE_SDK_VERSION "1.1.16" CACHE STRING "")
set(DXFEED_GRAAL_NATIVE_SDK_VERSION "1.1.21" CACHE STRING "")
set(FMTLIB_VERSION "10.2.1")
set(BOOST_VERSION "1.84.0")
set(UTFCPP_VERSION "3.2.3")
set(DATE_VERSION "3.0.1")
set(RANGE_VERSION "0.12")
set(DOCTEST_VERSION "2.4.11")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -51,6 +52,9 @@ option(DXFCXX_INSTALL_TOOLS "Prepare install the tools" ${DXFCXX_IS_ROOT_PROJECT
option(DXFCXX_USE_DXFEED_GRAAL_NATIVE_SDK_JFROG "" ON)
set(DXFEED_GRAAL_NATIVE_SDK_JFROG_BASE_URL "https://dxfeed.jfrog.io/artifactory/maven-open/com/dxfeed/graal-native-sdk/" CACHE STRING "")

option(DXFCXX_USE_DXFG_STUB "Use dxFeed Graal SDK stub" OFF)
set(DXFG_STUB_REPO "https://github.com/ttldtor/DxFeedGraalNativeSdkStub" CACHE STRING "")

option(DXFCXX_ENABLE_ASAN_UBSAN "Enable address, UB sanitizers etc" OFF)
option(DXFCXX_ENABLE_VS_ASAN "Enable VS address sanitizer" OFF)
option(DXFCXX_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
Expand All @@ -71,32 +75,42 @@ set(DXFCXX_GRAAL_TARGET_CPU "unknown" CACHE STRING "")
include(cmake/ParseAndDetectPlatforms.cmake)
include(cmake/LinkStacktrace.cmake)

if (DEFINED ENV{DXFEED_GRAAL_NATIVE_SDK_URL})
if (DXFCXX_USE_DXFG_STUB)
FetchContent_Declare(
DxFeedGraalNativeSdk
URL $ENV{DXFEED_GRAAL_NATIVE_SDK_URL}
GIT_REPOSITORY "${DXFG_STUB_REPO}.git" GIT_TAG "v${DXFEED_GRAAL_NATIVE_SDK_VERSION}"
USES_TERMINAL_DOWNLOAD TRUE
GIT_PROGRESS TRUE
DOWNLOAD_NO_EXTRACT FALSE
)
else ()
if (DXFCXX_USE_DXFEED_GRAAL_NATIVE_SDK_JFROG)
set(DXFEED_GRAAL_NATIVE_SDK_URL "${DXFEED_GRAAL_NATIVE_SDK_JFROG_BASE_URL}${DXFEED_GRAAL_NATIVE_SDK_VERSION}/graal-native-sdk-${DXFEED_GRAAL_NATIVE_SDK_VERSION}")
endif ()

if (DXFCXX_GRAAL_TARGET_PLATFORM STREQUAL "unknown-unknown")
message(ERROR "Unsupported platform!")
if (DEFINED ENV{DXFEED_GRAAL_NATIVE_SDK_URL})
FetchContent_Declare(
DxFeedGraalNativeSdk
URL $ENV{DXFEED_GRAAL_NATIVE_SDK_URL}
USES_TERMINAL_DOWNLOAD TRUE
GIT_PROGRESS TRUE
DOWNLOAD_NO_EXTRACT FALSE
)
else ()
set(DXFEED_GRAAL_NATIVE_SDK_URL ${DXFEED_GRAAL_NATIVE_SDK_URL}-${DXFCXX_GRAAL_TARGET_PLATFORM}.zip)
if (DXFCXX_USE_DXFEED_GRAAL_NATIVE_SDK_JFROG)
set(DXFEED_GRAAL_NATIVE_SDK_URL "${DXFEED_GRAAL_NATIVE_SDK_JFROG_BASE_URL}${DXFEED_GRAAL_NATIVE_SDK_VERSION}/graal-native-sdk-${DXFEED_GRAAL_NATIVE_SDK_VERSION}")
endif ()

if (DXFCXX_GRAAL_TARGET_PLATFORM STREQUAL "unknown-unknown")
message(ERROR "Unsupported platform!")
else ()
set(DXFEED_GRAAL_NATIVE_SDK_URL ${DXFEED_GRAAL_NATIVE_SDK_URL}-${DXFCXX_GRAAL_TARGET_PLATFORM}.zip)
endif ()

FetchContent_Declare(
DxFeedGraalNativeSdk
URL ${DXFEED_GRAAL_NATIVE_SDK_URL}
USES_TERMINAL_DOWNLOAD TRUE
GIT_PROGRESS TRUE
DOWNLOAD_NO_EXTRACT FALSE
)
endif ()

FetchContent_Declare(
DxFeedGraalNativeSdk
URL ${DXFEED_GRAAL_NATIVE_SDK_URL}
USES_TERMINAL_DOWNLOAD TRUE
GIT_PROGRESS TRUE
DOWNLOAD_NO_EXTRACT FALSE
)
endif ()

FetchContent_MakeAvailable(DxFeedGraalNativeSdk)
Expand Down Expand Up @@ -196,9 +210,14 @@ set(dxFeedGraalCxxApi_Isolated_Sources
src/isolated/api/IsolatedDXPublisher.cpp
src/isolated/api/IsolatedDXPublisherObservableSubscription.cpp
src/isolated/api/osub/IsolatedObservableSubscriptionChangeListener.cpp
src/isolated/auth/IsolatedAuthToken.cpp
src/isolated/promise/IsolatedPromise.cpp
src/isolated/internal/IsolatedString.cpp
src/isolated/internal/IsolatedObject.cpp
src/isolated/internal/IsolatedTimeFormat.cpp
src/isolated/internal/IsolatedTools.cpp
src/isolated/util/IsolatedTimePeriod.cpp
src/isolated/ipf/IsolatedInstrumentProfileReader.cpp
)

set(dxFeedGraalCxxApi_Api_Sources
Expand All @@ -216,6 +235,10 @@ set(dxFeedGraalCxxApi_ApiOsub_Sources
src/api/osub/ObservableSubscriptionChangeListener.cpp
)

set(dxFeedGraalCxxApi_Auth_Sources
src/auth/AuthToken.cpp
)

set(dxFeedGraalCxxApi_Ipf_Sources
src/ipf/InstrumentProfile.cpp
src/ipf/InstrumentProfileType.cpp
Expand Down Expand Up @@ -311,6 +334,10 @@ set(dxFeedGraalCxxApi_Schedule_Sources
src/schedule/Schedule.cpp
)

set(dxFeedGraalCxxApi_Util_Sources
src/util/TimePeriod.cpp
)

set(dxFeedGraalCxxApi_Sources
${dxFeedGraalCxxApi_Internal_Sources}
${dxFeedGraalCxxApi_InternalUtils_Sources}
Expand All @@ -319,6 +346,7 @@ set(dxFeedGraalCxxApi_Sources
${dxFeedGraalCxxApi_Exceptions_Sources}
${dxFeedGraalCxxApi_Api_Sources}
${dxFeedGraalCxxApi_ApiOsub_Sources}
${dxFeedGraalCxxApi_Auth_Sources}
${dxFeedGraalCxxApi_Ipf_Sources}
${dxFeedGraalCxxApi_OnDemand_Sources}
${dxFeedGraalCxxApi_Promise_Sources}
Expand All @@ -330,6 +358,7 @@ set(dxFeedGraalCxxApi_Sources
${dxFeedGraalCxxApi_EventOption_Sources}
${dxFeedGraalCxxApi_EventMisc_Sources}
${dxFeedGraalCxxApi_Schedule_Sources}
${dxFeedGraalCxxApi_Util_Sources}
)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
Expand Down
2 changes: 1 addition & 1 deletion DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Compile-time

- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v1.1.16
- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v1.1.21
- [Boost](https://github.com/boostorg/boost) v1.84.0
- Boost.Stacktrace 1.0
- [utfcpp](https://github.com/nemtrif/utfcpp) v3.2.3
Expand Down
12 changes: 12 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

* **\[MDAPI-26]\[C++]** Migrate to Graal SDK v1.1.21.
* Added `Day::getSessions` method.
* New order sources added: `CEDX` and `cedx`.
* Added the ability to use dxFeed Graal SDK stub. In other words, now API can be built for any 32 and 64 platforms.
* Added `TimePeriod` class.
* Added `DXFeedSubscription::getAggregationPeriod` and `DXFeedSubscription::setAggregationPeriod` methods.
* Added `DXFeedSubscription::getEventsBatchLimit` and `DXFeedSubscription::setEventsBatchLimit` methods.
* Added `AuthToken` class.
* Added `InstrumentProfileReader::readFromFile(address, token)` method.

## v2.0.0
5 changes: 3 additions & 2 deletions cmake/ParseAndDetectPlatforms.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
#MESSAGE(STATUS "DXFCXX_TARGET_PLATFORM: ${DXFCXX_TARGET_PLATFORM}")
#MESSAGE(STATUS "DXFCXX_TARGET_OS: ${DXFCXX_TARGET_OS}")
#MESSAGE(STATUS "DXFCXX_TARGET_CPU: ${DXFCXX_TARGET_CPU}")
#MESSAGE(STATUS "DXFCXX_CUSTOM_CPU: $ENV{DXFCXX_CUSTOM_CPU}")

if ((DXFCXX_GRAAL_TARGET_PLATFORM STREQUAL "unknown-unknown") AND (DXFCXX_TARGET_PLATFORM STREQUAL "unknown-unknown"))
if ((DEFINED $ENV{DXFCXX_CUSTOM_OS}) AND (DXFCXX_TARGET_OS STREQUAL "unknown"))
if ((DEFINED ENV{DXFCXX_CUSTOM_OS}) AND (DXFCXX_TARGET_OS STREQUAL "unknown"))
if ($ENV{DXFCXX_CUSTOM_OS} MATCHES "win")
set(DXFCXX_TARGET_OS "windows")
set(DXFCXX_GRAAL_TARGET_OS "windows")
Expand All @@ -25,7 +26,7 @@ if ((DXFCXX_GRAAL_TARGET_PLATFORM STREQUAL "unknown-unknown") AND (DXFCXX_TARGET
endif ()
endif ()

if ((DEFINED $ENV{DXFCXX_CUSTOM_CPU}) AND (${DXFCXX_TARGET_CPU} STREQUAL "unknown"))
if ((DEFINED ENV{DXFCXX_CUSTOM_CPU}) AND (${DXFCXX_TARGET_CPU} STREQUAL "unknown"))
if (($ENV{DXFCXX_CUSTOM_CPU} MATCHES "amd64") OR ($ENV{DXFCXX_CUSTOM_CPU} MATCHES "x86_64"))
set(DXFCXX_TARGET_CPU "x86_64")
set(DXFCXX_GRAAL_TARGET_CPU "amd64")
Expand Down
7 changes: 7 additions & 0 deletions include/dxfeed_graal_cpp_api/api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251 4996)
#include "internal/utils/StringUtils.hpp"
#include "internal/utils/debug/Debug.hpp"

#include "util/TimePeriod.hpp"

#include "api/ApiModule.hpp"
#include "auth/AuthToken.hpp"
#include "ipf/IpfModule.hpp"
#include "entity/EntityModule.hpp"
#include "event/EventModule.hpp"
Expand All @@ -58,10 +61,14 @@ DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251 4996)
#include "isolated/api/IsolatedDXPublisher.hpp"
#include "isolated/api/IsolatedDXPublisherObservableSubscription.hpp"
#include "isolated/api/osub/IsolatedObservableSubscriptionChangeListener.hpp"
#include "isolated/auth/IsolatedAuthToken.hpp"
#include "isolated/promise/IsolatedPromise.hpp"
#include "isolated/internal/IsolatedString.hpp"
#include "isolated/internal/IsolatedObject.hpp"
#include "isolated/internal/IsolatedTimeFormat.hpp"
#include "isolated/internal/IsolatedTools.hpp"
#include "isolated/ipf/IsolatedInstrumentProfileReader.hpp"
#include "isolated/util/IsolatedTimePeriod.hpp"

#include "ondemand/OnDemandService.hpp"

Expand Down
1 change: 1 addition & 0 deletions include/dxfeed_graal_cpp_api/api/DXFeed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ struct DXFCPP_EXPORT DXFeed : SharedEntity {

/**
* Requests time series of events for the specified event type, symbol, and a range of time.
*
* @tparam E The type of event.
* @param symbol The symbol.
* @param fromTime The time, inclusive, to request events from (see TimeSeriesEvent::getTime()).
Expand Down
Loading