Skip to content
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
2 changes: 1 addition & 1 deletion .pipelines/foundry-local-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ variables:
- name: cppOrtVersion
value: '1.28.0'
- name: cppGenaiVersion
value: '0.15.1'
value: '0.15.2'
- name: cppWinmlVersion
value: '2.1.70'
- name: cppBuildConfig
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/v2/sdk_v2-pipeline-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ purposes:
Versions are pipeline-level variables, currently:

* `ortVersion` `1.28.0` (`Microsoft.ML.OnnxRuntime`)
* `genaiVersion` `0.15.1` (`Microsoft.ML.OnnxRuntimeGenAI.Foundry`)
* `genaiVersion` `0.15.2` (`Microsoft.ML.OnnxRuntimeGenAI.Foundry`)
* `winmlVersion` `2.1.70` (`Microsoft.Windows.AI.MachineLearning`, WinML 2.x reg-free)

These must be kept in sync with the cmake defaults and with
Expand Down
47 changes: 42 additions & 5 deletions sdk_v2/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ find_package(nlohmann_json CONFIG REQUIRED)
find_package(azure-storage-blobs-cpp CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(Microsoft.GSL CONFIG REQUIRED)
find_package(LibArchive REQUIRED)

if(FOUNDRY_LOCAL_BUILD_SERVICE)
find_package(oatpp CONFIG REQUIRED)
endif()

if(FOUNDRY_LOCAL_BUILD_TESTS)
find_package(GTest CONFIG REQUIRED)
find_package(ZLIB REQUIRED)
enable_testing()
endif()

Expand Down Expand Up @@ -104,6 +106,7 @@ if(WIN32)
src/platform/windows/path.cc
src/platform/windows/file_io.cc
src/platform/windows/cross_process_file_lock.cc
src/platform/windows/dynlib_loader.cc
)
else()
list(APPEND FOUNDRY_LOCAL_PLATFORM_SOURCES
Expand All @@ -112,6 +115,13 @@ else()
src/platform/posix/file_io.cc
src/platform/posix/cross_process_file_lock.cc
)
# Android does not support the dlopen-based loader; dynlib_loader.cc is
# only compiled for Linux and macOS.
if(NOT ANDROID)
list(APPEND FOUNDRY_LOCAL_PLATFORM_SOURCES
src/platform/posix/dynlib_loader.cc
)
endif()
endif()

# WinML EP bootstrapper is only built when the WinML EP catalog package is
Expand All @@ -125,6 +135,24 @@ if(WinMLEpCatalog_FOUND)
)
endif()

string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" FOUNDRY_LOCAL_SYSTEM_PROCESSOR)
set(FOUNDRY_LOCAL_HAS_EP_BOOTSTRAPPERS ON)
if(ANDROID OR
(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
NOT FOUNDRY_LOCAL_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64)$"))
set(FOUNDRY_LOCAL_HAS_EP_BOOTSTRAPPERS OFF)
endif()

if(FOUNDRY_LOCAL_HAS_EP_BOOTSTRAPPERS)
list(APPEND FOUNDRY_LOCAL_PLATFORM_SOURCES
src/ep_detection/cuda_ep_bootstrapper.cc
src/ep_detection/cuda_ep_manifest.cc
src/ep_detection/ep_bundle_installer.cc
src/ep_detection/nvml_gpu_detector.cc
src/ep_detection/webgpu_ep_bootstrapper.cc
)
endif()

if(ANDROID)
list(APPEND FOUNDRY_LOCAL_PLATFORM_SOURCES src/platform/android/ssl_cert_checker.cc)
endif()
Expand Down Expand Up @@ -160,11 +188,8 @@ set(FOUNDRY_LOCAL_SOURCES
src/download/file_writer.cc
src/download/inference_model_writer.cc
src/download/model_registry_client.cc
src/ep_detection/cuda_ep_bootstrapper.cc
src/ep_detection/ep_detector.cc
src/ep_detection/ep_utils.cc
src/ep_detection/runtime_version_info.cc
src/ep_detection/webgpu_ep_bootstrapper.cc
src/exception.cc
src/inferencing/generative/genai_config.cc
src/http/http_client.cc
Expand Down Expand Up @@ -239,8 +264,14 @@ function(foundry_local_configure_target TARGET LINK_SCOPE)
Azure::azure-core
Azure::azure-storage-blobs
spdlog::spdlog
LibArchive::LibArchive
${CMAKE_DL_LIBS}
)

if(WIN32)
target_link_libraries(${TARGET} ${LINK_SCOPE} shell32 ole32)
endif()

if(TARGET OnnxRuntimeGenAI::OnnxRuntimeGenAI)
target_link_libraries(${TARGET} ${LINK_SCOPE}
OnnxRuntimeGenAI::OnnxRuntimeGenAI
Expand All @@ -253,15 +284,21 @@ function(foundry_local_configure_target TARGET LINK_SCOPE)
if(WIN32)
target_link_libraries(${TARGET} ${LINK_SCOPE} dbghelp bcrypt)
# UWP builds have CMAKE_SYSTEM_NAME = "WindowsStore"; desktop = "Windows".
# WinHTTP is not available in UWP, so only define this on desktop Windows.
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
target_compile_definitions(${TARGET} PRIVATE FOUNDRY_LOCAL_USE_WINHTTP_TRANSPORT=1)
target_compile_definitions(${TARGET} PRIVATE
FOUNDRY_LOCAL_DESKTOP_WINDOWS=1
FOUNDRY_LOCAL_USE_WINHTTP_TRANSPORT=1
)
endif()
endif()

if(ANDROID)
target_link_libraries(${TARGET} ${LINK_SCOPE} log)
endif()
target_compile_definitions(
${TARGET}
PRIVATE FOUNDRY_LOCAL_HAS_EP_BOOTSTRAPPERS=$<BOOL:${FOUNDRY_LOCAL_HAS_EP_BOOTSTRAPPERS}>
)

if(FOUNDRY_LOCAL_BUILD_SERVICE)
target_link_libraries(${TARGET} ${LINK_SCOPE} oatpp::oatpp)
Expand Down
Loading
Loading