diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake index 3223724693a49..2ced44ae505db 100644 --- a/cmake/external/abseil-cpp.cmake +++ b/cmake/external/abseil-cpp.cmake @@ -22,11 +22,12 @@ endif() # currently absl::lts_20240116 which affects abseil-cpp.natvis debugger # visualization file, that must be adjusted accordingly, unless we eliminate # that namespace at build time. -FetchContent_Declare( +onnxruntime_fetchcontent_declare( abseil_cpp URL ${DEP_URL_abseil_cpp} URL_HASH SHA1=${DEP_SHA1_abseil_cpp} PATCH_COMMAND ${ABSL_PATCH_COMMAND} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS 20240116 NAMES absl ) diff --git a/cmake/external/composable_kernel.cmake b/cmake/external/composable_kernel.cmake index 4230eb8f4259b..202fc3394dd4e 100644 --- a/cmake/external/composable_kernel.cmake +++ b/cmake/external/composable_kernel.cmake @@ -1,10 +1,11 @@ set(PATCH ${PROJECT_SOURCE_DIR}/patches/composable_kernel/Fix_Clang_Build.patch) include(FetchContent) -FetchContent_Declare(composable_kernel +onnxruntime_fetchcontent_declare(composable_kernel URL ${DEP_URL_composable_kernel} URL_HASH SHA1=${DEP_SHA1_composable_kernel} PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PATCH} + EXCLUDE_FROM_ALL ) FetchContent_GetProperties(composable_kernel) diff --git a/cmake/external/cutlass.cmake b/cmake/external/cutlass.cmake index 1ece2e7a509ba..fcb770309fae6 100644 --- a/cmake/external/cutlass.cmake +++ b/cmake/external/cutlass.cmake @@ -1,9 +1,10 @@ include(FetchContent) -FetchContent_Declare( +onnxruntime_fetchcontent_declare( cutlass URL ${DEP_URL_cutlass} URL_HASH SHA1=${DEP_SHA1_cutlass} PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/cutlass/cutlass_3.5.0.patch + EXCLUDE_FROM_ALL ) FetchContent_GetProperties(cutlass) diff --git a/cmake/external/dml.cmake b/cmake/external/dml.cmake index 54e361ffdb3ae..6c77d162d679c 100644 --- a/cmake/external/dml.cmake +++ b/cmake/external/dml.cmake @@ -100,10 +100,11 @@ else() endif() endif() -FetchContent_Declare( +onnxruntime_fetchcontent_declare( directx_headers URL ${DEP_URL_directx_headers} URL_HASH SHA1=${DEP_SHA1_directx_headers} + EXCLUDE_FROM_ALL ) FetchContent_Populate(directx_headers) diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake index b123adb624fa4..3e09d2cdb917f 100644 --- a/cmake/external/eigen.cmake +++ b/cmake/external/eigen.cmake @@ -3,10 +3,11 @@ if (onnxruntime_USE_PREINSTALLED_EIGEN) file(TO_CMAKE_PATH ${eigen_SOURCE_PATH} eigen_INCLUDE_DIRS) target_include_directories(eigen INTERFACE ${eigen_INCLUDE_DIRS}) else () - FetchContent_Declare( + onnxruntime_fetchcontent_declare( eigen URL ${DEP_URL_eigen} URL_HASH SHA1=${DEP_SHA1_eigen} + EXCLUDE_FROM_ALL ) FetchContent_Populate(eigen) diff --git a/cmake/external/extensions.cmake b/cmake/external/extensions.cmake index 68796ad02d982..e12d74d734e97 100644 --- a/cmake/external/extensions.cmake +++ b/cmake/external/extensions.cmake @@ -38,10 +38,11 @@ endif() # onnxruntime-extensions if (NOT onnxruntime_EXTENSIONS_OVERRIDDEN) - FetchContent_Declare( + onnxruntime_fetchcontent_declare( extensions URL ${DEP_URL_extensions} URL_HASH SHA1=${DEP_SHA1_extensions} + EXCLUDE_FROM_ALL ) onnxruntime_fetchcontent_makeavailable(extensions) else() diff --git a/cmake/external/helper_functions.cmake b/cmake/external/helper_functions.cmake index eefb3ba2e800a..b0a44f5c22988 100644 --- a/cmake/external/helper_functions.cmake +++ b/cmake/external/helper_functions.cmake @@ -1,173 +1,34 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -# This file was copied from cmake source with modifications: -# 1. Add the EXCLUDE_FROM_ALL keyword when this function calls add_subdirectory. It will also resolve the -# 'make install' issue. -# 2. Group the VC projects into the "external" folder. We can do it at there in a centralized way instead +# This file contains some wrappers for cmake's FetchContent functions. The wrappers added the following functionalities: +# 1. Group the VC projects into the "external" folder. We can do it at there in a centralized way instead # of doing it one by one. -# 3. Set the cmake property COMPILE_WARNING_AS_ERROR to OFF for these external projects. - -macro(onnxruntime_fetchcontent_makeavailable) - - # We must append an item, even if the variable is unset, so prefix its value. - # We will strip that prefix when we pop the value at the end of the macro. - list(APPEND __cmake_fcCurrentVarsStack - "__fcprefix__${CMAKE_VERIFY_INTERFACE_HEADER_SETS}" - ) - set(CMAKE_VERIFY_INTERFACE_HEADER_SETS FALSE) - - get_property(__cmake_providerCommand GLOBAL PROPERTY - __FETCHCONTENT_MAKEAVAILABLE_SERIAL_PROVIDER - ) - foreach(__cmake_contentName IN ITEMS ${ARGV}) - string(TOLOWER ${__cmake_contentName} __cmake_contentNameLower) - - # If user specified FETCHCONTENT_SOURCE_DIR_... for this dependency, that - # overrides everything else and we shouldn't try to use find_package() or - # a dependency provider. - string(TOUPPER ${__cmake_contentName} __cmake_contentNameUpper) - if("${FETCHCONTENT_SOURCE_DIR_${__cmake_contentNameUpper}}" STREQUAL "") - # Dependency provider gets first opportunity, but prevent infinite - # recursion if we are called again for the same thing - if(NOT "${__cmake_providerCommand}" STREQUAL "" AND - NOT DEFINED __cmake_fcProvider_${__cmake_contentNameLower}) - message(VERBOSE - "Trying FETCHCONTENT_MAKEAVAILABLE_SERIAL dependency provider for " - "${__cmake_contentName}" - ) - # It's still valid if there are no saved details. The project may have - # been written to assume a dependency provider is always set and will - # provide dependencies without having any declared details for them. - __FetchContent_getSavedDetails(${__cmake_contentName} __cmake_contentDetails) - set(__cmake_providerArgs - "FETCHCONTENT_MAKEAVAILABLE_SERIAL" - "${__cmake_contentName}" - ) - # Empty arguments must be preserved because of things like - # GIT_SUBMODULES (see CMP0097) - foreach(__cmake_item IN LISTS __cmake_contentDetails) - string(APPEND __cmake_providerArgs " [==[${__cmake_item}]==]") - endforeach() - - # This property might be defined but empty. As long as it is defined, - # find_package() can be called. - get_property(__cmake_addfpargs GLOBAL PROPERTY - _FetchContent_${contentNameLower}_find_package_args - DEFINED - ) - if(__cmake_addfpargs) - get_property(__cmake_fpargs GLOBAL PROPERTY - _FetchContent_${contentNameLower}_find_package_args - ) - string(APPEND __cmake_providerArgs " FIND_PACKAGE_ARGS") - foreach(__cmake_item IN LISTS __cmake_fpargs) - string(APPEND __cmake_providerArgs " [==[${__cmake_item}]==]") - endforeach() - endif() - - # Calling the provider could lead to onnxruntime_fetchcontent_makeavailable() being - # called for a nested dependency. That nested call may occur in the - # current variable scope. We have to save and restore the variables we - # need preserved. - list(APPEND __cmake_fcCurrentVarsStack - ${__cmake_contentName} - ${__cmake_contentNameLower} - ) - - set(__cmake_fcProvider_${__cmake_contentNameLower} YES) - cmake_language(EVAL CODE "${__cmake_providerCommand}(${__cmake_providerArgs})") - - list(POP_BACK __cmake_fcCurrentVarsStack - __cmake_contentNameLower - __cmake_contentName - ) - - unset(__cmake_fcProvider_${__cmake_contentNameLower}) - unset(__cmake_providerArgs) - unset(__cmake_addfpargs) - unset(__cmake_fpargs) - unset(__cmake_item) - unset(__cmake_contentDetails) - - FetchContent_GetProperties(${__cmake_contentName}) - if(${__cmake_contentNameLower}_POPULATED) - continue() - endif() - endif() - - # Check if we've been asked to try find_package() first, even if we - # have already populated this dependency. If we previously tried to - # use find_package() for this and it succeeded, those things might - # no longer be in scope, so we have to do it again. - get_property(__cmake_haveFpArgs GLOBAL PROPERTY - _FetchContent_${__cmake_contentNameLower}_find_package_args DEFINED - ) - if(__cmake_haveFpArgs) - unset(__cmake_haveFpArgs) - message(VERBOSE "Trying find_package(${__cmake_contentName} ...) before FetchContent") - get_property(__cmake_fpArgs GLOBAL PROPERTY - _FetchContent_${__cmake_contentNameLower}_find_package_args - ) - - # This call could lead to onnxruntime_fetchcontent_makeavailable() being called for - # a nested dependency and it may occur in the current variable scope. - # We have to save/restore the variables we need to preserve. - list(APPEND __cmake_fcCurrentNameStack - ${__cmake_contentName} - ${__cmake_contentNameLower} - ) - find_package(${__cmake_contentName} ${__cmake_fpArgs}) - list(POP_BACK __cmake_fcCurrentNameStack - __cmake_contentNameLower - __cmake_contentName - ) - unset(__cmake_fpArgs) - - if(${__cmake_contentName}_FOUND) - FetchContent_SetPopulated(${__cmake_contentName}) - FetchContent_GetProperties(${__cmake_contentName}) - continue() - endif() - endif() - else() - unset(__cmake_haveFpArgs) +# 2. Set the cmake property COMPILE_WARNING_AS_ERROR to OFF for these external projects. + +function(onnxruntime_fetchcontent_declare contentName) + FetchContent_Declare(${ARGV}) + string(TOLOWER ${contentName} contentNameLower) + list(FIND ARGN SOURCE_SUBDIR index_SOURCE_SUBDIR) + if(index_SOURCE_SUBDIR GREATER_EQUAL 0) + cmake_parse_arguments(PARSE_ARGV 1 ARG "" "SOURCE_SUBDIR" "") + set(onnxruntime_${contentNameLower}_cmake_src_dir "${ARG_SOURCE_SUBDIR}" PARENT_SCOPE) endif() +endfunction() - FetchContent_GetProperties(${__cmake_contentName}) - if(NOT ${__cmake_contentNameLower}_POPULATED) - FetchContent_Populate(${__cmake_contentName}) - __FetchContent_setupFindPackageRedirection(${__cmake_contentName}) - - # Only try to call add_subdirectory() if the populated content - # can be treated that way. Protecting the call with the check - # allows this function to be used for projects that just want - # to ensure the content exists, such as to provide content at - # a known location. We check the saved details for an optional - # SOURCE_SUBDIR which can be used in the same way as its meaning - # for ExternalProject. It won't matter if it was passed through - # to the ExternalProject sub-build, since it would have been - # ignored there. - set(__cmake_srcdir "${${__cmake_contentNameLower}_SOURCE_DIR}") - __FetchContent_getSavedDetails(${__cmake_contentName} __cmake_contentDetails) - if("${__cmake_contentDetails}" STREQUAL "") - message(FATAL_ERROR "No details have been set for content: ${__cmake_contentName}") - endif() - cmake_parse_arguments(__cmake_arg "SYSTEM" "SOURCE_SUBDIR" "" ${__cmake_contentDetails}) - if(NOT "${__cmake_arg_SOURCE_SUBDIR}" STREQUAL "") - string(APPEND __cmake_srcdir "/${__cmake_arg_SOURCE_SUBDIR}") +macro(onnxruntime_fetchcontent_makeavailable) + set(ONNXRUNTIME_CMAKE_SKIP_INSTALL_RULES_OLD_VALUE + "${CMAKE_SKIP_INSTALL_RULES}") + # If we don't skip the install rules we will hit errors from re2 like: + # CMake Error: install(EXPORT "re2Targets" ...) includes target "re2" which requires target "absl_base" that is not in any export set. + set(CMAKE_SKIP_INSTALL_RULES TRUE) + FetchContent_MakeAvailable(${ARGV}) + foreach(contentName IN ITEMS ${ARGV}) + string(TOLOWER ${contentName} contentNameLower) + set(content_src_dir "${${contentNameLower}_SOURCE_DIR}") + if(NOT "${onnxruntime_${contentNameLower}_cmake_src_dir}" STREQUAL "") + string(APPEND content_src_dir "/${onnxruntime_${contentNameLower}_cmake_src_dir}") endif() - - if(EXISTS ${__cmake_srcdir}/CMakeLists.txt) - set(CMAKE_SKIP_INSTALL_RULES TRUE) - if (__cmake_arg_SYSTEM) - add_subdirectory(${__cmake_srcdir} ${${__cmake_contentNameLower}_BINARY_DIR} SYSTEM) - else() - add_subdirectory(${__cmake_srcdir} ${${__cmake_contentNameLower}_BINARY_DIR} EXCLUDE_FROM_ALL) - endif() - get_property(subdir_import_targets DIRECTORY "${__cmake_srcdir}" PROPERTY BUILDSYSTEM_TARGETS) - foreach(subdir_target ${subdir_import_targets}) - if(TARGET ${subdir_target}) + get_property(subdir_import_targets DIRECTORY "${content_src_dir}" PROPERTY BUILDSYSTEM_TARGETS) + foreach(subdir_target ${subdir_import_targets}) + if(TARGET ${subdir_target}) get_target_property(subdir_target_type ${subdir_target} TYPE) if(subdir_target_type STREQUAL "EXECUTABLE") get_target_property(subdir_target_osx_arch ${subdir_target} OSX_ARCHITECTURES) @@ -179,27 +40,8 @@ macro(onnxruntime_fetchcontent_makeavailable) endif() set_target_properties(${subdir_target} PROPERTIES FOLDER "External") set_target_properties(${subdir_target} PROPERTIES COMPILE_WARNING_AS_ERROR OFF) - endif() - endforeach() - set(CMAKE_SKIP_INSTALL_RULES FALSE) - endif() - - unset(__cmake_srcdir) - unset(__cmake_contentDetails) - unset(__cmake_arg_SOURCE_SUBDIR) - endif() - endforeach() - # Prefix will be "__fcprefix__" - list(POP_BACK __cmake_fcCurrentVarsStack __cmake_original_verify_setting) - string(SUBSTRING "${__cmake_original_verify_setting}" - 12 -1 __cmake_original_verify_setting - ) - set(CMAKE_VERIFY_INTERFACE_HEADER_SETS ${__cmake_original_verify_setting}) - - # clear local variables to prevent leaking into the caller's scope - unset(__cmake_contentName) - unset(__cmake_contentNameLower) - unset(__cmake_contentNameUpper) - unset(__cmake_providerCommand) - unset(__cmake_original_verify_setting) + endif() + endforeach() + endforeach() + set(CMAKE_SKIP_INSTALL_RULES ${ONNXRUNTIME_CMAKE_SKIP_INSTALL_RULES_OLD_VALUE}) endmacro() diff --git a/cmake/external/neural_speed.cmake b/cmake/external/neural_speed.cmake index 3fe9c660f89d6..5ac88b9439a7e 100644 --- a/cmake/external/neural_speed.cmake +++ b/cmake/external/neural_speed.cmake @@ -5,11 +5,12 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND onnxruntime_target_platfo endif() if(USE_NEURAL_SPEED) - FetchContent_Declare( + onnxruntime_fetchcontent_declare( neural_speed URL ${DEP_URL_neural_speed} URL_HASH SHA1=${DEP_SHA1_neural_speed} PATCH_COMMAND ${Patch_EXECUTABLE} -p1 < ${PROJECT_SOURCE_DIR}/patches/neural_speed/150e7527d5286ddd3a995c228dedf8d76a7a86bc.patch + EXCLUDE_FROM_ALL ) set(BTLA_USE_OPENMP OFF) onnxruntime_fetchcontent_makeavailable(neural_speed) diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index 14e6ed515fd6e..5eb9cf2fdce0f 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -33,10 +33,11 @@ include(external/abseil-cpp.cmake) set(RE2_BUILD_TESTING OFF CACHE BOOL "" FORCE) -FetchContent_Declare( +onnxruntime_fetchcontent_declare( re2 URL ${DEP_URL_re2} URL_HASH SHA1=${DEP_SHA1_re2} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS NAMES re2 ) @@ -62,10 +63,11 @@ if (onnxruntime_BUILD_UNIT_TESTS) set(GTEST_HAS_ABSL ON CACHE BOOL "" FORCE) endif() # gtest and gmock - FetchContent_Declare( + onnxruntime_fetchcontent_declare( googletest URL ${DEP_URL_googletest} URL_HASH SHA1=${DEP_SHA1_googletest} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS 1.14.0...<2.0.0 NAMES GTest ) endif() @@ -76,27 +78,30 @@ if (onnxruntime_BUILD_BENCHMARKS) # We will not need to install benchmark since we link it statically. set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Disable benchmark install to avoid overwriting vendor install.") - FetchContent_Declare( + onnxruntime_fetchcontent_declare( google_benchmark URL ${DEP_URL_google_benchmark} URL_HASH SHA1=${DEP_SHA1_google_benchmark} + EXCLUDE_FROM_ALL ) endif() if (NOT WIN32) - FetchContent_Declare( + onnxruntime_fetchcontent_declare( google_nsync URL ${DEP_URL_google_nsync} URL_HASH SHA1=${DEP_SHA1_google_nsync} FIND_PACKAGE_ARGS NAMES nsync + EXCLUDE_FROM_ALL ) endif() list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/external) -FetchContent_Declare( +onnxruntime_fetchcontent_declare( mimalloc URL ${DEP_URL_mimalloc} URL_HASH SHA1=${DEP_SHA1_mimalloc} + EXCLUDE_FROM_ALL ) @@ -116,20 +121,22 @@ else() endif() #flatbuffers 1.11.0 does not have flatbuffers::IsOutRange, therefore we require 1.12.0+ -FetchContent_Declare( +onnxruntime_fetchcontent_declare( flatbuffers URL ${DEP_URL_flatbuffers} URL_HASH SHA1=${DEP_SHA1_flatbuffers} PATCH_COMMAND ${ONNXRUNTIME_FLATBUFFERS_PATCH_COMMAND} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS 23.5.9 NAMES Flatbuffers ) #Protobuf depends on utf8_range -FetchContent_Declare( +onnxruntime_fetchcontent_declare( utf8_range URL ${DEP_URL_utf8_range} URL_HASH SHA1=${DEP_SHA1_utf8_range} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS NAMES utf8_range ) @@ -146,7 +153,7 @@ if(NOT ONNX_CUSTOM_PROTOC_EXECUTABLE) # Using CMAKE_CROSSCOMPILING is not recommended for Apple target devices. # https://cmake.org/cmake/help/v3.26/variable/CMAKE_CROSSCOMPILING.html # To keep it simple, just download and use the universal protoc binary for all Apple host builds. - FetchContent_Declare(protoc_binary URL ${DEP_URL_protoc_mac_universal} URL_HASH SHA1=${DEP_SHA1_protoc_mac_universal}) + onnxruntime_fetchcontent_declare(protoc_binary URL ${DEP_URL_protoc_mac_universal} URL_HASH SHA1=${DEP_SHA1_protoc_mac_universal} EXCLUDE_FROM_ALL) FetchContent_Populate(protoc_binary) if(protoc_binary_SOURCE_DIR) message("Use prebuilt protoc") @@ -157,10 +164,10 @@ if(NOT ONNX_CUSTOM_PROTOC_EXECUTABLE) message("CMAKE_HOST_SYSTEM_NAME: ${CMAKE_HOST_SYSTEM_NAME}") if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64") - FetchContent_Declare(protoc_binary URL ${DEP_URL_protoc_win64} URL_HASH SHA1=${DEP_SHA1_protoc_win64}) + onnxruntime_fetchcontent_declare(protoc_binary URL ${DEP_URL_protoc_win64} URL_HASH SHA1=${DEP_SHA1_protoc_win64} EXCLUDE_FROM_ALL) FetchContent_Populate(protoc_binary) elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86") - FetchContent_Declare(protoc_binary URL ${DEP_URL_protoc_win32} URL_HASH SHA1=${DEP_SHA1_protoc_win32}) + onnxruntime_fetchcontent_declare(protoc_binary URL ${DEP_URL_protoc_win32} URL_HASH SHA1=${DEP_SHA1_protoc_win32} EXCLUDE_FROM_ALL) FetchContent_Populate(protoc_binary) endif() @@ -171,13 +178,13 @@ if(NOT ONNX_CUSTOM_PROTOC_EXECUTABLE) endif() elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64)$") - FetchContent_Declare(protoc_binary URL ${DEP_URL_protoc_linux_x64} URL_HASH SHA1=${DEP_SHA1_protoc_linux_x64}) + onnxruntime_fetchcontent_declare(protoc_binary URL ${DEP_URL_protoc_linux_x64} URL_HASH SHA1=${DEP_SHA1_protoc_linux_x64} EXCLUDE_FROM_ALL) FetchContent_Populate(protoc_binary) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86?)$") - FetchContent_Declare(protoc_binary URL ${DEP_URL_protoc_linux_x86} URL_HASH SHA1=${DEP_SHA1_protoc_linux_x86}) + onnxruntime_fetchcontent_declare(protoc_binary URL ${DEP_URL_protoc_linux_x86} URL_HASH SHA1=${DEP_SHA1_protoc_linux_x86} EXCLUDE_FROM_ALL) FetchContent_Populate(protoc_binary) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64.*") - FetchContent_Declare(protoc_binary URL ${DEP_URL_protoc_linux_aarch64} URL_HASH SHA1=${DEP_SHA1_protoc_linux_aarch64}) + onnxruntime_fetchcontent_declare(protoc_binary URL ${DEP_URL_protoc_linux_aarch64} URL_HASH SHA1=${DEP_SHA1_protoc_linux_aarch64} EXCLUDE_FROM_ALL) FetchContent_Populate(protoc_binary) endif() @@ -215,11 +222,12 @@ else() endif() #Protobuf depends on absl and utf8_range -FetchContent_Declare( +onnxruntime_fetchcontent_declare( Protobuf URL ${DEP_URL_protobuf} URL_HASH SHA1=${DEP_SHA1_protobuf} PATCH_COMMAND ${ONNXRUNTIME_PROTOBUF_PATCH_COMMAND} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS 3.21.12 NAMES Protobuf ) @@ -245,27 +253,30 @@ include(protobuf_function) set(ENABLE_DATE_TESTING OFF CACHE BOOL "" FORCE) set(USE_SYSTEM_TZ_DB ON CACHE BOOL "" FORCE) -FetchContent_Declare( +onnxruntime_fetchcontent_declare( date URL ${DEP_URL_date} URL_HASH SHA1=${DEP_SHA1_date} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS 3...<4 NAMES date ) onnxruntime_fetchcontent_makeavailable(date) -FetchContent_Declare( +onnxruntime_fetchcontent_declare( mp11 URL ${DEP_URL_mp11} URL_HASH SHA1=${DEP_SHA1_mp11} + EXCLUDE_FROM_ALL ) set(JSON_BuildTests OFF CACHE INTERNAL "") set(JSON_Install OFF CACHE INTERNAL "") -FetchContent_Declare( +onnxruntime_fetchcontent_declare( nlohmann_json URL ${DEP_URL_json} URL_HASH SHA1=${DEP_SHA1_json} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS 3.10 NAMES nlohmann_json ) @@ -308,11 +319,12 @@ endif() # Android build should use the system's log library instead of clog if ((CPUINFO_SUPPORTED OR onnxruntime_USE_XNNPACK) AND NOT ANDROID) set(CLOG_BUILD_TESTS OFF CACHE BOOL "" FORCE) - FetchContent_Declare( + onnxruntime_fetchcontent_declare( pytorch_clog URL ${DEP_URL_pytorch_cpuinfo} URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo} SOURCE_SUBDIR deps/clog + EXCLUDE_FROM_ALL ) set(ONNXRUNTIME_CLOG_PROJ pytorch_clog) set(ONNXRUNTIME_CLOG_TARGET_NAME clog) @@ -337,18 +349,20 @@ if (CPUINFO_SUPPORTED) set(CPUINFO_BUILD_BENCHMARKS OFF CACHE INTERNAL "") if(onnxruntime_target_platform STREQUAL "ARM64EC") message("Applying a patch for Windows ARM64EC in cpuinfo") - FetchContent_Declare( + onnxruntime_fetchcontent_declare( pytorch_cpuinfo URL ${DEP_URL_pytorch_cpuinfo} URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo} PATCH_COMMAND ${Patch_EXECUTABLE} -p1 < ${PROJECT_SOURCE_DIR}/patches/cpuinfo/9bb12d342fd9479679d505d93a478a6f9cd50a47.patch + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS NAMES cpuinfo ) else() - FetchContent_Declare( + onnxruntime_fetchcontent_declare( pytorch_cpuinfo URL ${DEP_URL_pytorch_cpuinfo} URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS NAMES cpuinfo ) endif() @@ -371,26 +385,29 @@ if (NOT WIN32) endif() if(onnxruntime_USE_CUDA) - FetchContent_Declare( + onnxruntime_fetchcontent_declare( GSL URL ${DEP_URL_microsoft_gsl} URL_HASH SHA1=${DEP_SHA1_microsoft_gsl} PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/gsl/1064.patch + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS 4.0 NAMES Microsoft.GSL ) else() - FetchContent_Declare( + onnxruntime_fetchcontent_declare( GSL URL ${DEP_URL_microsoft_gsl} URL_HASH SHA1=${DEP_SHA1_microsoft_gsl} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS 4.0 NAMES Microsoft.GSL ) endif() -FetchContent_Declare( +onnxruntime_fetchcontent_declare( safeint URL ${DEP_URL_safeint} URL_HASH SHA1=${DEP_SHA1_safeint} + EXCLUDE_FROM_ALL ) # use fetch content rather than makeavailable because safeint only includes unconditional test targets @@ -488,18 +505,14 @@ else() set(ONNXRUNTIME_ONNX_PATCH_COMMAND "") endif() -FetchContent_Declare( +onnxruntime_fetchcontent_declare( onnx URL ${DEP_URL_onnx} URL_HASH SHA1=${DEP_SHA1_onnx} PATCH_COMMAND ${ONNXRUNTIME_ONNX_PATCH_COMMAND} + EXCLUDE_FROM_ALL ) - - - - - include(eigen) include(wil) @@ -554,10 +567,11 @@ endif() if(onnxruntime_ENABLE_ATEN) message("Aten fallback is enabled.") - FetchContent_Declare( + onnxruntime_fetchcontent_declare( dlpack URL ${DEP_URL_dlpack} URL_HASH SHA1=${DEP_SHA1_dlpack} + EXCLUDE_FROM_ALL ) # We can't use onnxruntime_fetchcontent_makeavailable since some part of the the dlpack code is Linux only. # For example, dlpackcpp.h uses posix_memalign. @@ -567,10 +581,11 @@ endif() if(onnxruntime_ENABLE_TRAINING OR (onnxruntime_ENABLE_TRAINING_APIS AND onnxruntime_BUILD_UNIT_TESTS)) # Once code under orttraining/orttraining/models dir is removed "onnxruntime_ENABLE_TRAINING" should be removed from # this conditional - FetchContent_Declare( + onnxruntime_fetchcontent_declare( cxxopts URL ${DEP_URL_cxxopts} URL_HASH SHA1=${DEP_SHA1_cxxopts} + EXCLUDE_FROM_ALL ) set(CXXOPTS_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(CXXOPTS_BUILD_TESTS OFF CACHE BOOL "" FORCE) @@ -578,11 +593,12 @@ if(onnxruntime_ENABLE_TRAINING OR (onnxruntime_ENABLE_TRAINING_APIS AND onnxrunt endif() if (onnxruntime_USE_COREML) - FetchContent_Declare( + onnxruntime_fetchcontent_declare( coremltools URL ${DEP_URL_coremltools} URL_HASH SHA1=${DEP_SHA1_coremltools} PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/coremltools/crossplatformbuild.patch + EXCLUDE_FROM_ALL ) # we don't build directly so use Populate. selected files are built from onnxruntime_providers_coreml.cmake FetchContent_Populate(coremltools) @@ -613,3 +629,16 @@ endif() FILE(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} ORT_BINARY_DIR) FILE(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} ORT_SOURCE_DIR) + +if(onnxruntime_USE_COREML) + # Setup coremltools fp16 and json dependencies for creating an mlpackage. + # + # These are also used by external/xnnpack.cmake. fp16 depends on psimd + onnxruntime_fetchcontent_declare(psimd URL ${DEP_URL_psimd} URL_HASH SHA1=${DEP_SHA1_psimd} EXCLUDE_FROM_ALL) + onnxruntime_fetchcontent_makeavailable(psimd) + set(PSIMD_SOURCE_DIR ${psimd_SOURCE_DIR}) + onnxruntime_fetchcontent_declare(fp16 URL ${DEP_URL_fp16} URL_HASH SHA1=${DEP_SHA1_fp16} EXCLUDE_FROM_ALL) + set(FP16_BUILD_TESTS OFF CACHE INTERNAL "") + set(FP16_BUILD_BENCHMARKS OFF CACHE INTERNAL "") + onnxruntime_fetchcontent_makeavailable(fp16) +endif() \ No newline at end of file diff --git a/cmake/external/pybind11.cmake b/cmake/external/pybind11.cmake index 2c9e3cf4540c2..91049d6d6d804 100644 --- a/cmake/external/pybind11.cmake +++ b/cmake/external/pybind11.cmake @@ -1,8 +1,9 @@ -FetchContent_Declare( +onnxruntime_fetchcontent_declare( pybind11_project URL ${DEP_URL_pybind11} - URL_HASH SHA1=${DEP_SHA1_pybind11} - FIND_PACKAGE_ARGS 2.6 NAMES pybind11 + URL_HASH SHA1=${DEP_SHA1_pybind11} + EXCLUDE_FROM_ALL + FIND_PACKAGE_ARGS 2.6 NAMES pybind11 ) onnxruntime_fetchcontent_makeavailable(pybind11_project) diff --git a/cmake/external/tvm.cmake b/cmake/external/tvm.cmake index 93049c8b85853..27a09edb31570 100644 --- a/cmake/external/tvm.cmake +++ b/cmake/external/tvm.cmake @@ -1,10 +1,11 @@ if (onnxruntime_USE_TVM) message(STATUS "onnxruntime_USE_TVM: Fetch tvm for TVM EP") - FetchContent_Declare( + onnxruntime_fetchcontent_declare( tvm GIT_REPOSITORY https://github.com/apache/tvm.git GIT_TAG 2379917985919ed3918dc12cad47f469f245be7a + EXCLUDE_FROM_ALL ) FetchContent_GetProperties(tvm) diff --git a/cmake/external/wil.cmake b/cmake/external/wil.cmake index 120e986ebb552..290497af14b1f 100644 --- a/cmake/external/wil.cmake +++ b/cmake/external/wil.cmake @@ -3,10 +3,11 @@ set(WIL_BUILD_PACKAGING OFF CACHE BOOL "" FORCE) set(WIL_BUILD_TESTS OFF CACHE BOOL "" FORCE) -FetchContent_Declare( +onnxruntime_fetchcontent_declare( microsoft_wil URL ${DEP_URL_microsoft_wil} URL_HASH SHA1=${DEP_SHA1_microsoft_wil} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS NAMES wil ) diff --git a/cmake/external/xnnpack.cmake b/cmake/external/xnnpack.cmake index 41f02ce6f22bc..322562b1f3894 100644 --- a/cmake/external/xnnpack.cmake +++ b/cmake/external/xnnpack.cmake @@ -16,22 +16,23 @@ if(CMAKE_ANDROID_ARCH_ABI STREQUAL armeabi-v7a) endif() # fp16 depends on psimd -FetchContent_Declare(psimd URL ${DEP_URL_psimd} URL_HASH SHA1=${DEP_SHA1_psimd}) +onnxruntime_fetchcontent_declare(psimd URL ${DEP_URL_psimd} URL_HASH SHA1=${DEP_SHA1_psimd} EXCLUDE_FROM_ALL) onnxruntime_fetchcontent_makeavailable(psimd) -set(PSIMD_SOURCE_DIR ${psimd_SOURCE_DIR}) -FetchContent_Declare(fp16 URL ${DEP_URL_fp16} URL_HASH SHA1=${DEP_SHA1_fp16}) +set(PSIMD_SOURCE_DIR ${psimd_SOURCE_DIR} EXCLUDE_FROM_ALL) +onnxruntime_fetchcontent_declare(fp16 URL ${DEP_URL_fp16} URL_HASH SHA1=${DEP_SHA1_fp16} EXCLUDE_FROM_ALL) onnxruntime_fetchcontent_makeavailable(fp16) # pthreadpool depends on fxdiv -FetchContent_Declare(fxdiv URL ${DEP_URL_fxdiv} URL_HASH SHA1=${DEP_SHA1_fxdiv}) +onnxruntime_fetchcontent_declare(fxdiv URL ${DEP_URL_fxdiv} URL_HASH SHA1=${DEP_SHA1_fxdiv} EXCLUDE_FROM_ALL) onnxruntime_fetchcontent_makeavailable(fxdiv) set(FXDIV_SOURCE_DIR ${fxdiv_SOURCE_DIR}) -FetchContent_Declare(pthreadpool URL ${DEP_URL_pthreadpool} URL_HASH SHA1=${DEP_SHA1_pthreadpool}) +onnxruntime_fetchcontent_declare(pthreadpool URL ${DEP_URL_pthreadpool} URL_HASH SHA1=${DEP_SHA1_pthreadpool} EXCLUDE_FROM_ALL) onnxruntime_fetchcontent_makeavailable(pthreadpool) -FetchContent_Declare(googlexnnpack URL ${DEP_URL_googlexnnpack} URL_HASH SHA1=${DEP_SHA1_googlexnnpack} +onnxruntime_fetchcontent_declare(googlexnnpack URL ${DEP_URL_googlexnnpack} URL_HASH SHA1=${DEP_SHA1_googlexnnpack} PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/xnnpack/AddEmscriptenAndIosSupport.patch + EXCLUDE_FROM_ALL ) onnxruntime_fetchcontent_makeavailable(googlexnnpack) set(XNNPACK_DIR ${googlexnnpack_SOURCE_DIR}) diff --git a/cmake/onnxruntime_providers_coreml.cmake b/cmake/onnxruntime_providers_coreml.cmake index 0aa25a221bf27..aaff74725031b 100644 --- a/cmake/onnxruntime_providers_coreml.cmake +++ b/cmake/onnxruntime_providers_coreml.cmake @@ -7,26 +7,9 @@ endif() add_compile_definitions(USE_COREML=1) -# Check if we can build the coremltools code for creating an mlpackage with an mlprogram. -# The coremltools source requires std::filesystem::path which is only available from iOS 13 on. -set(_enable_ML_PROGRAM ON) -if (IOS AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 13.0) - message(WARNING "CoreML ML Program is not supported on iOS < 13.0. Excluding ML Program support from build.") - set(_enable_ML_PROGRAM OFF) -elseif(LINUX) - # uuid-dev is required. we don't bother installing on CIs as it's really for manual developer testing. - find_library(LibUUID_LIBRARY NAMES uuid) - find_path(LibUUID_INCLUDE_DIR NAMES uuid/uuid.h) - if (NOT LibUUID_INCLUDE_DIR) - message(STATUS "uuid/uuid.h was not found as is required for ML Program support. " - "Run `sudo apt install uuid-dev` if you need to test ML Program related CoreML EP code. ") - set(_enable_ML_PROGRAM OFF) - endif() -endif() -if (_enable_ML_PROGRAM) - add_compile_definitions(COREML_ENABLE_MLPROGRAM=1) -endif() +# TODO: remove this COREML_ENABLE_MLPROGRAM macro +add_compile_definitions(COREML_ENABLE_MLPROGRAM=1) # Compile CoreML proto definition to ${CMAKE_CURRENT_BINARY_DIR}/coreml_proto set(COREML_PROTO_ROOT ${coremltools_SOURCE_DIR}/mlmodel/format) @@ -93,7 +76,7 @@ file(GLOB_RECURSE "${ONNXRUNTIME_ROOT}/core/providers/coreml/builders/*.cc" ) -if(_enable_ML_PROGRAM) + # Add helpers to create mlpackage weights. limit to just the files we need to minimize the changes to make them # build on Windows and Linux. file(GLOB @@ -120,7 +103,6 @@ if(_enable_ML_PROGRAM) ) source_group(TREE ${coremltools_SOURCE_DIR} PREFIX coremltools FILES ${coremltools_srcs}) -endif() # Add CoreML objective c++ source code if (APPLE) @@ -174,20 +156,9 @@ if (APPLE) target_compile_definitions(onnxruntime_providers_coreml PRIVATE __APPLE__) endif() -if (_enable_ML_PROGRAM) - # Setup coremltools fp16 and json dependencies for creating an mlpackage. - # - # These are also used by external/xnnpack.cmake. fp16 depends on psimd - FetchContent_Declare(psimd URL ${DEP_URL_psimd} URL_HASH SHA1=${DEP_SHA1_psimd}) - onnxruntime_fetchcontent_makeavailable(psimd) - set(PSIMD_SOURCE_DIR ${psimd_SOURCE_DIR}) - FetchContent_Declare(fp16 URL ${DEP_URL_fp16} URL_HASH SHA1=${DEP_SHA1_fp16}) - set(FP16_BUILD_TESTS OFF CACHE INTERNAL "") - set(FP16_BUILD_BENCHMARKS OFF CACHE INTERNAL "") - onnxruntime_fetchcontent_makeavailable(fp16) - - # need to tweak the include paths to match what the coreml source code expects - target_include_directories(onnxruntime_providers_coreml PRIVATE + +# need to tweak the include paths to match what the coreml source code expects +target_include_directories(onnxruntime_providers_coreml PRIVATE ${fp16_SOURCE_DIR}/include ${nlohmann_json_SOURCE_DIR}/single_include/nlohmann ${coremltools_SOURCE_DIR} @@ -195,13 +166,13 @@ if (_enable_ML_PROGRAM) ${coremltools_SOURCE_DIR}/modelpackage/src/ ) - add_dependencies(onnxruntime_providers_coreml nlohmann_json::nlohmann_json fp16) +add_dependencies(onnxruntime_providers_coreml nlohmann_json::nlohmann_json fp16) - if (LINUX) - target_link_libraries(onnxruntime_providers_coreml PRIVATE uuid) - endif() +if (LINUX) + target_link_libraries(onnxruntime_providers_coreml PRIVATE uuid) endif() + if (APPLE) target_link_libraries(onnxruntime_providers_coreml PRIVATE "-framework Foundation" "-framework CoreML") endif() diff --git a/cmake/onnxruntime_providers_tensorrt.cmake b/cmake/onnxruntime_providers_tensorrt.cmake index 3d46c139feea9..73401c84f8316 100644 --- a/cmake/onnxruntime_providers_tensorrt.cmake +++ b/cmake/onnxruntime_providers_tensorrt.cmake @@ -119,10 +119,11 @@ if (TRT_GREATER_OR_EQUAL_TRT_10_GA) set(ONNX_USE_LITE_PROTO ON) endif() - FetchContent_Declare( + onnxruntime_fetchcontent_declare( onnx_tensorrt URL ${DEP_URL_onnx_tensorrt} URL_HASH SHA1=${DEP_SHA1_onnx_tensorrt} + EXCLUDE_FROM_ALL ) if (NOT CUDA_INCLUDE_DIR) set(CUDA_INCLUDE_DIR ${CUDAToolkit_INCLUDE_DIRS}) # onnx-tensorrt repo needs this variable to build diff --git a/cmake/patches/coremltools/crossplatformbuild.patch b/cmake/patches/coremltools/crossplatformbuild.patch index 7f2268f50c82e..2e6d519b07dc7 100644 --- a/cmake/patches/coremltools/crossplatformbuild.patch +++ b/cmake/patches/coremltools/crossplatformbuild.patch @@ -3,7 +3,7 @@ index adc7bfcf..7b2bf9cc 100644 --- a/mlmodel/src/MILBlob/Blob/FileWriter.cpp +++ b/mlmodel/src/MILBlob/Blob/FileWriter.cpp @@ -8,8 +8,12 @@ - + #include #include + @@ -12,7 +12,7 @@ index adc7bfcf..7b2bf9cc 100644 #include #include +#endif - + using namespace MILBlob; using namespace MILBlob::Blob; diff --git a/mlmodel/src/MILBlob/Fp16.cpp b/mlmodel/src/MILBlob/Fp16.cpp @@ -20,9 +20,9 @@ index ae1e71a1..77a7161f 100644 --- a/mlmodel/src/MILBlob/Fp16.cpp +++ b/mlmodel/src/MILBlob/Fp16.cpp @@ -5,6 +5,8 @@ - + #include "MILBlob/Fp16.hpp" - + +// ORT_EDIT: Exclude clang specific pragmas from other builds +#if defined(__clang__) // fp16 lib code has some conversion warnings we don't want to globally ignore @@ -35,9 +35,9 @@ index ae1e71a1..77a7161f 100644 +#else +#include "fp16/fp16.h" +#endif - + using namespace MILBlob; - + diff --git a/modelpackage/src/ModelPackage.cpp b/modelpackage/src/ModelPackage.cpp index 8fee56b9..99e0d8d6 100644 --- a/modelpackage/src/ModelPackage.cpp @@ -55,22 +55,22 @@ index 8fee56b9..99e0d8d6 100644 #include +#endif #include - + #if defined(__cplusplus) @@ -187,7 +194,10 @@ public: ModelPackageItemInfo createFile(const std::string& name, const std::string& author, const std::string& description); }; - + +// ORT_EDIT: pragma only available on APPLE platforms +#if defined(__APPLE__) #pragma mark ModelPackageImpl +#endif - + ModelPackageImpl::ModelPackageImpl(const std::filesystem::path& path, bool createIfNecessary, bool readOnly) : m_packagePath(path), @@ -372,6 +382,20 @@ std::filesystem::path ModelPackageImpl::getItemPath(const std::string& name, con } - + std::string ModelPackageImpl::generateIdentifier() const { +// ORT_EDIT: Use built-in UUID generation on Windows +#if defined(_WIN32) @@ -87,20 +87,20 @@ index 8fee56b9..99e0d8d6 100644 + return uuidStrCpp; +#else uuid_t uuid; - + // uuid_unparse generates a 36-character null-terminated string (37 bytes). @@ -383,6 +407,7 @@ std::string ModelPackageImpl::generateIdentifier() const { uuid_unparse(uuid, buf); - + return std::string(buf); +#endif } - + ModelPackageItemInfo ModelPackageImpl::createFile(const std::string& name, const std::string& author, const std::string& description) { @@ -468,7 +493,13 @@ std::shared_ptr ModelPackageImpl::findItem(const std::stri auto author = itemInfoEntry->getString(kModelPackageItemInfoAuthorKey); auto description = itemInfoEntry->getString(kModelPackageItemInfoDescriptionKey); - + +// ORT_EDIT: need to use path.string() on Windows +#if defined(_WIN32) + return std::make_shared(std::make_shared(identifier, path.string(), name, author, description)); @@ -109,11 +109,11 @@ index 8fee56b9..99e0d8d6 100644 return std::make_shared(std::make_shared(identifier, path, name, author, description)); +#endif } - + std::shared_ptr ModelPackageImpl::findItem(const std::string& name, const std::string& author) const @@ -514,7 +545,9 @@ void ModelPackageImpl::removeItem(const std::string& identifier) } - + auto path = m_packageDataDirPath / itemInfoEntry->getString(kModelPackageItemInfoPathKey); - if (0 != std::remove(path.c_str())) { + // ORT_EDIT: std::remove doesn't work on Windows. Use std::filesystem::remove instead. @@ -121,7 +121,7 @@ index 8fee56b9..99e0d8d6 100644 + if (!std::filesystem::remove(path)) { throw std::runtime_error("Failed to remove file at path: " + path.string()); } - + @@ -525,13 +558,16 @@ bool ModelPackageImpl::isValid(const std::filesystem::path& path) { try { @@ -132,16 +132,16 @@ index 8fee56b9..99e0d8d6 100644 } return true; } - + +// ORT_EDIT: pragma only available on APPLE platforms +#if defined(__APPLE__) #pragma mark ModelPackage +#endif - + ModelPackage::ModelPackage(const std::string& packagePath, bool createIfNecessary, bool readOnly) : m_modelPackageImpl(std::make_shared(packagePath, createIfNecessary, readOnly)) @@ -544,7 +580,12 @@ ModelPackage::~ModelPackage() - + std::string ModelPackage::path() const { +// ORT_EDIT: Windows doesn't automatically convert to std::string as the native format could be char or wchar. @@ -151,5 +151,17 @@ index 8fee56b9..99e0d8d6 100644 return m_modelPackageImpl->path(); +#endif } - + std::string ModelPackage::setRootModel(const std::string& path, const std::string& name, const std::string& author, const std::string& description) +diff --git a/modelpackage/src/utils/JsonMap.hpp b/modelpackage/src/utils/JsonMap.hpp +index 0d7dc3f4..962d25b6 100644 +--- a/modelpackage/src/utils/JsonMap.hpp ++++ b/modelpackage/src/utils/JsonMap.hpp +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + class JsonMapImpl; + diff --git a/js/react_native/e2e/ios/Podfile b/js/react_native/e2e/ios/Podfile index d31a6f50221fb..cb7871beca37f 100644 --- a/js/react_native/e2e/ios/Podfile +++ b/js/react_native/e2e/ios/Podfile @@ -1,7 +1,7 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '13.0' +platform :ios, '15.0' target 'OnnxruntimeModuleExample' do config = use_native_modules! diff --git a/js/react_native/ios/Podfile b/js/react_native/ios/Podfile index 53c83948672a3..0093d93c17d56 100644 --- a/js/react_native/ios/Podfile +++ b/js/react_native/ios/Podfile @@ -1,7 +1,7 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '13.0' +platform :ios, '15.0' def shared config = use_native_modules! diff --git a/onnxruntime/test/platform/apple/apple_package_test/Podfile.template b/onnxruntime/test/platform/apple/apple_package_test/Podfile.template index dd99e5104853f..71cdc6471cb5c 100644 --- a/onnxruntime/test/platform/apple/apple_package_test/Podfile.template +++ b/onnxruntime/test/platform/apple/apple_package_test/Podfile.template @@ -2,7 +2,7 @@ target 'ios_package_test' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! - platform :ios, '13.0' + platform :ios, '15.0' target 'ios_package_testUITests' do inherit! :search_paths @@ -15,7 +15,7 @@ if ENV['SKIP_MACOS_TEST'] != 'true' # Comment the next line if you don't want to use dynamic frameworks use_frameworks! - platform :osx, '11.0' + platform :osx, '12.0' target 'macos_package_testUITests' do inherit! :search_paths diff --git a/onnxruntime/test/platform/apple/apple_package_test/apple_package_test.xcodeproj/project.pbxproj b/onnxruntime/test/platform/apple/apple_package_test/apple_package_test.xcodeproj/project.pbxproj index eb7345be3770b..afb829ee12296 100644 --- a/onnxruntime/test/platform/apple/apple_package_test/apple_package_test.xcodeproj/project.pbxproj +++ b/onnxruntime/test/platform/apple/apple_package_test/apple_package_test.xcodeproj/project.pbxproj @@ -455,8 +455,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MACOSX_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MACOSX_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -509,8 +509,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MACOSX_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MACOSX_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -631,7 +631,7 @@ "@executable_path/../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 12.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.macos-package-test"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -663,7 +663,7 @@ "@executable_path/../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 12.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.macos-package-test"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -684,7 +684,7 @@ GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 12.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.macos-package-testUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -706,7 +706,7 @@ GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 12.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "ai.onnxruntime.tests.macos-package-testUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/tools/ci_build/github/apple/default_full_apple_framework_build_settings.json b/tools/ci_build/github/apple/default_full_apple_framework_build_settings.json index 84d7e355ed5b4..310b9a34bf6cc 100644 --- a/tools/ci_build/github/apple/default_full_apple_framework_build_settings.json +++ b/tools/ci_build/github/apple/default_full_apple_framework_build_settings.json @@ -28,11 +28,11 @@ ], "iphoneos": [ "--ios", - "--apple_deploy_target=13.0" + "--apple_deploy_target=15.0" ], "iphonesimulator": [ "--ios", - "--apple_deploy_target=13.0" + "--apple_deploy_target=15.0" ] } } diff --git a/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json b/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json index e2d8f70c02cf3..d65a3f4427566 100644 --- a/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json +++ b/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json @@ -24,13 +24,13 @@ "--ios", "--use_xcode", "--use_xnnpack", - "--apple_deploy_target=13.0" + "--apple_deploy_target=15.0" ], "iphonesimulator": [ "--ios", "--use_xcode", "--use_xnnpack", - "--apple_deploy_target=13.0" + "--apple_deploy_target=15.0" ], "macabi":[ "--macos=Catalyst", diff --git a/tools/ci_build/github/apple/default_training_ios_framework_build_settings.json b/tools/ci_build/github/apple/default_training_ios_framework_build_settings.json index 1d4a8c038c07b..c1d4d0e805d90 100644 --- a/tools/ci_build/github/apple/default_training_ios_framework_build_settings.json +++ b/tools/ci_build/github/apple/default_training_ios_framework_build_settings.json @@ -25,11 +25,11 @@ ], "iphoneos": [ "--ios", - "--apple_deploy_target=13.0" + "--apple_deploy_target=15.0" ], "iphonesimulator": [ "--ios", - "--apple_deploy_target=13.0" + "--apple_deploy_target=15.0" ], "macosx": [ "--macos=MacOSX", diff --git a/tools/ci_build/github/apple/test_ios_framework_build_settings.json b/tools/ci_build/github/apple/test_ios_framework_build_settings.json index 0572df6ecf72e..2ec7a73f1db93 100644 --- a/tools/ci_build/github/apple/test_ios_framework_build_settings.json +++ b/tools/ci_build/github/apple/test_ios_framework_build_settings.json @@ -20,11 +20,11 @@ ], "iphoneos": [ "--ios", - "--apple_deploy_target=13.0" + "--apple_deploy_target=15.0" ], "iphonesimulator": [ "--ios", - "--apple_deploy_target=13.0" + "--apple_deploy_target=15.0" ] } } diff --git a/tools/ci_build/github/apple/test_minimal_training_ios_simulator_framework_build_settings.json b/tools/ci_build/github/apple/test_minimal_training_ios_simulator_framework_build_settings.json index 8f283173f1c6a..d3dac1c530e1a 100644 --- a/tools/ci_build/github/apple/test_minimal_training_ios_simulator_framework_build_settings.json +++ b/tools/ci_build/github/apple/test_minimal_training_ios_simulator_framework_build_settings.json @@ -16,7 +16,7 @@ ], "iphonesimulator": [ "--ios", - "--apple_deploy_target=13.0" + "--apple_deploy_target=15.0" ] } } diff --git a/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml index f0a35d809c700..7935467af07ed 100644 --- a/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml @@ -34,7 +34,7 @@ jobs: pool: vmImage: 'macOS-latest' variables: - MACOSX_DEPLOYMENT_TARGET: '11.0' + MACOSX_DEPLOYMENT_TARGET: '12.0' TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] CCACHE_DIR: '$(Pipeline.Workspace)/ccache' timeoutInMinutes: 120 diff --git a/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packing-jobs.yml b/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packing-jobs.yml index 01ec3b5a2f8ca..cb6bbd25496ab 100644 --- a/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packing-jobs.yml +++ b/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packing-jobs.yml @@ -31,7 +31,7 @@ jobs: workspace: clean: all variables: - MACOSX_DEPLOYMENT_TARGET: '11.0' + MACOSX_DEPLOYMENT_TARGET: '12.0' ALLOW_RELEASED_ONNX_OPSET_ONLY: ${{ parameters.AllowReleasedOpsetOnly }} TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] PROTO_CACHE_DIR: $(Pipeline.Workspace)/ccache_proto diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index 447e35244eb66..0af241d1f24f0 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -395,7 +395,7 @@ stages: pool: vmImage: 'macOS-latest' variables: - MACOSX_DEPLOYMENT_TARGET: '11.0' + MACOSX_DEPLOYMENT_TARGET: '12.0' strategy: matrix: Python38: diff --git a/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json b/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json index a1266a80d1cd9..acb30aa688b02 100644 --- a/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json +++ b/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json @@ -14,7 +14,7 @@ ], "iphonesimulator": [ "--ios", - "--apple_deploy_target=13.0" + "--apple_deploy_target=15.0" ] } } diff --git a/tools/ci_build/github/linux/docker/scripts/manylinux/install_centos.sh b/tools/ci_build/github/linux/docker/scripts/manylinux/install_centos.sh index dfda5ec73fdbe..23693a037c7ed 100755 --- a/tools/ci_build/github/linux/docker/scripts/manylinux/install_centos.sh +++ b/tools/ci_build/github/linux/docker/scripts/manylinux/install_centos.sh @@ -6,7 +6,7 @@ os_major_version=$(tr -dc '0-9.' < /etc/redhat-release |cut -d \. -f1) echo "installing for os major version : $os_major_version" if [ "$os_major_version" -gt 7 ]; then PACKAGE_MANAGER="dnf" - $PACKAGE_MANAGER install -y which redhat-lsb-core expat-devel tar unzip zlib-devel make bzip2 bzip2-devel perl-IPC-Cmd openssl-devel wget + $PACKAGE_MANAGER install -y which redhat-lsb-core expat-devel tar unzip zlib-devel make bzip2 bzip2-devel perl-IPC-Cmd openssl-devel wget libuuid-devel fi if [ ! -f /etc/yum.repos.d/microsoft-prod.repo ]; then rpm -Uvh https://packages.microsoft.com/config/centos/$os_major_version/packages-microsoft-prod.rpm