From 93bde28dbaf1428a4f2d9e1f84922d0ef475bac7 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 18 Jan 2025 22:11:41 +0000 Subject: [PATCH 01/43] Enable VCPKG in CI build --- .github/workflows/sca.yml | 6 - .github/workflows/windows.yml | 2 +- cmake/CMakeLists.txt | 14 +- cmake/external/abseil-cpp.cmake | 3 +- cmake/external/composable_kernel.cmake | 3 +- cmake/external/cudnn_frontend.cmake | 13 +- cmake/external/cutlass.cmake | 3 +- cmake/external/dml.cmake | 3 +- cmake/external/eigen.cmake | 13 +- cmake/external/extensions.cmake | 3 +- cmake/external/helper_functions.cmake | 252 +------ .../external/onnxruntime_external_deps.cmake | 118 +-- cmake/external/pybind11.cmake | 7 +- cmake/external/wil.cmake | 3 +- cmake/external/xnnpack.cmake | 10 +- cmake/onnxruntime_framework.cmake | 2 +- cmake/onnxruntime_providers_coreml.cmake | 4 +- cmake/onnxruntime_providers_tensorrt.cmake | 3 +- cmake/onnxruntime_unittests.cmake | 9 +- cmake/vcpkg-configuration.json | 5 +- cmake/vcpkg-ports/cpuinfo/portfile.cmake | 63 ++ cmake/vcpkg-ports/cpuinfo/vcpkg.json | 25 + cmake/vcpkg-ports/onnx/fix-cmakelists.patch | 67 ++ .../onnx/fix-dependency-protobuf.patch | 28 + cmake/vcpkg-ports/onnx/portfile.cmake | 83 +++ cmake/vcpkg-ports/onnx/vcpkg.json | 23 + .../pthreadpool/fix-cmakelists.patch | 82 ++ cmake/vcpkg-ports/pthreadpool/portfile.cmake | 25 + cmake/vcpkg-ports/pthreadpool/vcpkg.json | 17 + .../xnnpack/disable_gcc_warning.patch | 12 + cmake/vcpkg-ports/xnnpack/fix-build.patch | 71 ++ cmake/vcpkg-ports/xnnpack/portfile.cmake | 39 + cmake/vcpkg-ports/xnnpack/vcpkg.json | 17 + cmake/vcpkg-triplets/asan/arm64-linux.cmake | 7 +- cmake/vcpkg-triplets/asan/arm64-osx.cmake | 7 +- .../asan/arm64-windows-static-md.cmake | 2 +- .../asan/arm64-windows-static.cmake | 2 +- .../asan/arm64ec-windows-static-md.cmake | 2 +- .../asan/arm64ec-windows-static.cmake | 2 +- .../vcpkg-triplets/asan/universal2-osx.cmake | 7 +- cmake/vcpkg-triplets/asan/x64-linux.cmake | 7 +- cmake/vcpkg-triplets/asan/x64-osx.cmake | 7 +- .../asan/x64-windows-static-md.cmake | 2 +- .../asan/x64-windows-static.cmake | 2 +- .../asan/x86-windows-static-md.cmake | 2 +- .../asan/x86-windows-static.cmake | 2 +- .../asan_nortti/arm64-linux.cmake | 7 +- .../asan_nortti/arm64-osx.cmake | 7 +- .../asan_nortti/arm64-windows-static-md.cmake | 2 +- .../asan_nortti/arm64-windows-static.cmake | 2 +- .../arm64ec-windows-static-md.cmake | 2 +- .../asan_nortti/arm64ec-windows-static.cmake | 2 +- .../asan_nortti/universal2-osx.cmake | 7 +- .../asan_nortti/x64-linux.cmake | 7 +- .../vcpkg-triplets/asan_nortti/x64-osx.cmake | 7 +- .../asan_nortti/x64-windows-static-md.cmake | 2 +- .../asan_nortti/x64-windows-static.cmake | 2 +- .../asan_nortti/x86-windows-static-md.cmake | 2 +- .../asan_nortti/x86-windows-static.cmake | 2 +- .../vcpkg-triplets/binskim/arm64-linux.cmake | 3 +- cmake/vcpkg-triplets/binskim/arm64-osx.cmake | 3 +- .../binskim/arm64-windows-static-md.cmake | 2 +- .../binskim/arm64-windows-static.cmake | 2 +- .../binskim/arm64ec-windows-static-md.cmake | 2 +- .../binskim/arm64ec-windows-static.cmake | 2 +- .../binskim/universal2-osx.cmake | 3 +- cmake/vcpkg-triplets/binskim/x64-linux.cmake | 5 +- cmake/vcpkg-triplets/binskim/x64-osx.cmake | 5 +- .../binskim/x64-windows-static-md.cmake | 2 +- .../binskim/x64-windows-static.cmake | 2 +- .../binskim/x86-windows-static-md.cmake | 2 +- .../binskim/x86-windows-static.cmake | 2 +- .../binskim_nortti/arm64-linux.cmake | 5 +- .../binskim_nortti/arm64-osx.cmake | 5 +- .../arm64-windows-static-md.cmake | 2 +- .../binskim_nortti/arm64-windows-static.cmake | 2 +- .../arm64ec-windows-static-md.cmake | 2 +- .../arm64ec-windows-static.cmake | 2 +- .../binskim_nortti/universal2-osx.cmake | 5 +- .../binskim_nortti/x64-linux.cmake | 5 +- .../binskim_nortti/x64-osx.cmake | 5 +- .../x64-windows-static-md.cmake | 2 +- .../binskim_nortti/x64-windows-static.cmake | 2 +- .../x86-windows-static-md.cmake | 2 +- .../binskim_nortti/x86-windows-static.cmake | 2 +- .../vcpkg-triplets/default/arm64-linux.cmake | 3 +- cmake/vcpkg-triplets/default/arm64-osx.cmake | 3 +- .../default/arm64-windows-static-md.cmake | 2 +- .../default/arm64-windows-static.cmake | 2 +- .../default/arm64ec-windows-static-md.cmake | 2 +- .../default/arm64ec-windows-static.cmake | 2 +- .../default/universal2-osx.cmake | 3 +- cmake/vcpkg-triplets/default/x64-linux.cmake | 3 +- cmake/vcpkg-triplets/default/x64-osx.cmake | 3 +- .../default/x64-windows-static-md.cmake | 2 +- .../default/x64-windows-static.cmake | 2 +- .../default/x86-windows-static-md.cmake | 2 +- .../default/x86-windows-static.cmake | 2 +- cmake/vcpkg-triplets/gen.py | 33 +- cmake/vcpkg-triplets/nortti/arm64-linux.cmake | 1 + cmake/vcpkg-triplets/nortti/arm64-osx.cmake | 1 + .../nortti/arm64-windows-static-md.cmake | 2 +- .../nortti/arm64-windows-static.cmake | 2 +- .../nortti/arm64ec-windows-static-md.cmake | 2 +- .../nortti/arm64ec-windows-static.cmake | 2 +- .../nortti/universal2-osx.cmake | 1 + cmake/vcpkg-triplets/nortti/x64-linux.cmake | 1 + cmake/vcpkg-triplets/nortti/x64-osx.cmake | 1 + .../nortti/x64-windows-static-md.cmake | 2 +- .../nortti/x64-windows-static.cmake | 2 +- .../nortti/x86-windows-static-md.cmake | 2 +- .../nortti/x86-windows-static.cmake | 2 +- cmake/vcpkg.json | 22 +- include/onnxruntime/core/graph/node_arg.h | 2 +- .../onnxruntime}/core/graph/onnx_protobuf.h | 0 onnxruntime/core/graph/function_template.h | 2 +- .../builders/impl/LRN_op_builder.cc | 2 +- .../builders/impl/batchnorm_op_builder.cc | 2 +- .../builders/impl/binary_op_builder.cc | 2 +- .../builders/impl/cast_op_builder.cc | 2 +- .../builders/impl/clip_op_builder.cc | 2 +- .../builders/impl/concat_op_builder.cc | 2 +- .../builders/impl/conv_op_builder.cc | 2 +- .../builders/impl/depthtospace_op_builder.cc | 2 +- .../impl/dequantizelinear_op_builder.cc | 2 +- .../builders/impl/elu_op_builder.cc | 2 +- .../builders/impl/flatten_op_builder.cc | 2 +- .../builders/impl/gather_op_builder.cc | 2 +- .../builders/impl/gemm_op_builder.cc | 2 +- .../builders/impl/identity_op_builder.cc | 2 +- .../builders/impl/leakyrelu_op_builder.cc | 2 +- .../builders/impl/minmax_op_builder.cc | 2 +- .../builders/impl/pad_op_builder.cc | 2 +- .../builders/impl/pool_op_builder.cc | 2 +- .../impl/quantizelinear_op_builder.cc | 2 +- .../builders/impl/reduction_op_builder.cc | 2 +- .../builders/impl/relu_op_builder.cc | 2 +- .../builders/impl/reshape_op_builder.cc | 2 +- .../builders/impl/resize_op_builder.cc | 2 +- .../builders/impl/slice_op_builder.cc | 2 +- .../builders/impl/softmax_op_builder.cc | 2 +- .../builders/impl/split_op_builder.cc | 2 +- .../builders/impl/squeeze_op_builder.cc | 2 +- .../builders/impl/transpose_op_builder.cc | 2 +- .../builders/impl/unary_op_builder.cc | 2 +- .../builders/impl/unsqueeze_op_builder.cc | 2 +- .../nnapi_builtin/builders/model_builder.h | 2 +- .../core/providers/rknpu/node_attr_helper.h | 2 +- .../core/providers/rknpu/onnx_converter.h | 2 +- .../test/fuzzing/include/OnnxPrediction.h | 2 +- .../ort_libfuzzer/OrtProtoLibfuzzer.cpp | 2 +- .../providers/coreml/coreml_basic_test.cc | 2 +- .../test/providers/qnn/argmaxmin_op_test.cc | 2 +- .../test/providers/qnn/average_pool_test.cc | 2 +- onnxruntime/test/providers/qnn/cast_test.cc | 2 +- .../test/providers/qnn/clip_op_test.cc | 2 +- .../test/providers/qnn/flatten_op_test.cc | 2 +- .../providers/qnn/gather_elems_op_test.cc | 2 +- .../test/providers/qnn/gemm_op_test.cc | 2 +- .../providers/qnn/logical_comp_ops_test.cc | 2 +- onnxruntime/test/providers/qnn/lrn_op_test.cc | 2 +- .../test/providers/qnn/matmul_test.cpp | 2 +- .../test/providers/qnn/max_min_op_test.cc | 2 +- .../test/providers/qnn/pad_op_test.cpp | 2 +- .../test/providers/qnn/pool_op_test.cpp | 2 +- .../providers/qnn/reshape_expand_op_test.cc | 2 +- onnxruntime/test/providers/qnn/resize_test.cc | 2 +- .../test/providers/qnn/split_op_test.cc | 2 +- .../qnn/squeeze_unsqueeze_op_test.cc | 2 +- .../test/providers/qnn/tile_op_test.cc | 2 +- .../test/providers/qnn/topk_op_test.cc | 2 +- tools/ci_build/build.py | 33 +- .../azure-pipelines/bigmodels-ci-pipeline.yml | 6 +- .../azure-pipelines/linux-ci-pipeline.yml | 15 +- .../linux-dnnl-ci-pipeline.yml | 4 +- .../nuget/templates/dml-vs-2022.yml | 16 +- .../azure-pipelines/post-merge-jobs.yml | 12 +- .../stages/py-cpu-packaging-stage.yml | 18 +- .../stages/py-win-gpu-stage.yml | 7 +- .../azure-pipelines/templates/c-api-cpu.yml | 2 +- .../templates/jobs/win-ci-prebuild-steps.yml | 42 +- ...device-training-cpu-packaging-pipeline.yml | 2 +- .../templates/py-win-arm64ec-qnn.yml | 17 +- .../templates/py-win-x64-qnn.yml | 24 +- .../set-python-manylinux-variables-step.yml | 15 +- .../azure-pipelines/templates/win-ci.yml | 16 +- tools/ci_build/github/linux/build_cuda_ci.sh | 2 +- .../github/linux/build_tensorrt_ci.sh | 2 +- .../docker/scripts/install_python_deps.sh | 8 - .../ci_build/github/linux/run_dockerbuild.sh | 4 +- tools/ci_build/github/windows/helpers.ps1 | 705 ------------------ .../windows/install_third_party_deps.ps1 | 105 --- .../requirements/pybind/requirements.txt | 1 + 193 files changed, 996 insertions(+), 1487 deletions(-) create mode 100644 cmake/vcpkg-ports/cpuinfo/portfile.cmake create mode 100644 cmake/vcpkg-ports/cpuinfo/vcpkg.json create mode 100644 cmake/vcpkg-ports/onnx/fix-cmakelists.patch create mode 100644 cmake/vcpkg-ports/onnx/fix-dependency-protobuf.patch create mode 100644 cmake/vcpkg-ports/onnx/portfile.cmake create mode 100644 cmake/vcpkg-ports/onnx/vcpkg.json create mode 100644 cmake/vcpkg-ports/pthreadpool/fix-cmakelists.patch create mode 100644 cmake/vcpkg-ports/pthreadpool/portfile.cmake create mode 100644 cmake/vcpkg-ports/pthreadpool/vcpkg.json create mode 100644 cmake/vcpkg-ports/xnnpack/disable_gcc_warning.patch create mode 100644 cmake/vcpkg-ports/xnnpack/fix-build.patch create mode 100644 cmake/vcpkg-ports/xnnpack/portfile.cmake create mode 100644 cmake/vcpkg-ports/xnnpack/vcpkg.json rename {onnxruntime => include/onnxruntime}/core/graph/onnx_protobuf.h (100%) delete mode 100644 tools/ci_build/github/windows/helpers.ps1 delete mode 100644 tools/ci_build/github/windows/install_third_party_deps.ps1 diff --git a/.github/workflows/sca.yml b/.github/workflows/sca.yml index 51166293f06ac..5519c9cbaef35 100644 --- a/.github/workflows/sca.yml +++ b/.github/workflows/sca.yml @@ -36,10 +36,6 @@ jobs: run: azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v11.8" cuda_sdk - - name: Install ONNX - run: | - &tools\ci_build\github\windows\install_third_party_deps.ps1 -cpu_arch x64 -install_prefix D:\b\Debug\installed -build_config Debug - # The build machine doesn't have a GPU. So the value of CMAKE_CUDA_ARCHITECTURES doesn't matter. - name: Build code env: @@ -117,7 +113,6 @@ jobs: - name: Delete build folder run: | if (Test-Path D:\b) { Remove-Item -Recurse -Force D:\b } - &tools\ci_build\github\windows\install_third_party_deps.ps1 -cpu_arch x64 -install_prefix D:\b\Debug\installed -build_config Debug # The build machine doesn't have a GPU. So the value of CMAKE_CUDA_ARCHITECTURES doesn't matter. - name: Build code @@ -157,7 +152,6 @@ jobs: - name: Delete build folder run: | if (Test-Path D:\b) { Remove-Item -Recurse -Force D:\b } - &tools\ci_build\github\windows\install_third_party_deps.ps1 -cpu_arch x86 -install_prefix D:\b\Debug\installed -build_config Debug # The build machine doesn't have a GPU. So the value of CMAKE_CUDA_ARCHITECTURES doesn't matter. - name: Build code diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 35bacb2b6bac6..5adfad63093bc 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -37,7 +37,7 @@ jobs: - name: Delete build folder run: | if (Test-Path D:\b) { Remove-Item -Recurse -Force D:\b } - &tools\ci_build\github\windows\install_third_party_deps.ps1 -cpu_arch x64 -install_prefix D:\b\Debug\installed -build_config Debug + # The build machine doesn't have a GPU. So the value of CMAKE_CUDA_ARCHITECTURES doesn't matter. - name: Build code diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 304236743fd42..389502c7c5b62 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -958,7 +958,7 @@ if (onnxruntime_USE_QNN) if (MSVC OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") file(GLOB QNN_LIB_FILES LIST_DIRECTORIES false "${onnxruntime_QNN_HOME}/lib/${QNN_ARCH_ABI}/libQnn*.so" - "${onnxruntime_QNN_HOME}/lib/${QNN_ARCH_ABI}/Qnn*.dll" + "${onnxruntime_QNN_HOME}/lib/${QNN_ARCH_ABI}/Qnn*.dll" "${onnxruntime_QNN_HOME}/lib/${QNN_ARCH_ABI}/libHtpPrepare.so" "${onnxruntime_QNN_HOME}/lib/${QNN_ARCH_ABI}/HtpPrepare.dll") if (${QNN_ARCH_ABI} STREQUAL "aarch64-windows-msvc" OR ${QNN_ARCH_ABI} STREQUAL "arm64x-windows-msvc") @@ -1122,7 +1122,10 @@ function(onnxruntime_set_compile_flags target_name) foreach(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORY ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) target_compile_options(${target_name} PRIVATE "$<$:/external:I${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORY}>") endforeach() - + if(VCPKG_INSTALLED_DIR) + cmake_path(NATIVE_PATH VCPKG_INSTALLED_DIR NORMALIZE VCPKG_INSTALLED_DIR_native) + target_compile_options(${target_name} PRIVATE "$<$:SHELL:/external:I ${VCPKG_INSTALLED_DIR}>") + endif() foreach(onnxruntime_external_lib IN LISTS onnxruntime_EXTERNAL_LIBRARIES) #TODO: the list contains cmake keywords like "debug". We should exclude them. if(TARGET ${onnxruntime_external_lib}) @@ -1152,7 +1155,9 @@ function(onnxruntime_set_compile_flags target_name) # We do not treat warnings from 3rd-party libraries as errors. In order to do that, we need to add their header files locations to /external:I. target_compile_options(${target_name} PRIVATE "$<$:/experimental:external>" "$<$:SHELL:--compiler-options /experimental:external>") target_compile_options(${target_name} PRIVATE "$<$:/external:W0>" "$<$:SHELL:--compiler-options /external:W0>") - target_compile_options(${target_name} PRIVATE "$<$:/external:templates->" "$<$:SHELL:--compiler-options /external:templates->") + #if(NOT onnxruntime_USE_VCPKG) + # target_compile_options(${target_name} PRIVATE "$<$:/external:templates->" "$<$:SHELL:--compiler-options /external:templates->") + #endif() target_compile_options(${target_name} PRIVATE "$<$:/external:I${CMAKE_CURRENT_SOURCE_DIR}>" "$<$:SHELL:--compiler-options /external:I${CMAKE_CURRENT_SOURCE_DIR}>") target_compile_options(${target_name} PRIVATE "$<$:/external:I${CMAKE_CURRENT_BINARY_DIR}>" "$<$:SHELL:--compiler-options /external:I${CMAKE_CURRENT_BINARY_DIR}>") if (onnxruntime_ENABLE_STATIC_ANALYSIS) @@ -1713,6 +1718,9 @@ endif() if (WIN32) + if (onnxruntime_USE_MIMALLOC) + list(APPEND onnxruntime_EXTERNAL_LIBRARIES mimalloc-static) + endif() list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${SYS_PATH_LIB}) list(APPEND onnxruntime_EXTERNAL_LIBRARIES debug Dbghelp) # In a onecore build the umbrella libs already contains references to the APIs in advapi32, so in onecore build we do not need to link to advapi32 diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake index 7b6e2141eeb1b..1bb59adce8ecc 100644 --- a/cmake/external/abseil-cpp.cmake +++ b/cmake/external/abseil-cpp.cmake @@ -22,12 +22,13 @@ 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} FIND_PACKAGE_ARGS 20240722 NAMES absl + EXCLUDE_FROM_ALL ) onnxruntime_fetchcontent_makeavailable(abseil_cpp) diff --git a/cmake/external/composable_kernel.cmake b/cmake/external/composable_kernel.cmake index b388a01209f4e..826bb7c468a02 100644 --- a/cmake/external/composable_kernel.cmake +++ b/cmake/external/composable_kernel.cmake @@ -2,11 +2,12 @@ set(PATCH_CLANG ${PROJECT_SOURCE_DIR}/patches/composable_kernel/Fix_Clang_Build. set(PATCH_GFX12X ${PROJECT_SOURCE_DIR}/patches/composable_kernel/Add_gfx12x_support.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_CLANG} && ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PATCH_GFX12X} + EXCLUDE_FROM_ALL ) FetchContent_GetProperties(composable_kernel) diff --git a/cmake/external/cudnn_frontend.cmake b/cmake/external/cudnn_frontend.cmake index 7ac51deaf93bc..8642607fa0ca0 100644 --- a/cmake/external/cudnn_frontend.cmake +++ b/cmake/external/cudnn_frontend.cmake @@ -1,12 +1,13 @@ -include(FetchContent) -FetchContent_Declare( + +onnxruntime_fetchcontent_declare( cudnn_frontend URL ${DEP_URL_cudnn_frontend} URL_HASH SHA1=${DEP_SHA1_cudnn_frontend} + EXCLUDE_FROM_ALL ) -set(CUDNN_FRONTEND_BUILD_SAMPLES OFF) -set(CUDNN_FRONTEND_BUILD_UNIT_TESTS OFF) -set(CUDNN_FRONTEND_BUILD_PYTHON_BINDINGS OFF) +set(CUDNN_FRONTEND_BUILD_SAMPLES OFF CACHE BOOL "" FORCE) +set(CUDNN_FRONTEND_BUILD_UNIT_TESTS OFF CACHE BOOL "" FORCE) +set(CUDNN_FRONTEND_BUILD_PYTHON_BINDINGS OFF CACHE BOOL "" FORCE) set(CUDNN_PATH ${onnxruntime_CUDNN_HOME}) -FetchContent_MakeAvailable(cudnn_frontend) +onnxruntime_fetchcontent_makeavailable(cudnn_frontend) diff --git a/cmake/external/cutlass.cmake b/cmake/external/cutlass.cmake index f04f4bec76cd5..65b0d61270b75 100644 --- a/cmake/external/cutlass.cmake +++ b/cmake/external/cutlass.cmake @@ -1,8 +1,9 @@ include(FetchContent) -FetchContent_Declare( +onnxruntime_fetchcontent_declare( cutlass URL ${DEP_URL_cutlass} URL_HASH SHA1=${DEP_SHA1_cutlass} + EXCLUDE_FROM_ALL ) FetchContent_GetProperties(cutlass) diff --git a/cmake/external/dml.cmake b/cmake/external/dml.cmake index 3cfcdd4b04c62..552ebe887a197 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 95dd438702a18..f03872b25b090 100644 --- a/cmake/external/eigen.cmake +++ b/cmake/external/eigen.cmake @@ -1,24 +1,21 @@ -if (onnxruntime_USE_PREINSTALLED_EIGEN) - add_library(eigen INTERFACE) - file(TO_CMAKE_PATH ${eigen_SOURCE_PATH} eigen_INCLUDE_DIRS) - target_include_directories(eigen INTERFACE ${eigen_INCLUDE_DIRS}) -else () if(CMAKE_SYSTEM_NAME MATCHES "AIX") - FetchContent_Declare( + onnxruntime_fetchcontent_declare( eigen URL ${DEP_URL_eigen} URL_HASH SHA1=${DEP_SHA1_eigen} PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/eigen/eigen-aix.patch + EXCLUDE_FROM_ALL ) else() - FetchContent_Declare( + onnxruntime_fetchcontent_declare( eigen URL ${DEP_URL_eigen} URL_HASH SHA1=${DEP_SHA1_eigen} PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/eigen/eigen-edge.patch + EXCLUDE_FROM_ALL ) endif() FetchContent_Populate(eigen) set(eigen_INCLUDE_DIRS "${eigen_SOURCE_DIR}") -endif() + 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 e3f2211f96158..55059b9500a8e 100644 --- a/cmake/external/helper_functions.cmake +++ b/cmake/external/helper_functions.cmake @@ -1,223 +1,47 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -# Recursively set the folder for all targets in the subdirectories of the given source directory. -function(set_folder_for_subdir_targets srcDir folderName) - get_property(subdirs DIRECTORY "${srcDir}" PROPERTY SUBDIRECTORIES) - foreach(subdir ${subdirs}) - get_property(subdir_import_targets DIRECTORY "${subdir}" PROPERTY BUILDSYSTEM_TARGETS) - foreach(subdir_target ${subdir_import_targets}) - set_target_properties(${subdir_target} PROPERTIES FOLDER ${folderName}) - endforeach() - - set_folder_for_subdir_targets(${subdir} ${folderName}) - endforeach() -endfunction() - -# 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}") - 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}) +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}") + 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) - if (subdir_target_osx_arch) - if (NOT ${CMAKE_HOST_SYSTEM_PROCESSOR} IN_LIST subdir_target_osx_arch) - message("Added an executable target ${subdir_target} but it can not run natively on ${CMAKE_HOST_SYSTEM_PROCESSOR}, we will try to modify it") + 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) + if (subdir_target_osx_arch) + if (NOT ${CMAKE_HOST_SYSTEM_PROCESSOR} IN_LIST subdir_target_osx_arch) + message("Added an executable target ${subdir_target} but it can not run natively on ${CMAKE_HOST_SYSTEM_PROCESSOR}, we will try to modify it") + endif() endif() endif() - endif() - set_target_properties(${subdir_target} PROPERTIES FOLDER "External/${__cmake_contentName}") - set_target_properties(${subdir_target} PROPERTIES COMPILE_WARNING_AS_ERROR OFF) + 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) - - # set the FOLDER property for all targets contained in source directory and subfolders - set_folder_for_subdir_targets(${__cmake_srcdir} "External/${__cmake_contentName}") + endforeach() 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) + endforeach() + set(CMAKE_SKIP_INSTALL_RULES ${ONNXRUNTIME_CMAKE_SKIP_INSTALL_RULES_OLD_VALUE}) endmacro() diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index 0aa6b7018777f..43b1c2085981f 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -35,10 +35,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 ) onnxruntime_fetchcontent_makeavailable(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 ) FetchContent_MakeAvailable(googletest) @@ -77,10 +79,11 @@ 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 FIND_PACKAGE_ARGS NAMES benchmark ) onnxruntime_fetchcontent_makeavailable(google_benchmark) @@ -88,20 +91,22 @@ endif() if(onnxruntime_USE_MIMALLOC) - FetchContent_Declare( + onnxruntime_fetchcontent_declare( mimalloc URL ${DEP_URL_mimalloc} URL_HASH SHA1=${DEP_SHA1_mimalloc} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS NAMES mimalloc ) FetchContent_MakeAvailable(mimalloc) endif() #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 ) @@ -122,7 +127,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(STATUS "Use prebuilt protoc") @@ -133,10 +138,10 @@ if(NOT ONNX_CUSTOM_PROTOC_EXECUTABLE) message(STATUS "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() @@ -147,13 +152,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() @@ -191,11 +196,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 NAMES Protobuf protobuf ) @@ -266,18 +272,20 @@ endif() 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 FIND_PACKAGE_ARGS NAMES Boost ) onnxruntime_fetchcontent_makeavailable(mp11) @@ -292,10 +300,11 @@ endif() 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 ) onnxruntime_fetchcontent_makeavailable(nlohmann_json) @@ -354,18 +363,20 @@ if (CPUINFO_SUPPORTED) set(CPUINFO_BUILD_BENCHMARKS OFF CACHE INTERNAL "") if(onnxruntime_target_platform STREQUAL "ARM64EC") message(STATUS "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() @@ -377,42 +388,21 @@ if (CPUINFO_SUPPORTED) endif() endif() -# xnnpack depends on clog -# 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( - pytorch_clog - URL ${DEP_URL_pytorch_cpuinfo} - URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo} - SOURCE_SUBDIR deps/clog - FIND_PACKAGE_ARGS NAMES cpuinfo - ) - set(ONNXRUNTIME_CLOG_PROJ pytorch_clog) - onnxruntime_fetchcontent_makeavailable(${ONNXRUNTIME_CLOG_PROJ}) - set(ONNXRUNTIME_CLOG_TARGET_NAME clog) - # if cpuinfo is from find_package, use it with imported name - if(TARGET cpuinfo::clog) - set(ONNXRUNTIME_CLOG_TARGET_NAME cpuinfo::clog) - elseif(onnxruntime_USE_VCPKG) - # however, later cpuinfo versions may not contain clog. use cpuinfo - set(ONNXRUNTIME_CLOG_TARGET_NAME cpuinfo::cpuinfo) - endif() -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() @@ -423,10 +413,11 @@ onnxruntime_fetchcontent_makeavailable(GSL) find_path(safeint_SOURCE_DIR NAMES "SafeInt.hpp") if(NOT safeint_SOURCE_DIR) unset(safeint_SOURCE_DIR) - 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 @@ -452,11 +443,12 @@ 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 flatbuffers ) @@ -500,11 +492,12 @@ 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 FIND_PACKAGE_ARGS NAMES ONNX onnx ) if (NOT onnxruntime_MINIMAL_BUILD) @@ -529,7 +522,7 @@ else() include(eigen) # FetchContent endif() -if(onnxruntime_USE_VCPKG) +if(onnxruntime_USE_VCPKG AND WIN32) find_package(wil CONFIG REQUIRED) set(WIL_TARGET "WIL::WIL") else() @@ -542,7 +535,22 @@ if (onnxruntime_USE_XNNPACK) message(FATAL_ERROR "XNNPACK EP requires the internal NHWC contrib ops to be available " "but onnxruntime_DISABLE_CONTRIB_OPS is ON") endif() - include(xnnpack) + if(onnxruntime_USE_VCPKG) + FIND_PATH(XNNPACK_HDR xnnpack.h PATH_SUFFIXES include) + IF(NOT XNNPACK_HDR) + MESSAGE(FATAL_ERROR "Cannot find xnnpack") + ENDIF() + ADD_LIBRARY(xnnpack STATIC IMPORTED) + find_library(xnnpack_LIBRARY NAMES XNNPACK) + find_library(microkernels_prod_LIBRARY NAMES microkernels-prod) + find_package(unofficial-pthreadpool CONFIG REQUIRED) + + target_include_directories(xnnpack INTERFACE "${XNNPACK_HDR}") + set(XNNPACK_INCLUDE_DIR ${XNNPACK_DIR}/include) + set(onnxruntime_EXTERNAL_LIBRARIES_XNNPACK ${xnnpack_LIBRARY} ${microkernels_prod_LIBRARY} unofficial::pthreadpool unofficial::pthreadpool_interface) + else() + include(xnnpack) + endif() endif() if (onnxruntime_USE_MIMALLOC) @@ -578,10 +586,11 @@ endif() if(onnxruntime_ENABLE_ATEN) message(STATUS "Aten fallback is enabled.") - FetchContent_Declare( + onnxruntime_fetchcontent_declare( dlpack URL ${DEP_URL_dlpack} URL_HASH SHA1=${DEP_SHA1_dlpack} + EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS NAMES dlpack ) # We can't use onnxruntime_fetchcontent_makeavailable since some part of the the dlpack code is Linux only. @@ -592,10 +601,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 FIND_PACKAGE_ARGS NAMES cxxopts ) set(CXXOPTS_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) @@ -604,11 +614,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) @@ -620,18 +631,21 @@ if (onnxruntime_USE_WEBGPU) # # specified as: # build.py --use_webgpu --cmake_extra_defines "onnxruntime_CUSTOM_DAWN_SRC_PATH=" - FetchContent_Declare( + onnxruntime_fetchcontent_declare( dawn SOURCE_DIR ${onnxruntime_CUSTOM_DAWN_SRC_PATH} + EXCLUDE_FROM_ALL ) else() - FetchContent_Declare( + onnxruntime_fetchcontent_declare( dawn URL ${DEP_URL_dawn} URL_HASH SHA1=${DEP_SHA1_dawn} # All previous patches are merged into the upstream dawn project. We don't need to apply any patches right now. # if we need to apply patches in the future, we can uncomment the following line. + PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/dawn/dawn.patch + EXCLUDE_FROM_ALL ) endif() diff --git a/cmake/external/pybind11.cmake b/cmake/external/pybind11.cmake index 2c9e3cf4540c2..16ed3449e20f6 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} + FIND_PACKAGE_ARGS 2.6 NAMES pybind11 + EXCLUDE_FROM_ALL ) onnxruntime_fetchcontent_makeavailable(pybind11_project) diff --git a/cmake/external/wil.cmake b/cmake/external/wil.cmake index 120e986ebb552..fb20189617ceb 100644 --- a/cmake/external/wil.cmake +++ b/cmake/external/wil.cmake @@ -3,11 +3,12 @@ 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} FIND_PACKAGE_ARGS NAMES wil + EXCLUDE_FROM_ALL ) if(WIN32) diff --git a/cmake/external/xnnpack.cmake b/cmake/external/xnnpack.cmake index 0be2c7082bcc8..02ef9a198a803 100644 --- a/cmake/external/xnnpack.cmake +++ b/cmake/external/xnnpack.cmake @@ -17,11 +17,11 @@ if(CMAKE_ANDROID_ARCH_ABI STREQUAL armeabi-v7a) endif() # 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 FIND_PACKAGE_ARGS NAMES fxdiv) 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 FIND_PACKAGE_ARGS NAMES unofficial-pthreadpool) onnxruntime_fetchcontent_makeavailable(pthreadpool) # --- Determine target processor @@ -75,14 +75,16 @@ if(ORT_TARGET_PROCESSOR MATCHES "^arm64.*" AND NOT CMAKE_C_COMPILER_ID STREQUAL # kleidiAI use CMAKE_SYSTEM_PROCESSOR to determine whether includes aarch64/arm64 ukernels # https://gitlab.arm.com/kleidi/kleidiai/-/blob/main/CMakeLists.txt#L134 set(CMAKE_SYSTEM_PROCESSOR arm64) - FetchContent_Declare(kleidiai URL ${DEP_URL_kleidiai} URL_HASH SHA1=${DEP_SHA1_kleidiai}) + onnxruntime_fetchcontent_declare(kleidiai URL ${DEP_URL_kleidiai} URL_HASH SHA1=${DEP_SHA1_kleidiai} EXCLUDE_FROM_ALL) onnxruntime_fetchcontent_makeavailable(kleidiai) set(KLEIDIAI_SOURCE_DIR ${kleidiai_SOURCE_DIR}) endif() -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 + FIND_PACKAGE_ARGS NAMES xnnpack ) onnxruntime_fetchcontent_makeavailable(googlexnnpack) set(XNNPACK_DIR ${googlexnnpack_SOURCE_DIR}) diff --git a/cmake/onnxruntime_framework.cmake b/cmake/onnxruntime_framework.cmake index 9f8d807fad8f4..969d604c88c50 100644 --- a/cmake/onnxruntime_framework.cmake +++ b/cmake/onnxruntime_framework.cmake @@ -93,7 +93,7 @@ endif() onnxruntime_add_include_to_target(onnxruntime_framework onnxruntime_common onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers safeint_interface Boost::mp11 nlohmann_json::nlohmann_json) if (onnxruntime_USE_MIMALLOC) - target_link_libraries(onnxruntime_framework mimalloc-static) + onnxruntime_add_include_to_target(onnxruntime_framework mimalloc-static) endif() if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") diff --git a/cmake/onnxruntime_providers_coreml.cmake b/cmake/onnxruntime_providers_coreml.cmake index ec7bc7a98969e..de74396e9da9b 100644 --- a/cmake/onnxruntime_providers_coreml.cmake +++ b/cmake/onnxruntime_providers_coreml.cmake @@ -178,10 +178,10 @@ if (_enable_ML_PROGRAM) # Setup coremltools fp16 and json dependencies for creating an mlpackage. # # fp16 depends on psimd - FetchContent_Declare(psimd URL ${DEP_URL_psimd} URL_HASH SHA1=${DEP_SHA1_psimd}) + 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}) + 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) diff --git a/cmake/onnxruntime_providers_tensorrt.cmake b/cmake/onnxruntime_providers_tensorrt.cmake index 7b18222f334f9..8723fa1a929ef 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/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake index 7c1b9ddc1548f..06493e85bab19 100644 --- a/cmake/onnxruntime_unittests.cmake +++ b/cmake/onnxruntime_unittests.cmake @@ -1002,6 +1002,11 @@ add_dependencies(onnx_test_data_proto onnx_proto ${onnxruntime_EXTERNAL_DEPENDEN #onnx_proto target should mark this definition as public, instead of private target_compile_definitions(onnx_test_data_proto PRIVATE "-DONNX_API=") onnxruntime_add_include_to_target(onnx_test_data_proto onnx_proto) +if (MSVC) + # Cutlass code has an issue with the following: + # warning C4100: 'magic': unreferenced formal parameter + target_compile_options(onnx_test_data_proto PRIVATE "/wd4100") +endif() target_include_directories(onnx_test_data_proto PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) set_target_properties(onnx_test_data_proto PROPERTIES FOLDER "ONNXRuntimeTest") if(NOT DEFINED onnx_SOURCE_DIR) @@ -1163,9 +1168,9 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP) SET(MLAS_BENCH_DIR ${TEST_SRC_DIR}/mlas/bench) file(GLOB_RECURSE MLAS_BENCH_SOURCE_FILES "${MLAS_BENCH_DIR}/*.cpp" "${MLAS_BENCH_DIR}/*.h") - onnxruntime_add_executable(onnxruntime_mlas_benchmark ${MLAS_BENCH_SOURCE_FILES}) + onnxruntime_add_executable(onnxruntime_mlas_benchmark ${MLAS_BENCH_SOURCE_FILES} ${ONNXRUNTIME_ROOT}/core/framework/error_code.cc) target_include_directories(onnxruntime_mlas_benchmark PRIVATE ${ONNXRUNTIME_ROOT}/core/mlas/inc) - target_link_libraries(onnxruntime_mlas_benchmark PRIVATE benchmark::benchmark onnxruntime_util onnxruntime_framework ${ONNXRUNTIME_MLAS_LIBS} onnxruntime_common ${CMAKE_DL_LIBS}) + target_link_libraries(onnxruntime_mlas_benchmark PRIVATE benchmark::benchmark onnxruntime_util ${ONNXRUNTIME_MLAS_LIBS} onnxruntime_common ${CMAKE_DL_LIBS}) target_compile_definitions(onnxruntime_mlas_benchmark PRIVATE BENCHMARK_STATIC_DEFINE) if(WIN32) target_link_libraries(onnxruntime_mlas_benchmark PRIVATE debug Dbghelp) diff --git a/cmake/vcpkg-configuration.json b/cmake/vcpkg-configuration.json index 89954eaec9afd..a9f3fb4a93ff0 100644 --- a/cmake/vcpkg-configuration.json +++ b/cmake/vcpkg-configuration.json @@ -2,7 +2,10 @@ "default-registry": { "kind": "git", "repository": "https://github.com/Microsoft/vcpkg", - "baseline": "93570a28ecdf49d3d9676cec8aa0cc72935d43db" + "baseline": "96dbba1e03d1ecc7c7096e97d5a09ff3c58e21df" }, + "overlay-ports": [ + "./vcpkg-ports" + ], "registries": [] } diff --git a/cmake/vcpkg-ports/cpuinfo/portfile.cmake b/cmake/vcpkg-ports/cpuinfo/portfile.cmake new file mode 100644 index 0000000000000..e61308bf643b4 --- /dev/null +++ b/cmake/vcpkg-ports/cpuinfo/portfile.cmake @@ -0,0 +1,63 @@ +# On Windows, we can get a cpuinfo.dll, but it exports no symbols. +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO pytorch/cpuinfo + REF 8a1772a0c5c447df2d18edf33ec4603a8c9c04a6 + SHA512 b94ccbfa886221d6bb16513d074675af0a72928a9dd9485dcacdc1124a8a60aacbbe91913a1579e766dfb024f0be1d52eeead40342004ff0238a8b94a095ed08 + HEAD_REF master +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools CPUINFO_BUILD_TOOLS +) + +set(LINK_OPTIONS "") +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + list(APPEND LINK_OPTIONS -DCPUINFO_LIBRARY_TYPE=shared) +else() + list(APPEND LINK_OPTIONS -DCPUINFO_LIBRARY_TYPE=static) +endif() + +if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") + list(APPEND LINK_OPTIONS -DCPUINFO_RUNTIME_TYPE=shared) +else() + list(APPEND LINK_OPTIONS -DCPUINFO_RUNTIME_TYPE=static) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + ${LINK_OPTIONS} + -DCPUINFO_BUILD_UNIT_TESTS=OFF + -DCPUINFO_BUILD_MOCK_TESTS=OFF + -DCPUINFO_BUILD_BENCHMARKS=OFF + OPTIONS_DEBUG + -DCPUINFO_LOG_LEVEL=debug + OPTIONS_RELEASE + -DCPUINFO_LOG_LEVEL=default +) +vcpkg_cmake_install() +vcpkg_cmake_config_fixup() +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() # pkg_check_modules(libcpuinfo) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +if("tools" IN_LIST FEATURES) + set(additional_tools "") + if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/cpuid-dump${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + list(APPEND additional_tools "cpuid-dump") + endif() + vcpkg_copy_tools( + TOOL_NAMES cache-info cpu-info isa-info ${additional_tools} + AUTO_CLEAN + ) +endif() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/cmake/vcpkg-ports/cpuinfo/vcpkg.json b/cmake/vcpkg-ports/cpuinfo/vcpkg.json new file mode 100644 index 0000000000000..ce93591dba5ac --- /dev/null +++ b/cmake/vcpkg-ports/cpuinfo/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "cpuinfo", + "version-date": "2024-12-09", + "port-version": 3, + "description": "CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)", + "homepage": "https://github.com/pytorch/cpuinfo", + "license": "BSD-2-Clause", + "supports": "!(uwp & arm32)", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "tools": { + "description": "Build cpuinfo command-line tools", + "supports": "!uwp" + } + } +} diff --git a/cmake/vcpkg-ports/onnx/fix-cmakelists.patch b/cmake/vcpkg-ports/onnx/fix-cmakelists.patch new file mode 100644 index 0000000000000..f8d300103ab20 --- /dev/null +++ b/cmake/vcpkg-ports/onnx/fix-cmakelists.patch @@ -0,0 +1,67 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4dd56b6..2ff3e29 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -65,6 +65,27 @@ endif() + + include(GNUInstallDirs) + ++# install protobuf files ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx-data.proto ++ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx-data.proto3 ++ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx-ml.proto ++ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx-ml.proto3 ++ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx-operators-ml.proto ++ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx-operators-ml.proto3 ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnx ++) ++# install python files ++if(BUILD_ONNX_PYTHON) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_data_pb.py ++ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_data_pb2.py ++ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_ml_pb2.py ++ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_operators_ml_pb2.py ++ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_operators_pb.py ++ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_pb.py ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnx ++ ) ++endif() ++ + set(ONNX_ROOT ${PROJECT_SOURCE_DIR}) + + # Read ONNX version +@@ -116,7 +137,8 @@ endif() + # find_package Python has replaced PythonInterp and PythonLibs since cmake 3.12 + # Use the following command in the future; now this is only compatible with the latest pybind11 + # find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) +-find_package(PythonInterp ${PY_VERSION} REQUIRED) ++find_package(Python3 ${PY_VERSION} COMPONENTS Interpreter REQUIRED) ++set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) + if(BUILD_ONNX_PYTHON) + find_package(PythonLibs ${PY_VERSION}) + endif() +@@ -434,6 +456,7 @@ target_link_libraries(onnx PUBLIC onnx_proto) + add_onnx_global_defines(onnx) + + if(BUILD_ONNX_PYTHON) ++ find_package(Python3 ${PY_VERSION} COMPONENTS Development REQUIRED) + if("${PY_EXT_SUFFIX}" STREQUAL "") + if(MSVC) + set(PY_EXT_SUFFIX ".pyd") +@@ -452,10 +475,14 @@ if(BUILD_ONNX_PYTHON) + target_include_directories(onnx_cpp2py_export PRIVATE + $ + $ +- $) ++ ${Python3_INCLUDE_DIRS}) ++ target_link_directories(onnx_cpp2py_export PRIVATE ++ ${Python3_LIBRARY_DIRS}) ++ target_link_libraries(onnx_cpp2py_export PRIVATE ++ ${Python3_LIBRARIES}) + + # pybind11 is a header only lib +- find_package(pybind11 2.2 CONFIG) ++ find_package(pybind11 2.2 CONFIG REQUIRED) + if(NOT pybind11_FOUND) + if(EXISTS "${ONNX_ROOT}/third_party/pybind11/include/pybind11/pybind11.h") + add_subdirectory("${ONNX_ROOT}/third_party/pybind11") diff --git a/cmake/vcpkg-ports/onnx/fix-dependency-protobuf.patch b/cmake/vcpkg-ports/onnx/fix-dependency-protobuf.patch new file mode 100644 index 0000000000000..c435922d0103d --- /dev/null +++ b/cmake/vcpkg-ports/onnx/fix-dependency-protobuf.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d81ac1d..9f97998 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -149,6 +149,7 @@ if(ONNX_BUILD_TESTS) + set(googletest_STATIC_LIBRARIES GTest::gtest) + endif() + ++find_package(protobuf CONFIG REQUIRED) + if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf)) + # Sometimes we need to use protoc compiled for host architecture while linking + # libprotobuf against target architecture. See https://github.com/caffe2/caffe +diff --git a/cmake/ONNXConfig.cmake.in b/cmake/ONNXConfig.cmake.in +index d588f8a..dbd4398 100644 +--- a/cmake/ONNXConfig.cmake.in ++++ b/cmake/ONNXConfig.cmake.in +@@ -6,9 +6,8 @@ + # library version information + set(ONNX_VERSION "@ONNX_VERSION@") + +-list(APPEND CMAKE_PREFIX_PATH "@PROTOBUF_DIR@") +-set(Protobuf_INCLUDE_DIR "@PROTOBUF_INCLUDE_DIR@") +-find_package(Protobuf REQUIRED) ++include(CMakeFindDependencyMacro) ++find_dependency(protobuf CONFIG) + + # import targets + include ("${CMAKE_CURRENT_LIST_DIR}/ONNXTargets.cmake") diff --git a/cmake/vcpkg-ports/onnx/portfile.cmake b/cmake/vcpkg-ports/onnx/portfile.cmake new file mode 100644 index 0000000000000..a0c997803870d --- /dev/null +++ b/cmake/vcpkg-ports/onnx/portfile.cmake @@ -0,0 +1,83 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO onnx/onnx + REF "v${VERSION}" + SHA512 5a18e2b19ec9c18c8b115fb7e12ed98eddaa581c95f15c4dd420cd6c86e7caa04f9a393da589e76b89cf9b3544abd3749a8c77c2446782f37502eb74e9b1f661 + PATCHES + fix-cmakelists.patch + fix-dependency-protobuf.patch +) + +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" USE_STATIC_RUNTIME) + +# ONNX_USE_PROTOBUF_SHARED_LIBS: find the library and check its file extension +find_library(PROTOBUF_LIBPATH NAMES protobuf PATHS "${CURRENT_INSTALLED_DIR}/bin" "${CURRENT_INSTALLED_DIR}/lib" REQUIRED) +get_filename_component(PROTOBUF_LIBNAME "${PROTOBUF_LIBPATH}" NAME) + +set(USE_PROTOBUF_SHARED OFF) + + + +# Like protoc, python is required for codegen. +vcpkg_find_acquire_program(PYTHON3) + +# PATH for .bat scripts so it can find 'python' +get_filename_component(PYTHON_DIR "${PYTHON3}" PATH) +vcpkg_add_to_path(PREPEND "${PYTHON_DIR}") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DPython3_EXECUTABLE=${PYTHON3} + -DONNX_ML=ON + -DONNX_GEN_PB_TYPE_STUBS=ON + -DONNX_USE_PROTOBUF_SHARED_LIBS=${USE_PROTOBUF_SHARED} + -DONNX_USE_LITE_PROTO=OFF + -DONNX_USE_MSVC_STATIC_RUNTIME=${USE_STATIC_RUNTIME} + -DONNX_BUILD_TESTS=OFF + -DONNX_BUILD_BENCHMARKS=OFF + -DONNX_DISABLE_STATIC_REGISTRATION=ON + MAYBE_UNUSED_VARIABLES + ONNX_USE_MSVC_STATIC_RUNTIME +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ONNX) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + # the others are empty + "${CURRENT_PACKAGES_DIR}/include/onnx/backend" + "${CURRENT_PACKAGES_DIR}/include/onnx/bin" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/controlflow" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/generator" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/image" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/logical" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/math" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/nn" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/object_detection" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/optional" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/quantization" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/reduction" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/rnn" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/sequence" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/text" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/traditionalml" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/training" + "${CURRENT_PACKAGES_DIR}/include/onnx/examples" + "${CURRENT_PACKAGES_DIR}/include/onnx/frontend" + "${CURRENT_PACKAGES_DIR}/include/onnx/onnx_cpp2py_export" + "${CURRENT_PACKAGES_DIR}/include/onnx/test" + "${CURRENT_PACKAGES_DIR}/include/onnx/tools" + "${CURRENT_PACKAGES_DIR}/include/onnx/onnx_ml" + "${CURRENT_PACKAGES_DIR}/include/onnx/onnx_data" + "${CURRENT_PACKAGES_DIR}/include/onnx/onnx_operators_ml" + "${CURRENT_PACKAGES_DIR}/include/onnx/reference/ops" + "${CURRENT_PACKAGES_DIR}/include/onnx/reference" +) diff --git a/cmake/vcpkg-ports/onnx/vcpkg.json b/cmake/vcpkg-ports/onnx/vcpkg.json new file mode 100644 index 0000000000000..7d2bbd84c05b3 --- /dev/null +++ b/cmake/vcpkg-ports/onnx/vcpkg.json @@ -0,0 +1,23 @@ +{ + "name": "onnx", + "version-semver": "1.17.0", + "description": "Open standard for machine learning interoperability", + "homepage": "https://onnx.ai", + "license": "Apache-2.0", + "supports": "!uwp", + "dependencies": [ + "protobuf", + { + "name": "protobuf", + "host": true + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/cmake/vcpkg-ports/pthreadpool/fix-cmakelists.patch b/cmake/vcpkg-ports/pthreadpool/fix-cmakelists.patch new file mode 100644 index 0000000000000..97fd1ac7a2bb1 --- /dev/null +++ b/cmake/vcpkg-ports/pthreadpool/fix-cmakelists.patch @@ -0,0 +1,82 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f06aada..3c6c6e2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,8 +31,6 @@ IF(CCACHE_BINARY) + ENDIF() + + # ---[ Options. +-SET(PTHREADPOOL_LIBRARY_TYPE "default" CACHE STRING "Type of library (shared, static, or default) to build") +-SET_PROPERTY(CACHE PTHREADPOOL_LIBRARY_TYPE PROPERTY STRINGS default static shared) + OPTION(PTHREADPOOL_ALLOW_DEPRECATED_API "Enable deprecated API functions" ON) + SET(PTHREADPOOL_SYNC_PRIMITIVE "default" CACHE STRING "Synchronization primitive (condvar, futex, gcd, event, or default) for worker threads") + SET_PROPERTY(CACHE PTHREADPOOL_SYNC_PRIMITIVE PROPERTY STRINGS default condvar futex gcd event) +@@ -41,7 +39,7 @@ IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$") + ELSE() + OPTION(PTHREADPOOL_ENABLE_FASTPATH "Enable fast path using atomic decrement instead of atomic compare-and-swap" OFF) + ENDIF() +-IF("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}") ++IF(FALSE) + OPTION(PTHREADPOOL_BUILD_TESTS "Build pthreadpool unit tests" ON) + OPTION(PTHREADPOOL_BUILD_BENCHMARKS "Build pthreadpool micro-benchmarks" ON) + ELSE() +@@ -67,7 +65,8 @@ MACRO(PTHREADPOOL_TARGET_ENABLE_CXX11 target) + ENDMACRO() + + # ---[ Download deps +-IF(NOT DEFINED FXDIV_SOURCE_DIR) ++find_path(FXDIV_INCLUDE_DIRS "fxdiv.h") ++IF(FALSE) + MESSAGE(STATUS "Downloading FXdiv to ${CMAKE_BINARY_DIR}/FXdiv-source (define FXDIV_SOURCE_DIR to avoid it)") + CONFIGURE_FILE(cmake/DownloadFXdiv.cmake "${CMAKE_BINARY_DIR}/FXdiv-download/CMakeLists.txt") + EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . +@@ -118,21 +117,13 @@ ELSE() + ENDIF() + + ADD_LIBRARY(pthreadpool_interface INTERFACE) +-TARGET_INCLUDE_DIRECTORIES(pthreadpool_interface INTERFACE include) ++TARGET_INCLUDE_DIRECTORIES(pthreadpool_interface INTERFACE $ $) + IF(NOT PTHREADPOOL_ALLOW_DEPRECATED_API) + TARGET_COMPILE_DEFINITIONS(pthreadpool_interface INTERFACE PTHREADPOOL_NO_DEPRECATED_API=1) + ENDIF() + INSTALL(FILES include/pthreadpool.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +-IF(PTHREADPOOL_LIBRARY_TYPE STREQUAL "default") +- ADD_LIBRARY(pthreadpool ${PTHREADPOOL_SRCS}) +-ELSEIF(PTHREADPOOL_LIBRARY_TYPE STREQUAL "shared") +- ADD_LIBRARY(pthreadpool SHARED ${PTHREADPOOL_SRCS}) +-ELSEIF(PTHREADPOOL_LIBRARY_TYPE STREQUAL "static") +- ADD_LIBRARY(pthreadpool STATIC ${PTHREADPOOL_SRCS}) +-ELSE() +- MESSAGE(FATAL_ERROR "Unsupported library type ${PTHREADPOOL_LIBRARY_TYPE}") +-ENDIF() ++ADD_LIBRARY(pthreadpool ${PTHREADPOOL_SRCS}) + + IF(PTHREADPOOL_SYNC_PRIMITIVE STREQUAL "condvar") + TARGET_COMPILE_DEFINITIONS(pthreadpool PRIVATE PTHREADPOOL_USE_FUTEX=0) +@@ -181,18 +172,22 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + ENDIF() + + # ---[ Configure FXdiv +-IF(NOT TARGET fxdiv) ++IF(FALSE) + SET(FXDIV_BUILD_TESTS OFF CACHE BOOL "") + SET(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "") + ADD_SUBDIRECTORY( + "${FXDIV_SOURCE_DIR}" + "${CMAKE_BINARY_DIR}/FXdiv") + ENDIF() +-TARGET_LINK_LIBRARIES(pthreadpool PRIVATE fxdiv) ++TARGET_INCLUDE_DIRECTORIES(pthreadpool PRIVATE ${FXDIV_INCLUDE_DIRS}) + +-INSTALL(TARGETS pthreadpool ++INSTALL(TARGETS pthreadpool pthreadpool_interface ++ EXPORT unofficial-pthreadpool-config ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(EXPORT unofficial-pthreadpool-config NAMESPACE unofficial:: ++ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/unofficial-${PROJECT_NAME}) # share/unofficial-pthreadpool + + IF(PTHREADPOOL_BUILD_TESTS) + # ---[ Build google test diff --git a/cmake/vcpkg-ports/pthreadpool/portfile.cmake b/cmake/vcpkg-ports/pthreadpool/portfile.cmake new file mode 100644 index 0000000000000..9400e5e886639 --- /dev/null +++ b/cmake/vcpkg-ports/pthreadpool/portfile.cmake @@ -0,0 +1,25 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO google/pthreadpool + REF 4e80ca24521aa0fb3a746f9ea9c3eaa20e9afbb0 + SHA512 776017cc5d2aa94337292f2f4fbd54d099ef29abf736ab8147f07f98f12b7654cbd2fe38d34646a479a519c261ac253bbaf19c6dcbb0ec4cc0859de70f7e6472 + PATCHES + fix-cmakelists.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DPTHREADPOOL_BUILD_TESTS=OFF + -DPTHREADPOOL_BUILD_BENCHMARKS=OFF +) +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT}) + +#file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/cmake/vcpkg-ports/pthreadpool/vcpkg.json b/cmake/vcpkg-ports/pthreadpool/vcpkg.json new file mode 100644 index 0000000000000..16c0bea5b712c --- /dev/null +++ b/cmake/vcpkg-ports/pthreadpool/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "pthreadpool", + "version-date": "2024-12-17", + "description": "Portable (POSIX/Windows/Emscripten) thread pool for C/C++", + "homepage": "https://github.com/google/pthreadpool", + "dependencies": [ + "fxdiv", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/cmake/vcpkg-ports/xnnpack/disable_gcc_warning.patch b/cmake/vcpkg-ports/xnnpack/disable_gcc_warning.patch new file mode 100644 index 0000000000000..a7c5e0e254aa1 --- /dev/null +++ b/cmake/vcpkg-ports/xnnpack/disable_gcc_warning.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4a9fad59a..2713cded3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -334,6 +334,7 @@ ENDIF() + IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Disable "note: parameter passing for argument of type ... changed/will change in ..." + ADD_COMPILE_OPTIONS("-Wno-psabi") ++ ADD_COMPILE_OPTIONS("-Wno-incompatible-pointer-types") + ENDIF() + + # ---[ Build flags diff --git a/cmake/vcpkg-ports/xnnpack/fix-build.patch b/cmake/vcpkg-ports/xnnpack/fix-build.patch new file mode 100644 index 0000000000000..b867377d2ff9e --- /dev/null +++ b/cmake/vcpkg-ports/xnnpack/fix-build.patch @@ -0,0 +1,71 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f0b3410ae..ba54c3bfe 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1047,9 +1047,11 @@ ENDIF() + IF(XNNPACK_BUILD_ALL_MICROKERNELS) + TARGET_INCLUDE_DIRECTORIES(microkernels-all PRIVATE include src) + ENDIF() ++ + TARGET_INCLUDE_DIRECTORIES(datatype PRIVATE include src) + TARGET_INCLUDE_DIRECTORIES(microkernels-prod PRIVATE include src) +-TARGET_INCLUDE_DIRECTORIES(hardware-config PRIVATE include src ${CPUINFO_SOURCE_DIR}/include) ++TARGET_INCLUDE_DIRECTORIES(hardware-config PRIVATE include src) ++ + TARGET_INCLUDE_DIRECTORIES(indirection PRIVATE include src) + TARGET_INCLUDE_DIRECTORIES(microparams-init PRIVATE include src) + TARGET_INCLUDE_DIRECTORIES(normalization PRIVATE include src) +@@ -1104,14 +1106,9 @@ IF(NOT TARGET cpuinfo) + "${CPUINFO_SOURCE_DIR}" + "${CMAKE_BINARY_DIR}/cpuinfo") + ELSE() +- ADD_LIBRARY(cpuinfo SHARED IMPORTED) +- FIND_LIBRARY(CPUINFO_LIBRARY cpuinfo PATHS "${CPUINFO_SOURCE_DIR}/lib") +- IF(NOT CPUINFO_LIBRARY) +- MESSAGE(FATAL_ERROR "Cannot find cpuinfo") +- ENDIF() +- TARGET_INCLUDE_DIRECTORIES(cpuinfo INTERFACE "${CPUINFO_SOURCE_DIR}/include") +- SET_PROPERTY(TARGET cpuinfo PROPERTY IMPORTED_LOCATION "${CPUINFO_LIBRARY}") +- SET_PROPERTY(TARGET cpuinfo PROPERTY IMPORTED_IMPLIB "${CPUINFO_LIBRARY}") ++ ADD_LIBRARY(cpuinfo INTERFACE) ++ FIND_PACKAGE(cpuinfo CONFIG REQUIRED) ++ TARGET_LINK_LIBRARIES(cpuinfo INTERFACE cpuinfo::cpuinfo) + ENDIF() + ENDIF() + IF(XNNPACK_BUILD_LIBRARY) +@@ -1129,16 +1126,12 @@ IF(NOT TARGET pthreadpool) + "${PTHREADPOOL_SOURCE_DIR}" + "${CMAKE_BINARY_DIR}/pthreadpool") + ELSE() ++ find_package(unofficial-pthreadpool CONFIG REQUIRED) + ADD_LIBRARY(pthreadpool SHARED IMPORTED) +- FIND_LIBRARY(PTHREADPOOL_LIBRARY pthreadpool PATHS "${PTHREADPOOL_SOURCE_DIR}/lib") +- IF(NOT PTHREADPOOL_LIBRARY) +- MESSAGE(FATAL_ERROR "Cannot find pthreadpool") +- ENDIF() ++ FIND_LIBRARY(PTHREADPOOL_LIBRARY NAMES pthreadpool REQUIRED) + FIND_PACKAGE(Threads REQUIRED) +- TARGET_INCLUDE_DIRECTORIES(pthreadpool INTERFACE "${PTHREADPOOL_SOURCE_DIR}/include") +- TARGET_LINK_LIBRARIES(pthreadpool INTERFACE Threads::Threads) ++ TARGET_LINK_LIBRARIES(pthreadpool INTERFACE Threads::Threads unofficial::pthreadpool unofficial::pthreadpool_interface) + SET_PROPERTY(TARGET pthreadpool PROPERTY IMPORTED_LOCATION "${PTHREADPOOL_LIBRARY}") +- SET_PROPERTY(TARGET pthreadpool PROPERTY IMPORTED_IMPLIB "${PTHREADPOOL_LIBRARY}") + ENDIF() + ENDIF() + TARGET_LINK_LIBRARIES(xnnpack-base INTERFACE pthreadpool) +@@ -1152,12 +1145,12 @@ IF(NOT TARGET fxdiv) + "${FXDIV_SOURCE_DIR}" + "${CMAKE_BINARY_DIR}/FXdiv") + ELSE() +- FIND_FILE(FXDIV_HDR fxdiv.h PATH_SUFFIXES include PATHS "${FXDIV_SOURCE_DIR}") ++ FIND_PATH(FXDIV_HDR fxdiv.h PATH_SUFFIXES include) + IF(NOT FXDIV_HDR) + MESSAGE(FATAL_ERROR "Cannot find fxdiv") + ENDIF() +- ADD_LIBRARY(fxdiv STATIC "${FXDIV_HDR}") +- TARGET_INCLUDE_DIRECTORIES(fxdiv INTERFACE "${FXDIV_SOURCE_DIR}/include") ++ ADD_LIBRARY(fxdiv INTERFACE IMPORTED) ++ target_include_directories(fxdiv INTERFACE "${FXDIV_HDR}") + SET_PROPERTY(TARGET fxdiv PROPERTY LINKER_LANGUAGE C) + ENDIF() + ENDIF() diff --git a/cmake/vcpkg-ports/xnnpack/portfile.cmake b/cmake/vcpkg-ports/xnnpack/portfile.cmake new file mode 100644 index 0000000000000..b07da3186b4b4 --- /dev/null +++ b/cmake/vcpkg-ports/xnnpack/portfile.cmake @@ -0,0 +1,39 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO google/XNNPACK + REF 854b343f9cad36bd596e4390959ca3648208e048 + SHA512 f37384b43022cb74bf87bd99c2e82e51d48fe4e0e4642611fcbc10cbb86ff2468b67964027f13f82a715dc7201c490d88d5020fb565ad236187b9dd219f3f644 + HEAD_REF master + PATCHES + fix-build.patch + disable_gcc_warning.patch +) +vcpkg_find_acquire_program(PYTHON3) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + WINDOWS_USE_MSBUILD + OPTIONS + "-DPython3_EXECUTABLE=${PYTHON3}" + "-DPython_EXECUTABLE=${PYTHON3}" + -DXNNPACK_USE_SYSTEM_LIBS=ON + -DXNNPACK_ENABLE_AVXVNNI=OFF + -DXNNPACK_ENABLE_ASSEMBLY=ON + -DXNNPACK_ENABLE_MEMOPT=ON + -DXNNPACK_ENABLE_SPARSE=ON + -DXNNPACK_ENABLE_KLEIDIAI=OFF + -DXNNPACK_BUILD_TESTS=OFF + -DXNNPACK_BUILD_BENCHMARKS=OFF +) +vcpkg_cmake_install() +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/bin" + "${CURRENT_PACKAGES_DIR}/debug/share" +) diff --git a/cmake/vcpkg-ports/xnnpack/vcpkg.json b/cmake/vcpkg-ports/xnnpack/vcpkg.json new file mode 100644 index 0000000000000..5e383c0b37810 --- /dev/null +++ b/cmake/vcpkg-ports/xnnpack/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "xnnpack", + "version-date": "2025-01-17", + "description": "High-efficiency floating-point neural network inference operators for mobile, server, and Web", + "homepage": "https://github.com/google/XNNPACK", + "license": "BSD-3-Clause", + "supports": "!(arm & windows) & !uwp & !arm32", + "dependencies": [ + "cpuinfo", + "fxdiv", + "pthreadpool", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/cmake/vcpkg-triplets/asan/arm64-linux.cmake b/cmake/vcpkg-triplets/asan/arm64-linux.cmake index 6875a03064bfa..335a27163b805 100644 --- a/cmake/vcpkg-triplets/asan/arm64-linux.cmake +++ b/cmake/vcpkg-triplets/asan/arm64-linux.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-fsanitize=address") -set(VCPKG_CXX_FLAGS "-fsanitize=address") +set(VCPKG_C_FLAGS "-fsanitize=address -g") +set(VCPKG_CXX_FLAGS "-fsanitize=address -g") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) -set(VCPKG_LINKER_FLAGS "-fsanitize=address") +set(VCPKG_LINKER_FLAGS "-fsanitize=address -g") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/arm64-osx.cmake b/cmake/vcpkg-triplets/asan/arm64-osx.cmake index 4ac6bd8097de6..4218df366e6f9 100644 --- a/cmake/vcpkg-triplets/asan/arm64-osx.cmake +++ b/cmake/vcpkg-triplets/asan/arm64-osx.cmake @@ -3,13 +3,14 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-fsanitize=address") -set(VCPKG_CXX_FLAGS "-fsanitize=address") +set(VCPKG_C_FLAGS "-fsanitize=address -g") +set(VCPKG_CXX_FLAGS "-fsanitize=address -g") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) -set(VCPKG_LINKER_FLAGS "-fsanitize=address") +set(VCPKG_LINKER_FLAGS "-fsanitize=address -g") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/asan/arm64-windows-static-md.cmake index c03c9e718fc80..37b8008a7bef3 100644 --- a/cmake/vcpkg-triplets/asan/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/arm64-windows-static.cmake b/cmake/vcpkg-triplets/asan/arm64-windows-static.cmake index 184001d4238b0..01a81eae32cfb 100644 --- a/cmake/vcpkg-triplets/asan/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/asan/arm64ec-windows-static-md.cmake index 36176fe04033e..845ed0eb414ad 100644 --- a/cmake/vcpkg-triplets/asan/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/asan/arm64ec-windows-static.cmake index aa086c1220dfb..f40edf6fee6f6 100644 --- a/cmake/vcpkg-triplets/asan/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/universal2-osx.cmake b/cmake/vcpkg-triplets/asan/universal2-osx.cmake index de2c8cee48ed5..ab7008b3c621e 100644 --- a/cmake/vcpkg-triplets/asan/universal2-osx.cmake +++ b/cmake/vcpkg-triplets/asan/universal2-osx.cmake @@ -3,13 +3,14 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-fsanitize=address") -set(VCPKG_CXX_FLAGS "-fsanitize=address") +set(VCPKG_C_FLAGS "-fsanitize=address -g") +set(VCPKG_CXX_FLAGS "-fsanitize=address -g") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64;arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) -set(VCPKG_LINKER_FLAGS "-fsanitize=address") +set(VCPKG_LINKER_FLAGS "-fsanitize=address -g") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/x64-linux.cmake b/cmake/vcpkg-triplets/asan/x64-linux.cmake index dd1d066eb373a..7d8df1affbf1f 100644 --- a/cmake/vcpkg-triplets/asan/x64-linux.cmake +++ b/cmake/vcpkg-triplets/asan/x64-linux.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-fsanitize=address") -set(VCPKG_CXX_FLAGS "-fsanitize=address") +set(VCPKG_C_FLAGS "-fsanitize=address -g") +set(VCPKG_CXX_FLAGS "-fsanitize=address -g") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) -set(VCPKG_LINKER_FLAGS "-fsanitize=address") +set(VCPKG_LINKER_FLAGS "-fsanitize=address -g") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/x64-osx.cmake b/cmake/vcpkg-triplets/asan/x64-osx.cmake index 5f1442c1d5c4e..de04df980a014 100644 --- a/cmake/vcpkg-triplets/asan/x64-osx.cmake +++ b/cmake/vcpkg-triplets/asan/x64-osx.cmake @@ -3,13 +3,14 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-fsanitize=address") -set(VCPKG_CXX_FLAGS "-fsanitize=address") +set(VCPKG_C_FLAGS "-fsanitize=address -g") +set(VCPKG_CXX_FLAGS "-fsanitize=address -g") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) -set(VCPKG_LINKER_FLAGS "-fsanitize=address") +set(VCPKG_LINKER_FLAGS "-fsanitize=address -g") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/asan/x64-windows-static-md.cmake index 27f7a0190a33c..d8d5058baaf4b 100644 --- a/cmake/vcpkg-triplets/asan/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/x64-windows-static.cmake b/cmake/vcpkg-triplets/asan/x64-windows-static.cmake index 23b8082fbd5a3..ad8fb85a4f52d 100644 --- a/cmake/vcpkg-triplets/asan/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/asan/x86-windows-static-md.cmake index cb9c639049936..d77e925b0884b 100644 --- a/cmake/vcpkg-triplets/asan/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/x86-windows-static.cmake b/cmake/vcpkg-triplets/asan/x86-windows-static.cmake index 0667f5f0ea61e..65149e501be7a 100644 --- a/cmake/vcpkg-triplets/asan/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/arm64-linux.cmake b/cmake/vcpkg-triplets/asan_nortti/arm64-linux.cmake index 77f35ebada258..829ad01ba9f7a 100644 --- a/cmake/vcpkg-triplets/asan_nortti/arm64-linux.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/arm64-linux.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-fsanitize=address -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") -set(VCPKG_CXX_FLAGS "-fsanitize=address -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") +set(VCPKG_C_FLAGS "-fsanitize=address -g -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") +set(VCPKG_CXX_FLAGS "-fsanitize=address -g -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) -set(VCPKG_LINKER_FLAGS "-fsanitize=address") +set(VCPKG_LINKER_FLAGS "-fsanitize=address -g") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/arm64-osx.cmake b/cmake/vcpkg-triplets/asan_nortti/arm64-osx.cmake index 5cc70905e6e24..3df1d227c72b0 100644 --- a/cmake/vcpkg-triplets/asan_nortti/arm64-osx.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/arm64-osx.cmake @@ -3,13 +3,14 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-fsanitize=address -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") -set(VCPKG_CXX_FLAGS "-fsanitize=address -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") +set(VCPKG_C_FLAGS "-fsanitize=address -g -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") +set(VCPKG_CXX_FLAGS "-fsanitize=address -g -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) -set(VCPKG_LINKER_FLAGS "-fsanitize=address") +set(VCPKG_LINKER_FLAGS "-fsanitize=address -g") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static-md.cmake index cb0957791f432..4e2d9033835e1 100644 --- a/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static.cmake b/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static.cmake index 2d38883062bb1..774a5a11992e4 100644 --- a/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static-md.cmake index 4cc7102bf3b1c..146dff06dffb4 100644 --- a/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static.cmake index d84533c8de35c..6028350578f06 100644 --- a/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/universal2-osx.cmake b/cmake/vcpkg-triplets/asan_nortti/universal2-osx.cmake index cacbfa751677d..dd3d63371b747 100644 --- a/cmake/vcpkg-triplets/asan_nortti/universal2-osx.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/universal2-osx.cmake @@ -3,13 +3,14 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-fsanitize=address -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") -set(VCPKG_CXX_FLAGS "-fsanitize=address -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") +set(VCPKG_C_FLAGS "-fsanitize=address -g -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") +set(VCPKG_CXX_FLAGS "-fsanitize=address -g -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64;arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) -set(VCPKG_LINKER_FLAGS "-fsanitize=address") +set(VCPKG_LINKER_FLAGS "-fsanitize=address -g") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/x64-linux.cmake b/cmake/vcpkg-triplets/asan_nortti/x64-linux.cmake index b53e668a64c09..80eb698ca3c61 100644 --- a/cmake/vcpkg-triplets/asan_nortti/x64-linux.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/x64-linux.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-fsanitize=address -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") -set(VCPKG_CXX_FLAGS "-fsanitize=address -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") +set(VCPKG_C_FLAGS "-fsanitize=address -g -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") +set(VCPKG_CXX_FLAGS "-fsanitize=address -g -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) -set(VCPKG_LINKER_FLAGS "-fsanitize=address") +set(VCPKG_LINKER_FLAGS "-fsanitize=address -g") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/x64-osx.cmake b/cmake/vcpkg-triplets/asan_nortti/x64-osx.cmake index 9f4adb513edd4..d391472a1562f 100644 --- a/cmake/vcpkg-triplets/asan_nortti/x64-osx.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/x64-osx.cmake @@ -3,13 +3,14 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-fsanitize=address -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") -set(VCPKG_CXX_FLAGS "-fsanitize=address -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") +set(VCPKG_C_FLAGS "-fsanitize=address -g -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") +set(VCPKG_CXX_FLAGS "-fsanitize=address -g -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) -set(VCPKG_LINKER_FLAGS "-fsanitize=address") +set(VCPKG_LINKER_FLAGS "-fsanitize=address -g") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/asan_nortti/x64-windows-static-md.cmake index 2812ed9419e43..df0e9e59191e0 100644 --- a/cmake/vcpkg-triplets/asan_nortti/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/x64-windows-static.cmake b/cmake/vcpkg-triplets/asan_nortti/x64-windows-static.cmake index ccdb919b3e3ee..ce5e3107c3b27 100644 --- a/cmake/vcpkg-triplets/asan_nortti/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/asan_nortti/x86-windows-static-md.cmake index 7a6b45666a924..727e50d5ddf3c 100644 --- a/cmake/vcpkg-triplets/asan_nortti/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/x86-windows-static.cmake b/cmake/vcpkg-triplets/asan_nortti/x86-windows-static.cmake index 96b2a2ad749b8..da9c6accc6971 100644 --- a/cmake/vcpkg-triplets/asan_nortti/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim/arm64-linux.cmake b/cmake/vcpkg-triplets/binskim/arm64-linux.cmake index 4b738553e0fbc..cbccaa80edc1b 100644 --- a/cmake/vcpkg-triplets/binskim/arm64-linux.cmake +++ b/cmake/vcpkg-triplets/binskim/arm64-linux.cmake @@ -3,12 +3,11 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong") -set(VCPKG_CXX_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) set(VCPKG_LINKER_FLAGS "-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim/arm64-osx.cmake b/cmake/vcpkg-triplets/binskim/arm64-osx.cmake index 4b6999874b111..31995e8a618b7 100644 --- a/cmake/vcpkg-triplets/binskim/arm64-osx.cmake +++ b/cmake/vcpkg-triplets/binskim/arm64-osx.cmake @@ -3,12 +3,11 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong") -set(VCPKG_CXX_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim/arm64-windows-static-md.cmake index 89dfae4bcbf26..0b343b428609f 100644 --- a/cmake/vcpkg-triplets/binskim/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/arm64-windows-static.cmake b/cmake/vcpkg-triplets/binskim/arm64-windows-static.cmake index 28ef65c4d1227..4e606d0dc5c04 100644 --- a/cmake/vcpkg-triplets/binskim/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim/arm64ec-windows-static-md.cmake index 0c087aa1b59f7..e218dbad4dc5a 100644 --- a/cmake/vcpkg-triplets/binskim/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/binskim/arm64ec-windows-static.cmake index 8c7de3b8a97f9..5899d7dc4ef81 100644 --- a/cmake/vcpkg-triplets/binskim/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/universal2-osx.cmake b/cmake/vcpkg-triplets/binskim/universal2-osx.cmake index 60826f1ede770..05baec9bfd589 100644 --- a/cmake/vcpkg-triplets/binskim/universal2-osx.cmake +++ b/cmake/vcpkg-triplets/binskim/universal2-osx.cmake @@ -3,12 +3,11 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong") -set(VCPKG_CXX_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64;arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim/x64-linux.cmake b/cmake/vcpkg-triplets/binskim/x64-linux.cmake index 8d7aeb2342e26..c064dba9a2abf 100644 --- a/cmake/vcpkg-triplets/binskim/x64-linux.cmake +++ b/cmake/vcpkg-triplets/binskim/x64-linux.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection") -set(VCPKG_CXX_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection") +set(VCPKG_C_FLAGS "-fstack-clash-protection -fcf-protection") +set(VCPKG_CXX_FLAGS "-fstack-clash-protection -fcf-protection") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) set(VCPKG_LINKER_FLAGS "-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim/x64-osx.cmake b/cmake/vcpkg-triplets/binskim/x64-osx.cmake index e391ab9eaee6d..ec44c16023088 100644 --- a/cmake/vcpkg-triplets/binskim/x64-osx.cmake +++ b/cmake/vcpkg-triplets/binskim/x64-osx.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection") -set(VCPKG_CXX_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection") +set(VCPKG_C_FLAGS "-fstack-clash-protection -fcf-protection") +set(VCPKG_CXX_FLAGS "-fstack-clash-protection -fcf-protection") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim/x64-windows-static-md.cmake index ef67223cd0cd3..80685a145d7cb 100644 --- a/cmake/vcpkg-triplets/binskim/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/x64-windows-static.cmake b/cmake/vcpkg-triplets/binskim/x64-windows-static.cmake index 62948a156c911..26572c05ea4e9 100644 --- a/cmake/vcpkg-triplets/binskim/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim/x86-windows-static-md.cmake index 8ac022c7eee4c..996c6687172eb 100644 --- a/cmake/vcpkg-triplets/binskim/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/x86-windows-static.cmake b/cmake/vcpkg-triplets/binskim/x86-windows-static.cmake index 8fd2d29dc3d99..56b0225f8ad0b 100644 --- a/cmake/vcpkg-triplets/binskim/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/arm64-linux.cmake b/cmake/vcpkg-triplets/binskim_nortti/arm64-linux.cmake index c9787f460b78d..6ba3f0a58edb2 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/arm64-linux.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/arm64-linux.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") -set(VCPKG_CXX_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") +set(VCPKG_C_FLAGS "-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") +set(VCPKG_CXX_FLAGS "-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) set(VCPKG_LINKER_FLAGS "-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim_nortti/arm64-osx.cmake b/cmake/vcpkg-triplets/binskim_nortti/arm64-osx.cmake index f5866d6863cb7..d1f5cf4ae8781 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/arm64-osx.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/arm64-osx.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") -set(VCPKG_CXX_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") +set(VCPKG_C_FLAGS "-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") +set(VCPKG_CXX_FLAGS "-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static-md.cmake index 927b110c98d45..1f93fcf58e012 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static.cmake b/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static.cmake index b0419c9a0d0e0..01e372cd591ef 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static-md.cmake index aa8b7a5f0e96b..2ccfa85dbc206 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static.cmake index 96da5d9b1372f..696dccdebc083 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/universal2-osx.cmake b/cmake/vcpkg-triplets/binskim_nortti/universal2-osx.cmake index f4ef6f0c659d8..5c4937d0034d2 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/universal2-osx.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/universal2-osx.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") -set(VCPKG_CXX_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") +set(VCPKG_C_FLAGS "-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") +set(VCPKG_CXX_FLAGS "-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64;arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim_nortti/x64-linux.cmake b/cmake/vcpkg-triplets/binskim_nortti/x64-linux.cmake index 8fe977fb86e56..6ef70873e0d92 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/x64-linux.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/x64-linux.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") -set(VCPKG_CXX_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") +set(VCPKG_C_FLAGS "-fstack-clash-protection -fcf-protection -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") +set(VCPKG_CXX_FLAGS "-fstack-clash-protection -fcf-protection -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) set(VCPKG_LINKER_FLAGS "-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack") +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim_nortti/x64-osx.cmake b/cmake/vcpkg-triplets/binskim_nortti/x64-osx.cmake index 196018d7cf442..d7522e868f630 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/x64-osx.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/x64-osx.cmake @@ -3,12 +3,13 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") -set(VCPKG_CXX_FLAGS "-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") +set(VCPKG_C_FLAGS "-fstack-clash-protection -fcf-protection -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0") +set(VCPKG_CXX_FLAGS "-fstack-clash-protection -fcf-protection -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static-md.cmake index 38b5cbdde2d65..50ee3ea4a5bf6 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static.cmake b/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static.cmake index bea970b669f4f..2984e5cd01a73 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static-md.cmake index e75d0c645c6a1..21e7ab3db4f20 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static.cmake b/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static.cmake index 6de6f80d9705c..f11f9aea970fe 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/default/arm64-linux.cmake b/cmake/vcpkg-triplets/default/arm64-linux.cmake index 581367931ba5e..29ec4b7adee2e 100644 --- a/cmake/vcpkg-triplets/default/arm64-linux.cmake +++ b/cmake/vcpkg-triplets/default/arm64-linux.cmake @@ -3,11 +3,10 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "") -set(VCPKG_CXX_FLAGS "") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/arm64-osx.cmake b/cmake/vcpkg-triplets/default/arm64-osx.cmake index 4d74306ba4e6a..31995e8a618b7 100644 --- a/cmake/vcpkg-triplets/default/arm64-osx.cmake +++ b/cmake/vcpkg-triplets/default/arm64-osx.cmake @@ -3,12 +3,11 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "") -set(VCPKG_CXX_FLAGS "") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/default/arm64-windows-static-md.cmake index 135dc6ed6f3b5..349cf9eb0e4ac 100644 --- a/cmake/vcpkg-triplets/default/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/default/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/arm64-windows-static.cmake b/cmake/vcpkg-triplets/default/arm64-windows-static.cmake index 56e1aebfe620b..64b0980ca8d1f 100644 --- a/cmake/vcpkg-triplets/default/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/default/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/default/arm64ec-windows-static-md.cmake index 9256f07f5451d..6480822cb887b 100644 --- a/cmake/vcpkg-triplets/default/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/default/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/default/arm64ec-windows-static.cmake index bbdfed06fb2bc..fc00cd92d3d00 100644 --- a/cmake/vcpkg-triplets/default/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/default/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/universal2-osx.cmake b/cmake/vcpkg-triplets/default/universal2-osx.cmake index 64b19451dd64d..05baec9bfd589 100644 --- a/cmake/vcpkg-triplets/default/universal2-osx.cmake +++ b/cmake/vcpkg-triplets/default/universal2-osx.cmake @@ -3,12 +3,11 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "") -set(VCPKG_CXX_FLAGS "") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64;arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/x64-linux.cmake b/cmake/vcpkg-triplets/default/x64-linux.cmake index 57114dd5fcb76..e94e9346e5278 100644 --- a/cmake/vcpkg-triplets/default/x64-linux.cmake +++ b/cmake/vcpkg-triplets/default/x64-linux.cmake @@ -3,11 +3,10 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "") -set(VCPKG_CXX_FLAGS "") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/x64-osx.cmake b/cmake/vcpkg-triplets/default/x64-osx.cmake index dd50e622677b7..cb15260f4cc75 100644 --- a/cmake/vcpkg-triplets/default/x64-osx.cmake +++ b/cmake/vcpkg-triplets/default/x64-osx.cmake @@ -3,12 +3,11 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "") -set(VCPKG_CXX_FLAGS "") set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/default/x64-windows-static-md.cmake index 5339a033715bb..db41d03399faf 100644 --- a/cmake/vcpkg-triplets/default/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/default/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/x64-windows-static.cmake b/cmake/vcpkg-triplets/default/x64-windows-static.cmake index 579740efb6ab7..4bcf3adc5d7e4 100644 --- a/cmake/vcpkg-triplets/default/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/default/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/default/x86-windows-static-md.cmake index 34223c67e8f44..47516cfd71652 100644 --- a/cmake/vcpkg-triplets/default/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/default/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/x86-windows-static.cmake b/cmake/vcpkg-triplets/default/x86-windows-static.cmake index fc95d409f890e..19c2073c5627f 100644 --- a/cmake/vcpkg-triplets/default/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/default/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/gen.py b/cmake/vcpkg-triplets/gen.py index 615ca66fc8f64..e5443d5f46bdd 100644 --- a/cmake/vcpkg-triplets/gen.py +++ b/cmake/vcpkg-triplets/gen.py @@ -88,9 +88,11 @@ def add_copyright_header(f): # Disable RTTI and turn usage of dynamic_cast and typeid into errors cxxflags += ["/GR-", "/we4541"] # TODO: should it be a cmake list separated by semicolons? - f.write('set(VCPKG_C_FLAGS "{}")\n'.format(" ".join(cflags))) - f.write('set(VCPKG_CXX_FLAGS "{}")\n'.format(" ".join(cxxflags))) - f.write("list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error)\n") + if len(cflags) >= 1: + f.write('set(VCPKG_C_FLAGS "{}")\n'.format(" ".join(cflags))) + if len(cxxflags) >= 1: + f.write('set(VCPKG_CXX_FLAGS "{}")\n'.format(" ".join(cxxflags))) + f.write("list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17)\n") if ldflags: f.write('set(VCPKG_LINKER_FLAGS "{}")\n'.format(" ".join(ldflags))) add_port_configs(f) @@ -146,16 +148,17 @@ def add_copyright_header(f): ldflags = [] cflags = [] if enable_binskim: - cflags += [ - "-Wp,-D_FORTIFY_SOURCE=2", - "-Wp,-D_GLIBCXX_ASSERTIONS", - "-fstack-protector-strong", - ] + # TODO: enable the following flags for optimized build + #cflags += [ + # "-Wp,-D_FORTIFY_SOURCE=2", + # "-Wp,-D_GLIBCXX_ASSERTIONS", + # "-fstack-protector-strong", + #] if target_abi == "x64": cflags += ["-fstack-clash-protection", "-fcf-protection"] elif enable_asan: - cflags += ["-fsanitize=address"] - ldflags += ["-fsanitize=address"] + cflags += ["-fsanitize=address", "-g"] + ldflags += ["-fsanitize=address", "-g"] # Avoid unboundTypeError for WebNN EP since unbound type names are illegal with RTTI disabled # in Embind API, relevant issue: https://github.com/emscripten-core/emscripten/issues/7001 if not enable_rtti: @@ -163,8 +166,10 @@ def add_copyright_header(f): cxxflags = cflags.copy() if not enable_rtti: cxxflags.append("-fno-rtti") - f.write('set(VCPKG_C_FLAGS "{}")\n'.format(" ".join(cflags))) - f.write('set(VCPKG_CXX_FLAGS "{}")\n'.format(" ".join(cxxflags))) + if len(cflags) >= 1: + f.write('set(VCPKG_C_FLAGS "{}")\n'.format(" ".join(cflags))) + if len(cxxflags) >= 1: + f.write('set(VCPKG_CXX_FLAGS "{}")\n'.format(" ".join(cxxflags))) if os_name == "linux": f.write("set(VCPKG_CMAKE_SYSTEM_NAME Linux)\n") else: @@ -184,4 +189,8 @@ def add_copyright_header(f): if ldflags: f.write('set(VCPKG_LINKER_FLAGS "{}")\n'.format(" ".join(ldflags))) + if os_name == 'osx': + f.write('list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20)\n') + else: + f.write('list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17)\n') add_port_configs(f) diff --git a/cmake/vcpkg-triplets/nortti/arm64-linux.cmake b/cmake/vcpkg-triplets/nortti/arm64-linux.cmake index 4bd974a112125..0f17e20ed5a86 100644 --- a/cmake/vcpkg-triplets/nortti/arm64-linux.cmake +++ b/cmake/vcpkg-triplets/nortti/arm64-linux.cmake @@ -8,6 +8,7 @@ set(VCPKG_CXX_FLAGS "-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/arm64-osx.cmake b/cmake/vcpkg-triplets/nortti/arm64-osx.cmake index fd8be60b7158a..d1f5cf4ae8781 100644 --- a/cmake/vcpkg-triplets/nortti/arm64-osx.cmake +++ b/cmake/vcpkg-triplets/nortti/arm64-osx.cmake @@ -9,6 +9,7 @@ set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/nortti/arm64-windows-static-md.cmake index 45b24baa2c94b..5eaefc8b50926 100644 --- a/cmake/vcpkg-triplets/nortti/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/nortti/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/arm64-windows-static.cmake b/cmake/vcpkg-triplets/nortti/arm64-windows-static.cmake index 947fe9b61bd6c..0395d029b9dff 100644 --- a/cmake/vcpkg-triplets/nortti/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/nortti/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/nortti/arm64ec-windows-static-md.cmake index ea5741fa42fbe..b6bd29fbfe2a8 100644 --- a/cmake/vcpkg-triplets/nortti/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/nortti/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/nortti/arm64ec-windows-static.cmake index 2b354ba511303..13b5340a0345f 100644 --- a/cmake/vcpkg-triplets/nortti/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/nortti/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/universal2-osx.cmake b/cmake/vcpkg-triplets/nortti/universal2-osx.cmake index 7111bb87c910b..5c4937d0034d2 100644 --- a/cmake/vcpkg-triplets/nortti/universal2-osx.cmake +++ b/cmake/vcpkg-triplets/nortti/universal2-osx.cmake @@ -9,6 +9,7 @@ set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64;arm64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/x64-linux.cmake b/cmake/vcpkg-triplets/nortti/x64-linux.cmake index 34fcc968e6c0e..556227ea00e60 100644 --- a/cmake/vcpkg-triplets/nortti/x64-linux.cmake +++ b/cmake/vcpkg-triplets/nortti/x64-linux.cmake @@ -8,6 +8,7 @@ set(VCPKG_CXX_FLAGS "-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -fno-rtti") set(VCPKG_CMAKE_SYSTEM_NAME Linux) set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/x64-osx.cmake b/cmake/vcpkg-triplets/nortti/x64-osx.cmake index 0a7fcc08e0c69..6e8a6e8ead14e 100644 --- a/cmake/vcpkg-triplets/nortti/x64-osx.cmake +++ b/cmake/vcpkg-triplets/nortti/x64-osx.cmake @@ -9,6 +9,7 @@ set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES "x86_64") set(CMAKE_POSITION_INDEPENDENT_CODE ON) list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DBENCHMARK_ENABLE_WERROR=OFF) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CXX_STANDARD=20) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/nortti/x64-windows-static-md.cmake index 5c62c4263f8eb..e94fe62a2b810 100644 --- a/cmake/vcpkg-triplets/nortti/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/nortti/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/x64-windows-static.cmake b/cmake/vcpkg-triplets/nortti/x64-windows-static.cmake index deceefcd95910..5ce29a1c2e319 100644 --- a/cmake/vcpkg-triplets/nortti/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/nortti/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/nortti/x86-windows-static-md.cmake index cb1b3cd887932..14b44565e9ed3 100644 --- a/cmake/vcpkg-triplets/nortti/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/nortti/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/x86-windows-static.cmake b/cmake/vcpkg-triplets/nortti/x86-windows-static.cmake index 032021745099a..88110ae1e2003 100644 --- a/cmake/vcpkg-triplets/nortti/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/nortti/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg.json b/cmake/vcpkg.json index e874c29a13f1c..cd503c93e7c65 100644 --- a/cmake/vcpkg.json +++ b/cmake/vcpkg.json @@ -24,21 +24,18 @@ "host": true, "version>=": "23.5.26" }, + "fp16", { "name": "flatbuffers", "version>=": "23.5.26" }, - "ms-gsl", - "nlohmann-json", { - "name": "nsync", - "platform": "!windows", - "version>=": "1.26.0" - }, - { - "name": "onnx", - "version>=": "1.16.2" + "name": "mimalloc", + "platform": "windows" }, + "ms-gsl", + "nlohmann-json", + "onnx", "optional-lite", { "name": "protobuf", @@ -49,6 +46,7 @@ "host": true, "version>=": "3.21.12" }, + "pthreadpool", "re2", "safeint", "utf8-range", @@ -60,7 +58,11 @@ "name": "vcpkg-cmake-config", "host": true }, - "wil", + { + "name": "wil", + "platform": "windows" + }, + "xnnpack", { "name": "zlib", "platform": "windows" diff --git a/include/onnxruntime/core/graph/node_arg.h b/include/onnxruntime/core/graph/node_arg.h index 921bff59fb6d4..0ddf1a2b9d3de 100644 --- a/include/onnxruntime/core/graph/node_arg.h +++ b/include/onnxruntime/core/graph/node_arg.h @@ -3,7 +3,7 @@ #pragma once -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "core/graph/basic_types.h" #include "core/common/status.h" diff --git a/onnxruntime/core/graph/onnx_protobuf.h b/include/onnxruntime/core/graph/onnx_protobuf.h similarity index 100% rename from onnxruntime/core/graph/onnx_protobuf.h rename to include/onnxruntime/core/graph/onnx_protobuf.h diff --git a/onnxruntime/core/graph/function_template.h b/onnxruntime/core/graph/function_template.h index 978174d943f14..0d3fee18d5d59 100644 --- a/onnxruntime/core/graph/function_template.h +++ b/onnxruntime/core/graph/function_template.h @@ -2,7 +2,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" namespace onnxruntime { diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc index 91cad034d8854..d5c73fdc88a2a 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc index 75a66d3a14643..f55d5757d8c21 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc index 5599fbdc69bdd..771430b56ca7f 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc index 9059de817e210..88af8ba96c76b 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc index 9821d9267c71f..c078aebb966a5 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc index a8394faec51be..deea532b57790 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc index 5477cd16f9c01..789efed9c6727 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc index ef8709641e2d0..dc79682ab1b5b 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc index 7d0e04fbd7b0e..c99810d1f603a 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc index 218c41d6f07c0..f4bc9928c4ab1 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc index b5e9c011990ce..a4c731de577cf 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc index d6da9181b5a3d..72e0eceb60e9e 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc index 66eefcd6e4840..a3c2f0e957d92 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc index d7b35572e6cd1..5751f93b2f015 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc index 6a633c443c9e5..19044bf7fb7a0 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/framework/tensorprotoutils.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc index aeadbd17053cf..d7339a7c2c349 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc index b0404ebec0583..8d586056ad615 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc index a2a4786b72ec7..8505a858d7686 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc index d13b81c2a14b8..83b0cad4124de 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc index a6da290753b74..8f1baa86e8bdb 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc index c8641093ee7eb..ac7e2f7a95571 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc index f2f9165d2f3cc..f15365aa39f2b 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc index 44403010c936c..fc84c91f14d4a 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc index facdc7132dc00..925947cccc7c6 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc index a2a8b4512b028..1618cb5c234eb 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc index edee298ad1ccf..820d7e0324723 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include #include "core/common/logging/logging.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc index fb3ca5e6175fa..28db46acc736a 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc index 6fe5ca32fe044..d9860de9317c9 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc index dbd960ee5536c..58a0512cd6053 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc index 95cd813800c9a..3ece362e48724 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h index 4db335afa98b0..089904c9d559f 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h @@ -2,7 +2,7 @@ // Licensed under the MIT License. #pragma once -#include +#include #include #include "core/common/inlined_containers_fwd.h" diff --git a/onnxruntime/core/providers/rknpu/node_attr_helper.h b/onnxruntime/core/providers/rknpu/node_attr_helper.h index 6ab8f8c6bb953..0b9f5d5b71662 100644 --- a/onnxruntime/core/providers/rknpu/node_attr_helper.h +++ b/onnxruntime/core/providers/rknpu/node_attr_helper.h @@ -4,7 +4,7 @@ #pragma once -#include +#include #include #include diff --git a/onnxruntime/core/providers/rknpu/onnx_converter.h b/onnxruntime/core/providers/rknpu/onnx_converter.h index e90efd75b9c7f..379cf39c0863c 100644 --- a/onnxruntime/core/providers/rknpu/onnx_converter.h +++ b/onnxruntime/core/providers/rknpu/onnx_converter.h @@ -2,7 +2,7 @@ #pragma once -#include +#include #include #include diff --git a/onnxruntime/test/fuzzing/include/OnnxPrediction.h b/onnxruntime/test/fuzzing/include/OnnxPrediction.h index c169aaa16fd6e..c99120dc45479 100644 --- a/onnxruntime/test/fuzzing/include/OnnxPrediction.h +++ b/onnxruntime/test/fuzzing/include/OnnxPrediction.h @@ -20,7 +20,7 @@ #include #include "BetaDistribution.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "onnxruntime_cxx_api.h" #include "testlog.h" diff --git a/onnxruntime/test/fuzzing/ort_libfuzzer/OrtProtoLibfuzzer.cpp b/onnxruntime/test/fuzzing/ort_libfuzzer/OrtProtoLibfuzzer.cpp index 607d9cfd9c755..472122be58e89 100644 --- a/onnxruntime/test/fuzzing/ort_libfuzzer/OrtProtoLibfuzzer.cpp +++ b/onnxruntime/test/fuzzing/ort_libfuzzer/OrtProtoLibfuzzer.cpp @@ -5,7 +5,7 @@ #include "OnnxPrediction.h" #include "onnxruntime_session_options_config_keys.h" #include "src/libfuzzer/libfuzzer_macro.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include diff --git a/onnxruntime/test/providers/coreml/coreml_basic_test.cc b/onnxruntime/test/providers/coreml/coreml_basic_test.cc index 302ad57fb88c5..a9aa78b7a3229 100644 --- a/onnxruntime/test/providers/coreml/coreml_basic_test.cc +++ b/onnxruntime/test/providers/coreml/coreml_basic_test.cc @@ -15,7 +15,7 @@ #include "test/util/include/inference_session_wrapper.h" #include "test/util/include/test_environment.h" #include "test/util/include/test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #if !defined(ORT_MINIMAL_BUILD) // if this is a full build we need the provider test utils diff --git a/onnxruntime/test/providers/qnn/argmaxmin_op_test.cc b/onnxruntime/test/providers/qnn/argmaxmin_op_test.cc index c514cf16b2f3c..da6eda1317778 100644 --- a/onnxruntime/test/providers/qnn/argmaxmin_op_test.cc +++ b/onnxruntime/test/providers/qnn/argmaxmin_op_test.cc @@ -9,7 +9,7 @@ #include "core/graph/node_attr_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/average_pool_test.cc b/onnxruntime/test/providers/qnn/average_pool_test.cc index 1a0f9bfcbae97..f897a08da6b2e 100644 --- a/onnxruntime/test/providers/qnn/average_pool_test.cc +++ b/onnxruntime/test/providers/qnn/average_pool_test.cc @@ -11,7 +11,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/cast_test.cc b/onnxruntime/test/providers/qnn/cast_test.cc index 9b83dd281a56d..e2e4b0d714e54 100644 --- a/onnxruntime/test/providers/qnn/cast_test.cc +++ b/onnxruntime/test/providers/qnn/cast_test.cc @@ -9,7 +9,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/clip_op_test.cc b/onnxruntime/test/providers/qnn/clip_op_test.cc index cfa77a46210b3..21bd6fcc98d74 100644 --- a/onnxruntime/test/providers/qnn/clip_op_test.cc +++ b/onnxruntime/test/providers/qnn/clip_op_test.cc @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/flatten_op_test.cc b/onnxruntime/test/providers/qnn/flatten_op_test.cc index 637d3257ddea7..b33f8f9c00fc4 100644 --- a/onnxruntime/test/providers/qnn/flatten_op_test.cc +++ b/onnxruntime/test/providers/qnn/flatten_op_test.cc @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/gather_elems_op_test.cc b/onnxruntime/test/providers/qnn/gather_elems_op_test.cc index 81c08873064c8..85dc792666827 100644 --- a/onnxruntime/test/providers/qnn/gather_elems_op_test.cc +++ b/onnxruntime/test/providers/qnn/gather_elems_op_test.cc @@ -11,7 +11,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/gemm_op_test.cc b/onnxruntime/test/providers/qnn/gemm_op_test.cc index da0c7f2c36854..0c1146ba22360 100644 --- a/onnxruntime/test/providers/qnn/gemm_op_test.cc +++ b/onnxruntime/test/providers/qnn/gemm_op_test.cc @@ -9,7 +9,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/logical_comp_ops_test.cc b/onnxruntime/test/providers/qnn/logical_comp_ops_test.cc index 59105136781f4..522b781379119 100644 --- a/onnxruntime/test/providers/qnn/logical_comp_ops_test.cc +++ b/onnxruntime/test/providers/qnn/logical_comp_ops_test.cc @@ -9,7 +9,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/lrn_op_test.cc b/onnxruntime/test/providers/qnn/lrn_op_test.cc index a99cba66bf167..4b26ed0da93c7 100644 --- a/onnxruntime/test/providers/qnn/lrn_op_test.cc +++ b/onnxruntime/test/providers/qnn/lrn_op_test.cc @@ -9,7 +9,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/matmul_test.cpp b/onnxruntime/test/providers/qnn/matmul_test.cpp index f3f584f24a102..dec9369b81748 100644 --- a/onnxruntime/test/providers/qnn/matmul_test.cpp +++ b/onnxruntime/test/providers/qnn/matmul_test.cpp @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/max_min_op_test.cc b/onnxruntime/test/providers/qnn/max_min_op_test.cc index 3deff121f3c72..9a45d11b7e34f 100644 --- a/onnxruntime/test/providers/qnn/max_min_op_test.cc +++ b/onnxruntime/test/providers/qnn/max_min_op_test.cc @@ -7,7 +7,7 @@ #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/pad_op_test.cpp b/onnxruntime/test/providers/qnn/pad_op_test.cpp index a6b8664c6c0c9..4ce6db7facc69 100644 --- a/onnxruntime/test/providers/qnn/pad_op_test.cpp +++ b/onnxruntime/test/providers/qnn/pad_op_test.cpp @@ -10,7 +10,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/pool_op_test.cpp b/onnxruntime/test/providers/qnn/pool_op_test.cpp index 5dd3a6aaa3620..f0ca3557191c7 100644 --- a/onnxruntime/test/providers/qnn/pool_op_test.cpp +++ b/onnxruntime/test/providers/qnn/pool_op_test.cpp @@ -10,7 +10,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/reshape_expand_op_test.cc b/onnxruntime/test/providers/qnn/reshape_expand_op_test.cc index 3964edc11461b..b66547a939983 100644 --- a/onnxruntime/test/providers/qnn/reshape_expand_op_test.cc +++ b/onnxruntime/test/providers/qnn/reshape_expand_op_test.cc @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/resize_test.cc b/onnxruntime/test/providers/qnn/resize_test.cc index 15612e3267a75..651f55bc05d3f 100644 --- a/onnxruntime/test/providers/qnn/resize_test.cc +++ b/onnxruntime/test/providers/qnn/resize_test.cc @@ -9,7 +9,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/split_op_test.cc b/onnxruntime/test/providers/qnn/split_op_test.cc index 6dc721edb421e..23682f7e934c3 100644 --- a/onnxruntime/test/providers/qnn/split_op_test.cc +++ b/onnxruntime/test/providers/qnn/split_op_test.cc @@ -7,7 +7,7 @@ #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/squeeze_unsqueeze_op_test.cc b/onnxruntime/test/providers/qnn/squeeze_unsqueeze_op_test.cc index 33d2f64c0315e..abc1b3a89d85c 100644 --- a/onnxruntime/test/providers/qnn/squeeze_unsqueeze_op_test.cc +++ b/onnxruntime/test/providers/qnn/squeeze_unsqueeze_op_test.cc @@ -7,7 +7,7 @@ #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/tile_op_test.cc b/onnxruntime/test/providers/qnn/tile_op_test.cc index 2b35c730ee5fe..85541efe5646c 100644 --- a/onnxruntime/test/providers/qnn/tile_op_test.cc +++ b/onnxruntime/test/providers/qnn/tile_op_test.cc @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/topk_op_test.cc b/onnxruntime/test/providers/qnn/topk_op_test.cc index 5a9351b9366ec..354a5d1e3b49a 100644 --- a/onnxruntime/test/providers/qnn/topk_op_test.cc +++ b/onnxruntime/test/providers/qnn/topk_op_test.cc @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index e7d93aeabe113..d4dc6c0d349b0 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -471,6 +471,7 @@ def convert_arg_line_to_args(self, arg_line): parser.add_argument( "--use_vcpkg", action="store_true", + default="VCPKG_INSTALLATION_ROOT" in os.environ, help="Use vcpkg to search dependencies. Requires CMAKE_TOOLCHAIN_FILE for vcpkg.cmake", ) @@ -862,7 +863,6 @@ def run_subprocess( my_env["PYTHONPATH"] = python_path my_env.update(env) - log.info(" ".join(args)) return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env) @@ -1122,17 +1122,17 @@ def generate_build_tree( overlay_triplets_dir = None # The enable_address_sanitizer and use_binskim_compliant_compile_flags flags cannot be both enabled if args.enable_address_sanitizer: - overlay_triplets_dir = os.path.join(source_dir, "cmake", "vcpkg_triplets", "asan") + overlay_triplets_dir = os.path.join(source_dir, "cmake", "vcpkg-triplets", "asan") if args.disable_rtti: overlay_triplets_dir += "_nortti" elif args.use_binskim_compliant_compile_flags: - overlay_triplets_dir = os.path.join(source_dir, "cmake", "vcpkg_triplets", "binskim") + overlay_triplets_dir = os.path.join(source_dir, "cmake", "vcpkg-triplets", "binskim") if args.disable_rtti: overlay_triplets_dir += "_nortti" elif args.disable_rtti: - overlay_triplets_dir = os.path.join(source_dir, "cmake", "vcpkg_triplets", "nortti") + overlay_triplets_dir = os.path.join(source_dir, "cmake", "vcpkg-triplets", "nortti") if overlay_triplets_dir is None: - overlay_triplets_dir = os.path.join(source_dir, "cmake", "vcpkg_triplets", "default") + overlay_triplets_dir = os.path.join(source_dir, "cmake", "vcpkg-triplets", "default") vcpkg_install_options.append(f"--overlay-triplets={overlay_triplets_dir}") # VCPKG_INSTALL_OPTIONS is a CMake list. It must be joined by semicolons @@ -1946,7 +1946,12 @@ def run_adb_shell(cmd): context_stack.callback(android.stop_emulator, emulator_proc) adb_push("testdata", device_dir, cwd=cwd) - adb_push(os.path.join(source_dir, "cmake", "external", "onnx", "onnx", "backend", "test"), device_dir, cwd=cwd) + if is_linux() and os.path.exists("/data/onnx"): + adb_push("/data/onnx", device_dir + "/test", cwd=cwd) + else: + test_data_dir = os.path.join(source_dir, "cmake", "external", "onnx", "onnx", "backend", "test") + if os.path.exists(test_data_dir): + adb_push(test_data_dir, device_dir + "/test", cwd=cwd) adb_push("onnxruntime_test_all", device_dir, cwd=cwd) adb_shell(f"chmod +x {device_dir}/onnxruntime_test_all") adb_push("onnx_test_runner", device_dir, cwd=cwd) @@ -2606,9 +2611,25 @@ def main(): print(args) + if args.build_wasm or args.use_webgpu: + # No custom triplet for the wasm builds yet + args.use_vcpkg = False + elif args.minimal_build is not None: + # Minimal build uses a custom ONNX cmake file. Don't know how to deal with it yet + args.use_vcpkg = False + elif args.ios: + args.use_vcpkg = False + elif args.use_extensions: + # ORT extension no longer supports combined build, except for WASM. Due to dependency version conflicts + args.use_vcpkg = False + if os.getenv("ORT_BUILD_WITH_CACHE") == "1": args.use_cache = True + # VCPKG's scripts/toolchains/android.cmake has logic for autodetecting NDK home when the ANDROID_NDK_HOME env is not set, but it is only implemented for Windows + if args.android and args.use_vcpkg and args.android_ndk_path is not None and os.path.exists(args.android_ndk_path): + os.environ["ANDROID_NDK_HOME"] = args.android_ndk_path + if not is_windows(): if not args.allow_running_as_root: is_root_user = os.geteuid() == 0 diff --git a/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml index 59deb0d4975fe..16fe599596f61 100644 --- a/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml @@ -108,11 +108,11 @@ stages: -e BUILD_BUILDNUMBER \ -e CCACHE_DIR=/cache \ $(Repository) \ - /bin/bash -c " + /bin/bash -c ' set -ex; \ env; \ ccache -s; \ - /opt/python/cp310-cp310/bin/python3 /onnxruntime_src/tools/ci_build/build.py \ + PATH=/opt/python/cp310-cp310/bin:$PATH /opt/python/cp310-cp310/bin/python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Release --update --build \ --skip_submodule_sync \ @@ -125,7 +125,7 @@ stages: --use_cache \ --cmake_extra_defines 'CMAKE_CUDA_ARCHITECTURES=75;86' ; \ ccache -sv; \ - ccache -z" + ccache -z' workingDirectory: $(Build.SourcesDirectory) - task: CmdLine@2 diff --git a/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml index dc57fd41fa5f9..f7ad1e154f562 100644 --- a/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml @@ -77,10 +77,9 @@ stages: -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ onnxruntimecpubuildcentos8x64 \ - /bin/bash -c ' - set -ex; \ + /bin/bash -c 'set -ex; \ python3 /onnxruntime_src/tools/ci_build/build.py \ - --build_dir /build --cmake_generator 'Ninja' \ + --build_dir /build --cmake_generator Ninja \ --config Debug \ --skip_submodule_sync \ --build_shared_lib \ @@ -88,7 +87,7 @@ stages: --enable_onnx_tests --enable_address_sanitizer \ --update --build; python3 /onnxruntime_src/tools/ci_build/build.py \ - --build_dir /build --cmake_generator 'Ninja' \ + --build_dir /build --cmake_generator Ninja \ --config Debug \ --skip_submodule_sync \ --build_shared_lib \ @@ -208,11 +207,11 @@ stages: -e BUILD_BUILDNUMBER \ -e CCACHE_DIR=/cache \ onnxruntimecpubuild \ - /bin/bash -c " + /bin/bash -c ' set -ex; \ ccache -s; \ - /opt/python/cp310-cp310/bin/python3 /onnxruntime_src/tools/ci_build/build.py \ - --build_dir /build --cmake_generator 'Ninja' \ + PATH=/opt/python/cp310-cp310/bin:$PATH python /onnxruntime_src/tools/ci_build/build.py \ + --build_dir /build --cmake_generator Ninja \ --config Release \ --skip_submodule_sync \ --build_shared_lib \ @@ -224,7 +223,7 @@ stages: --use_cache \ --update --build --cmake_extra_defines onnxruntime_BUILD_BENCHMARKS=ON; \ ccache -sv; \ - ccache -z" + ccache -z' workingDirectory: $(Build.SourcesDirectory) - script: | diff --git a/tools/ci_build/github/azure-pipelines/linux-dnnl-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-dnnl-ci-pipeline.yml index 304cb65791601..b9940045c009e 100644 --- a/tools/ci_build/github/azure-pipelines/linux-dnnl-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-dnnl-ci-pipeline.yml @@ -62,7 +62,7 @@ jobs: -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ onnxruntimecpubuild \ - /opt/python/cp310-cp310/bin/python3.10 /onnxruntime_src/tools/ci_build/build.py \ + bash -c 'PATH=/opt/python/cp310-cp310/bin:$PATH python /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build \ --config Debug Release \ --skip_submodule_sync \ @@ -71,7 +71,7 @@ jobs: --enable_pybind \ --enable_onnx_tests \ --build_java \ - --use_dnnl + --use_dnnl' workingDirectory: $(Build.SourcesDirectory) - task: PublishTestResults@2 diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml index 8f15c83e0251e..17515f78c1666 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml @@ -74,12 +74,6 @@ stages: inputs: versionSpec: '20.x' - - task: onebranch.pipeline.tsaoptions@1 - displayName: 'OneBranch TSAOptions' - inputs: - tsaConfigFilePath: '$(Build.SourcesDirectory)\.config\tsaoptions.json' - appendSourceBranchName: false - - task: UsePythonVersion@0 inputs: versionSpec: '3.12' @@ -100,18 +94,14 @@ stages: env: PROCESSOR_ARCHITECTURE: ${{ parameters.BuildArch }} - - task: PowerShell@2 - displayName: 'Install ONNX' - inputs: - filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' - workingDirectory: '$(Build.BinariesDirectory)' - arguments: -cpu_arch ${{ parameters.BuildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config $(BuildConfig) + + - script: python -m pip install -r $(Build.SourcesDirectory)\tools\ci_build\github\linux\python\requirements.txt - task: PythonScript@0 displayName: 'Generate cmake config' inputs: scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py' - arguments: '$(BuildCommand) --use_binskim_compliant_compile_flags --parallel --path_to_protoc_exe $(Build.BinariesDirectory)\installed\bin\protoc.exe --build_csharp --update --config $(BuildConfig) ${{ variables.build_py_lto_flag }}' + arguments: '$(BuildCommand) --use_binskim_compliant_compile_flags --parallel --build_csharp --update --config $(BuildConfig) ${{ variables.build_py_lto_flag }}' workingDirectory: '$(Build.BinariesDirectory)' - ${{ if notIn(parameters['sln_platform'], 'Win32', 'x64') }}: diff --git a/tools/ci_build/github/azure-pipelines/post-merge-jobs.yml b/tools/ci_build/github/azure-pipelines/post-merge-jobs.yml index 7dc6ec5747acf..c145e4f98f28b 100644 --- a/tools/ci_build/github/azure-pipelines/post-merge-jobs.yml +++ b/tools/ci_build/github/azure-pipelines/post-merge-jobs.yml @@ -59,7 +59,7 @@ stages: buildArch: x64 msbuildPlatform: arm64 packageName: arm64 - buildparameter: --build_nodejs --arm64 --enable_onnx_tests --path_to_protoc_exe $(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe + buildparameter: --build_nodejs --arm64 --enable_onnx_tests runTests: false buildJava: false buildNodejs: true @@ -73,7 +73,7 @@ stages: buildArch: x64 msbuildPlatform: ARM64EC packageName: arm64ec - buildparameter: --arm64ec --enable_onnx_tests --path_to_protoc_exe $(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe + buildparameter: --arm64ec --enable_onnx_tests runTests: false buildJava: false buildNodejs: false @@ -117,7 +117,7 @@ stages: buildArch: x64 msbuildPlatform: arm64 packageName: arm64 - buildparameter: --build_nodejs --enable_wcos --arm64 --enable_onnx_tests --path_to_protoc_exe $(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe + buildparameter: --build_nodejs --enable_wcos --arm64 --enable_onnx_tests runTests: false buildJava: false buildNodejs: true @@ -132,7 +132,7 @@ stages: buildArch: x64 msbuildPlatform: ARM64EC packageName: arm64ec - buildparameter: --enable_wcos --arm64ec --enable_onnx_tests --path_to_protoc_exe $(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe + buildparameter: --enable_wcos --arm64ec --enable_onnx_tests runTests: false buildJava: false buildNodejs: false @@ -177,7 +177,7 @@ stages: buildArch: x64 msbuildPlatform: arm64 packageName: arm64 - buildparameter: --build_nodejs --arm64 --use_extensions --enable_onnx_tests --path_to_protoc_exe $(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe + buildparameter: --build_nodejs --arm64 --use_extensions --enable_onnx_tests runTests: false buildJava: false buildNodejs: true @@ -192,7 +192,7 @@ stages: # buildArch: x64 # msbuildPlatform: ARM64EC # packageName: arm64ec -# buildparameter: --arm64ec --use_extensions --enable_onnx_tests --path_to_protoc_exe $(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe +# buildparameter: --arm64ec --use_extensions --enable_onnx_tests # runTests: false # buildJava: false # buildNodejs: false diff --git a/tools/ci_build/github/azure-pipelines/stages/py-cpu-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/py-cpu-packaging-stage.yml index c93194240564a..c917316595cbe 100644 --- a/tools/ci_build/github/azure-pipelines/stages/py-cpu-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/py-cpu-packaging-stage.yml @@ -137,24 +137,10 @@ stages: modifyEnvironment: true workingFolder: '$(Build.BinariesDirectory)' - - template: ../templates/download-deps.yml - - - task: PythonScript@0 - displayName: 'Update deps.txt' - inputs: - scriptPath: $(Build.SourcesDirectory)/tools/ci_build/replace_urls_in_deps.py - arguments: --new_dir $(Build.BinariesDirectory)/deps - workingDirectory: $(Build.BinariesDirectory) - - - task: PowerShell@2 - displayName: 'Install ONNX' - inputs: - filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' - workingDirectory: '$(Build.BinariesDirectory)' - arguments: -cpu_arch $(buildArch) -install_prefix $(Build.BinariesDirectory)\${{ parameters.cmake_build_type }}\installed -build_config ${{ parameters.cmake_build_type }} + - script: python -m pip install -r $(Build.SourcesDirectory)\tools\ci_build\github\linux\python\requirements.txt - task: PythonScript@0 - displayName: 'Generate cmake config' + displayName: 'Build' inputs: scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py' arguments: > diff --git a/tools/ci_build/github/azure-pipelines/stages/py-win-gpu-stage.yml b/tools/ci_build/github/azure-pipelines/stages/py-win-gpu-stage.yml index caa733d8b9ee1..167055ac2414a 100644 --- a/tools/ci_build/github/azure-pipelines/stages/py-win-gpu-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/py-win-gpu-stage.yml @@ -199,14 +199,9 @@ stages: DownloadCUDA: true DownloadTRT: ${{ parameters.use_tensorrt }} - - task: PowerShell@2 - displayName: 'Install ONNX' - inputs: - filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' - workingDirectory: '$(Build.BinariesDirectory)' - arguments: -cpu_arch x64 -install_prefix $(Build.BinariesDirectory)\${{ parameters.cmake_build_type }}\installed -build_config ${{ parameters.cmake_build_type }} - powershell: | + python -m pip install -r $(Build.SourcesDirectory)\tools\ci_build\github\linux\python\requirements.txt python -m pip uninstall -y onnxruntime onnxruntime-gpu -qq Get-ChildItem -Path $(Build.ArtifactStagingDirectory)/*cp${{ replace(parameters.PYTHON_VERSION,'.','') }}*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname tabulate} mkdir -p $(Agent.TempDirectory)\ort_test_data diff --git a/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml b/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml index 98206bcb690c0..de56bd3cec903 100644 --- a/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml @@ -187,7 +187,7 @@ stages: buildArch: x64 msbuildPlatform: arm64 packageName: arm64 - buildparameter: --build_nodejs --arm64 ${{ parameters.AdditionalBuildFlags }} ${{ parameters.AdditionalWinBuildFlags}} --path_to_protoc_exe $(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe + buildparameter: --build_nodejs --arm64 ${{ parameters.AdditionalBuildFlags }} ${{ parameters.AdditionalWinBuildFlags}} runTests: false buildJava: false buildNodejs: true diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-prebuild-steps.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-prebuild-steps.yml index a8a5f13b1f73f..2e08f81b5b8f7 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-prebuild-steps.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-prebuild-steps.yml @@ -74,18 +74,10 @@ steps: workingFolder: '$(Build.BinariesDirectory)' - script: | - python -m pip install --upgrade "setuptools>=68.2.2" wheel numpy flatbuffers + python -m pip install -r $(Build.SourcesDirectory)\tools\ci_build\github\linux\python\requirements.txt workingDirectory: '$(Build.BinariesDirectory)' displayName: 'Install python modules' -- template: ../download-deps.yml - -- task: PythonScript@0 - displayName: 'Update deps.txt' - inputs: - scriptPath: $(Build.SourcesDirectory)/tools/ci_build/replace_urls_in_deps.py - arguments: --new_dir $(Build.BinariesDirectory)/deps - workingDirectory: $(Build.BinariesDirectory) - template: set-winenv.yml parameters: @@ -115,35 +107,3 @@ steps: displayName: Install ccache and update PATH to use linked versions of gcc, cc, etc -- ${{ if eq(parameters.InstallONNX, true) }}: - - ${{ if eq(parameters.WITHCACHE, true) }}: - - task: Cache@2 - # machinepool is used to ensure the compiler is same - inputs: - key: '"$(TODAY)" | ${{ parameters.buildArch }} | ${{ parameters.BuildConfig }} | ${{ parameters.MachinePool }} | $(Build.SourcesDirectory)/cmake/deps.txt, $(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1, $(Build.SourcesDirectory)/tools/ci_build/github/windows/helpers.ps1' - path: $(Agent.TempDirectory)/deps_ccache - restoreKeys: | - "$(TODAY)" | ${{ parameters.buildArch }} | ${{ parameters.BuildConfig }} | ${{ parameters.MachinePool }} - displayName: Cache Task - - - task: PowerShell@2 - displayName: 'Install ONNX' - inputs: - filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' - workingDirectory: '$(Build.BinariesDirectory)' - ${{ if eq(parameters.WITHCACHE, true) }}: - arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config ${{ parameters.BuildConfig }} -use_cache - ${{ else }}: - arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config ${{ parameters.BuildConfig }} - ${{ if eq(parameters.WITHCACHE, true) }}: - env: - CCACHE_DIR: $(Agent.TempDirectory)/deps_ccache - CCACHE_COMPILERCHECK: content - - - ${{ if eq(parameters.WITHCACHE, true) }}: - - powershell: | - ccache -sv - ccache -z - displayName: cache stat - env: - CCACHE_DIR: $(Agent.TempDirectory)/deps_ccache diff --git a/tools/ci_build/github/azure-pipelines/templates/ondevice-training-cpu-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/templates/ondevice-training-cpu-packaging-pipeline.yml index 8bbe8f82530ea..c5a1e8d8db284 100644 --- a/tools/ci_build/github/azure-pipelines/templates/ondevice-training-cpu-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/templates/ondevice-training-cpu-packaging-pipeline.yml @@ -70,7 +70,7 @@ stages: buildArch: x64 msbuildPlatform: arm64 packageName: arm64 - buildparameter: --arm64 ${{ parameters.AdditionalBuildFlags }} ${{ parameters.AdditionalWinBuildFlags}} --path_to_protoc_exe $(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe + buildparameter: --arm64 ${{ parameters.AdditionalBuildFlags }} ${{ parameters.AdditionalWinBuildFlags}} runTests: false buildJava: false buildNodejs: false diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-arm64ec-qnn.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-arm64ec-qnn.yml index 8595a52cdef2b..2ff0277bc9ff9 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-arm64ec-qnn.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-arm64ec-qnn.yml @@ -59,23 +59,10 @@ jobs: displayName: 'OneBranch TSAOptions' inputs: tsaConfigFilePath: '$(Build.SourcesDirectory)\.config\tsaoptions.json' - appendSourceBranchName: false + appendSourceBranchName: fals - - template: download-deps.yml + - script: python -m pip install -r $(Build.SourcesDirectory)\tools\ci_build\github\linux\python\requirements.txt - - task: PythonScript@0 - displayName: 'Update deps.txt' - inputs: - scriptPath: $(Build.SourcesDirectory)/tools/ci_build/replace_urls_in_deps.py - arguments: --new_dir $(Build.BinariesDirectory)/deps - workingDirectory: $(Build.BinariesDirectory) - - - task: PowerShell@2 - displayName: 'Install ONNX' - inputs: - filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' - workingDirectory: '$(Build.BinariesDirectory)' - arguments: -cpu_arch x64 -install_prefix $(Build.BinariesDirectory)\RelWithDebInfo\installed -build_config RelWithDebInfo - template: set-nightly-build-option-variable-step.yml diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-x64-qnn.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-x64-qnn.yml index 979961d06654f..e6acce77ccd91 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-x64-qnn.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-x64-qnn.yml @@ -55,28 +55,8 @@ jobs: inputs: artifactFeeds: 'Lotus' - - task: onebranch.pipeline.tsaoptions@1 - displayName: 'OneBranch TSAOptions' - inputs: - tsaConfigFilePath: '$(Build.SourcesDirectory)\.config\tsaoptions.json' - appendSourceBranchName: false - - - template: download-deps.yml - - - task: PythonScript@0 - displayName: 'Update deps.txt' - inputs: - scriptPath: $(Build.SourcesDirectory)/tools/ci_build/replace_urls_in_deps.py - arguments: --new_dir $(Build.BinariesDirectory)/deps - workingDirectory: $(Build.BinariesDirectory) - - - task: PowerShell@2 - displayName: 'Install ONNX' - inputs: - filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' - workingDirectory: '$(Build.BinariesDirectory)' - arguments: -cpu_arch x64 -install_prefix $(Build.BinariesDirectory)\RelWithDebInfo\installed -build_config RelWithDebInfo - + - script: python -m pip install -r $(Build.SourcesDirectory)\tools\ci_build\github\linux\python\requirements.txt + - template: set-nightly-build-option-variable-step.yml - template: jobs/download_win_qnn_sdk.yml diff --git a/tools/ci_build/github/azure-pipelines/templates/set-python-manylinux-variables-step.yml b/tools/ci_build/github/azure-pipelines/templates/set-python-manylinux-variables-step.yml index 585a78c17e042..b2914ce6872dd 100644 --- a/tools/ci_build/github/azure-pipelines/templates/set-python-manylinux-variables-step.yml +++ b/tools/ci_build/github/azure-pipelines/templates/set-python-manylinux-variables-step.yml @@ -10,20 +10,7 @@ steps: script: | version = "$(PythonVersion)" - - if version == "3.7": - variables = { - "PythonManylinuxDir": "/opt/python/cp37-cp37m" - } - elif version == "3.8": - variables = { - "PythonManylinuxDir": "/opt/python/cp38-cp38" - } - elif version == "3.9": - variables = { - "PythonManylinuxDir": "/opt/python/cp39-cp39" - } - elif version == "3.10": + if version == "3.10": variables = { "PythonManylinuxDir": "/opt/python/cp310-cp310" } diff --git a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml index ced4bd14c3bed..954c7d2333c01 100644 --- a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml @@ -159,22 +159,10 @@ stages: - template: download-deps.yml - - task: PythonScript@0 - displayName: 'Update deps.txt' - inputs: - scriptPath: $(Build.SourcesDirectory)/tools/ci_build/replace_urls_in_deps.py - arguments: --new_dir $(Build.BinariesDirectory)/deps - workingDirectory: $(Build.BinariesDirectory) - - - task: PowerShell@2 - displayName: 'Install ONNX' - inputs: - filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' - workingDirectory: '$(Build.BinariesDirectory)' - arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\RelWithDebInfo\installed -build_config RelWithDebInfo - - template: set-version-number-variables-step.yml + - script: python -m pip install -r $(Build.SourcesDirectory)\tools\ci_build\github\linux\python\requirements.txt + - task: PythonScript@0 displayName: 'Generate cmake config' inputs: diff --git a/tools/ci_build/github/linux/build_cuda_ci.sh b/tools/ci_build/github/linux/build_cuda_ci.sh index fbf69d268a033..d74907afdcf1d 100755 --- a/tools/ci_build/github/linux/build_cuda_ci.sh +++ b/tools/ci_build/github/linux/build_cuda_ci.sh @@ -39,7 +39,7 @@ if [ -x "$(command -v ccache)" ]; then #BUILD_ARGS+=("--use_cache") fi if [ -f /opt/python/cp312-cp312/bin/python3 ]; then - /opt/python/cp312-cp312/bin/python3 tools/ci_build/build.py "${BUILD_ARGS[@]}" + PATH=/opt/python/cp312-cp312/bin:$PATH python tools/ci_build/build.py "${BUILD_ARGS[@]}" else python3 tools/ci_build/build.py "${BUILD_ARGS[@]}" fi diff --git a/tools/ci_build/github/linux/build_tensorrt_ci.sh b/tools/ci_build/github/linux/build_tensorrt_ci.sh index ccf7a6f4ea630..ef666c902cff4 100755 --- a/tools/ci_build/github/linux/build_tensorrt_ci.sh +++ b/tools/ci_build/github/linux/build_tensorrt_ci.sh @@ -49,7 +49,7 @@ if [ -x "$(command -v ccache)" ]; then BUILD_ARGS+=("--use_cache") fi if [ -f /opt/python/cp312-cp312/bin/python3 ]; then - /opt/python/cp312-cp312/bin/python3 tools/ci_build/build.py "${BUILD_ARGS[@]}" + PATH=/opt/python/cp312-cp312/bin:$PATH /opt/python/cp312-cp312/bin/python3 tools/ci_build/build.py "${BUILD_ARGS[@]}" else python3 tools/ci_build/build.py "${BUILD_ARGS[@]}" fi diff --git a/tools/ci_build/github/linux/docker/scripts/install_python_deps.sh b/tools/ci_build/github/linux/docker/scripts/install_python_deps.sh index 2d7acd1f701ff..8678302d6244d 100755 --- a/tools/ci_build/github/linux/docker/scripts/install_python_deps.sh +++ b/tools/ci_build/github/linux/docker/scripts/install_python_deps.sh @@ -32,14 +32,6 @@ if [[ $USE_CONDA = true ]]; then # so, /home/onnxruntimedev/miniconda3/bin/python should point # to the correct version of the python version PYTHON_EXE="/home/onnxruntimedev/miniconda3/bin/python" -elif [[ "$PYTHON_VER" = "3.6" && -d "/opt/python/cp36-cp36m" ]]; then - PYTHON_EXE="/opt/python/cp36-cp36m/bin/python3.6" -elif [[ "$PYTHON_VER" = "3.7" && -d "/opt/python/cp37-cp37m" ]]; then - PYTHON_EXE="/opt/python/cp37-cp37m/bin/python3.7" -elif [[ "$PYTHON_VER" = "3.8" && -d "/opt/python/cp38-cp38" ]]; then - PYTHON_EXE="/opt/python/cp38-cp38/bin/python3.8" -elif [[ "$PYTHON_VER" = "3.9" && -d "/opt/python/cp39-cp39" ]]; then - PYTHON_EXE="/opt/python/cp39-cp39/bin/python3.9" elif [[ "$PYTHON_VER" = "3.10" && -d "/opt/python/cp310-cp310" ]]; then PYTHON_EXE="/opt/python/cp310-cp310/bin/python3.10" elif [[ "$PYTHON_VER" = "3.11" && -d "/opt/python/cp311-cp311" ]]; then diff --git a/tools/ci_build/github/linux/run_dockerbuild.sh b/tools/ci_build/github/linux/run_dockerbuild.sh index 6618810c77f6d..fa066022c7b7f 100755 --- a/tools/ci_build/github/linux/run_dockerbuild.sh +++ b/tools/ci_build/github/linux/run_dockerbuild.sh @@ -25,7 +25,7 @@ in o) BUILD_OS=${OPTARG};; #gpu, tensorrt or openvino. It is ignored when BUILD_OS is yocto. d) BUILD_DEVICE=${OPTARG};; -#python version: 3.8 3.9 3.10 3.11 3.12 (absence means default 3.8) +#python version: 3.8 3.9 3.10 3.11 3.12 (absence means default 3.10) p) PYTHON_VER=${OPTARG};; # "--build_wheel --use_openblas" x) BUILD_EXTR_PAR=${OPTARG};; @@ -46,7 +46,7 @@ done # shellcheck disable=SC2034 EXIT_CODE=1 -DEFAULT_PYTHON_VER="3.8" +DEFAULT_PYTHON_VER="3.10" PYTHON_VER=${PYTHON_VER:=$DEFAULT_PYTHON_VER} echo "bo=$BUILD_OS bd=$BUILD_DEVICE bdir=$BUILD_DIR pv=$PYTHON_VER bex=$BUILD_EXTR_PAR" diff --git a/tools/ci_build/github/windows/helpers.ps1 b/tools/ci_build/github/windows/helpers.ps1 deleted file mode 100644 index 929418029e442..0000000000000 --- a/tools/ci_build/github/windows/helpers.ps1 +++ /dev/null @@ -1,705 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -enum CMakeBuildType{ - Debug - Release - RelWithDebInfo - MinSizeRel -} - - -# The DownloadAndExtract function was copied from: https://github.com/dotnet/arcade/blob/main/eng/common/native/CommonLibrary.psm1 -<# -.SYNOPSIS -Get the name of a temporary folder under the native install directory -#> -function Get-TempDirectory { - #TODO: what if the env does not exist? - if (-not [string]::IsNullOrWhitespace($Env:AGENT_TEMPDIRECTORY)){ - return $Env:AGENT_TEMPDIRECTORY - } else { - return $Env:TEMP - } -} - -function Get-TempPathFilename { - [CmdletBinding(PositionalBinding=$false)] - Param ( - [Parameter(Mandatory=$True)] - [string] $Path - ) - $TempDir = Get-TempDirectory - $TempFilename = Split-Path $Path -leaf - $TempPath = Join-Path $TempDir $TempFilename - return $TempPath -} - -<# -.SYNOPSIS -Unzip an archive -.DESCRIPTION -Powershell module to unzip an archive to a specified directory -.PARAMETER ZipPath (Required) -Path to archive to unzip -.PARAMETER OutputDirectory (Required) -Output directory for archive contents -.PARAMETER Force -Overwrite output directory contents if they already exist -.NOTES -- Returns True and does not perform an extraction if output directory already exists but Overwrite is not True. -- Returns True if unzip operation is successful -- Returns False if Overwrite is True and it is unable to remove contents of OutputDirectory -- Returns False if unable to extract zip archive -#> -function Expand-Zip { - [CmdletBinding(PositionalBinding=$false)] - Param ( - [Parameter(Mandatory=$True)] - [string] $ZipPath, - [Parameter(Mandatory=$True)] - [string] $OutputDirectory, - [switch] $Force - ) - if ([string]::IsNullOrWhitespace($OutputDirectory)){ - Write-Error "OutputDirectory cannot be empty" - } - Write-Host "Extracting '$ZipPath' to '$OutputDirectory'" - try { - if ((Test-Path $OutputDirectory) -And (-Not $Force)) { - Write-Host "Directory '$OutputDirectory' already exists, skipping extract" - return $True - } - if (Test-Path $OutputDirectory) { - Write-Host "'Force' is 'True', but '$OutputDirectory' exists, removing directory" - Remove-Item -Path $OutputDirectory -Force -Recurse - if ($? -Eq $False) { - Write-Error "Unable to remove '$OutputDirectory'" - return $False - } - } - - $TempOutputDirectory = Join-Path "$(Split-Path -Parent $OutputDirectory)" "$(Split-Path -Leaf $OutputDirectory).tmp" - - if (Test-Path $TempOutputDirectory) { - Remove-Item $TempOutputDirectory -Force -Recurse - } - New-Item -Path $TempOutputDirectory -Force -ItemType "Directory" | Out-Null - - Add-Type -assembly "system.io.compression.filesystem" - [io.compression.zipfile]::ExtractToDirectory("$ZipPath", "$TempOutputDirectory") - if ($? -Eq $False) { - Write-Error "Unable to extract '$ZipPath'" - return $False - } - - Move-Item -Path $TempOutputDirectory -Destination $OutputDirectory - } - catch { - Write-Host $_ - Write-Host $_.Exception - - return $False - } - return $True -} - -<# -.SYNOPSIS -Helper module to install an archive to a directory -.DESCRIPTION -Helper module to download and extract an archive to a specified directory -.PARAMETER Uri -Uri of artifact to download -.PARAMETER InstallDirectory -Directory to extract artifact contents to. -.PARAMETER Force -Force download / extraction if file or contents already exist. Default = False -.PARAMETER DownloadRetries -Total number of retry attempts. Default = 5 -.PARAMETER RetryWaitTimeInSeconds -Wait time between retry attempts in seconds. Default = 30 -.NOTES -Returns False if download or extraction fail, True otherwise -#> -function DownloadAndExtract { - [CmdletBinding(PositionalBinding=$false)] - Param ( - [Parameter(Mandatory=$True)] - [string] $Uri, - [Parameter(Mandatory=$True)] - [string] $InstallDirectory, - [switch] $Force = $False, - [int] $DownloadRetries = 5, - [int] $RetryWaitTimeInSeconds = 30 - ) - # Define verbose switch if undefined - $Verbose = $VerbosePreference -Eq "Continue" - - $TempToolPath = Get-TempPathFilename -Path $Uri - Write-Host "TempToolPath=$TempToolPath" - # Download native tool - $DownloadStatus = Get-File -Uri $Uri ` - -Path $TempToolPath ` - -DownloadRetries $DownloadRetries ` - -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` - -Force:$Force ` - -Verbose:$Verbose - - if ($DownloadStatus -Eq $False) { - Write-Error "Download failed from $Uri" - return $False - } - - - # Extract native tool - $UnzipStatus = Expand-Zip -ZipPath $TempToolPath ` - -OutputDirectory $InstallDirectory ` - -Force:$Force ` - -Verbose:$Verbose - if ($UnzipStatus -Eq $False) { - # Retry Download one more time with Force=true - $DownloadRetryStatus = Get-File -Uri $Uri ` - -Path $TempToolPath ` - -DownloadRetries 1 ` - -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` - -Force:$True ` - -Verbose:$Verbose - - if ($DownloadRetryStatus -Eq $False) { - Write-Error "Last attempt of download failed as well" - return $False - } - - # Retry unzip again one more time with Force=true - $UnzipRetryStatus = Expand-Zip -ZipPath $TempToolPath ` - -OutputDirectory $InstallDirectory ` - -Force:$True ` - -Verbose:$Verbose - if ($UnzipRetryStatus -Eq $False) - { - Write-Error "Last attempt of unzip failed as well" - # Clean up partial zips and extracts - if (Test-Path $TempToolPath) { - Remove-Item $TempToolPath -Force - } - if (Test-Path $InstallDirectory) { - Remove-Item $InstallDirectory -Force -Recurse - } - return $False - } - } - - return $True -} - -<# -.SYNOPSIS -Download a file, retry on failure -.DESCRIPTION -Download specified file and retry if attempt fails -.PARAMETER Uri -Uri of file to download. If Uri is a local path, the file will be copied instead of downloaded -.PARAMETER Path -Path to download or copy uri file to -.PARAMETER Force -Overwrite existing file if present. Default = False -.PARAMETER DownloadRetries -Total number of retry attempts. Default = 5 -.PARAMETER RetryWaitTimeInSeconds -Wait time between retry attempts in seconds Default = 30 -#> -function Get-File { - [CmdletBinding(PositionalBinding=$false)] - Param ( - [Parameter(Mandatory=$True)] - [string] $Uri, - [Parameter(Mandatory=$True)] - [string] $Path, - [int] $DownloadRetries = 5, - [int] $RetryWaitTimeInSeconds = 30, - [switch] $Force = $False - ) - $Attempt = 0 - - if ($Force) { - if (Test-Path $Path) { - Remove-Item $Path -Force - } - } - if (Test-Path $Path) { - Write-Host "File '$Path' already exists, skipping download" - return $True - } - - $DownloadDirectory = Split-Path -ErrorAction Ignore -Path "$Path" -Parent - if (-Not (Test-Path $DownloadDirectory)) { - New-Item -path $DownloadDirectory -force -itemType "Directory" | Out-Null - } - - $TempPath = "$Path.tmp" - if (Test-Path -IsValid -Path $Uri) { - Write-Verbose "'$Uri' is a file path, copying temporarily to '$TempPath'" - Copy-Item -Path $Uri -Destination $TempPath - Write-Verbose "Moving temporary file to '$Path'" - Move-Item -Path $TempPath -Destination $Path - return $? - } - else { - # Don't display the console progress UI - it's a huge perf hit - $ProgressPreference = 'SilentlyContinue' - while($Attempt -Lt $DownloadRetries) - { - try { - Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $TempPath - Write-Verbose "Downloaded to temporary location '$TempPath'" - Move-Item -Path $TempPath -Destination $Path - Write-Verbose "Moved temporary file to '$Path'" - return $True - } - catch { - $Attempt++ - if ($Attempt -Lt $DownloadRetries) { - $AttemptsLeft = $DownloadRetries - $Attempt - Write-Warning "Download failed, $AttemptsLeft attempts remaining, will retry in $RetryWaitTimeInSeconds seconds" - Start-Sleep -Seconds $RetryWaitTimeInSeconds - } - else { - Write-Error $_ - Write-Error $_.Exception - } - } - } - } - - return $False -} - -<# - .Description - The Get-DownloadURL function returns the download URL of a external dependency. The URL might be local file path or - a remote HTTPS URL. - - .PARAMETER name - The name of the dependency, should present in the first column of ONNX Runtime's deps.txt. - - .PARAMETER src_root - The full path of ONNX Runtime's top level source diretory for locating deps.txt. -#> - -function Get-DownloadURL { - param ( - [Parameter(Mandatory)][string]$name, - [Parameter(Mandatory)][string]$src_root - ) - $entry = Import-Csv -Path "$src_root\cmake\deps.txt" -Delimiter ';' -Header name,url,hash -Encoding UTF8 | Where-Object name -eq $name - return $entry.url -} - -<# - .Description - The Install-Pybind function installs pybind11 headers, which are needed for building ONNX from source. - - .PARAMETER cmake_path - The full path of cmake.exe - - .PARAMETER src_root - The full path of ONNX Runtime's top level source diretory for locating deps.txt. - - .PARAMETER build_config - The value of CMAKE_BUILD_TYPE, can be Debug, Release, RelWithDebInfo or MinSizeRel. -#> - -function Install-Pybind { - - param ( - [Parameter(Mandatory)][string]$cmake_path, - [Parameter(Mandatory)][string]$msbuild_path, - [Parameter(Mandatory)][string]$cpu_arch, - [Parameter(Mandatory)][string]$src_root, - [Parameter(Mandatory)][CMakeBuildType]$build_config, - [Parameter(Mandatory)][string[]]$cmake_extra_args - ) - - pushd . - - $url=Get-DownloadURL -name pybind11 -src_root $src_root - Write-Host "Downloading pybind11 from $url" - $temp_dir = Get-TempDirectory - $pybind_src_dir = Join-Path $temp_dir "pybind" - $download_finished = DownloadAndExtract -Uri $url -InstallDirectory $pybind_src_dir -Force - if(-Not $download_finished){ - Write-Host -Object "Download failed" - exit 1 - } - cd $pybind_src_dir - cd * - mkdir build - cd build - [string[]]$cmake_args = "..", "-DCMAKE_INSTALL_PREFIX=$install_prefix", "-DBUILD_TESTING=OFF" - $cmake_args += $cmake_extra_args - &$cmake_path $cmake_args - if ($lastExitCode -ne 0) { - Write-Host -Object "CMake command failed. Exitcode: $exitCode" - exit $lastExitCode - } - - $msbuild_args = "-nodeReuse:false", "-nologo", "-nr:false", "-maxcpucount", "-p:UseMultiToolTask=true", "-p:configuration=`"$build_config`"" - - if ($use_cache) { - $msbuild_args += "/p:CLToolExe=cl.exe", "/p:CLToolPath=C:\ProgramData\chocolatey\bin", "/p:TrackFileAccess=false", "/p:UseMultiToolTask=true" - } - - if($cpu_arch -eq 'x86'){ - $msbuild_args += "/p:platform=Win32" - } elseif($cpu_arch -eq 'x64') { - $msbuild_args += "/p:platform=x64" - } - - - $final_args = $msbuild_args + "pybind11.sln" - &$msbuild_path $final_args - $final_args = $msbuild_args + "INSTALL.vcxproj" - &$msbuild_path $final_args - - Write-Host "Installing pybind finished." - - popd -} - -<# - .Description - The Install-Abseil function installs Google's abseil library from source. - - .PARAMETER cmake_path - The full path of cmake.exe - - .PARAMETER src_root - The full path of ONNX Runtime's top level source diretory - - .PARAMETER build_config - The value of CMAKE_BUILD_TYPE, can be Debug, Release, RelWithDebInfo or MinSizeRel. -#> -function Install-Abseil { - - param ( - [Parameter(Mandatory)][string]$cmake_path, - [Parameter(Mandatory)][string]$msbuild_path, - [Parameter(Mandatory)][string]$cpu_arch, - [Parameter(Mandatory)][string]$src_root, - [Parameter(Mandatory)][CMakeBuildType]$build_config, - [Parameter(Mandatory)][string[]]$cmake_extra_args - ) - - pushd . - $url=Get-DownloadURL -name abseil_cpp -src_root $src_root - Write-Host "Downloading abseil_cpp from $url" - $temp_dir = Get-TempDirectory - $absl_src_dir = Join-Path $temp_dir "abseil_cpp" - $download_finished = DownloadAndExtract -Uri $url -InstallDirectory $absl_src_dir -Force - if(-Not $download_finished){ - exit 1 - } - cd $absl_src_dir - cd * - - # Search patch.exe - $patch_path = 'C:\Program Files\Git\usr\bin\patch.exe' - if(-not (Test-Path $patch_path -PathType Leaf)){ - $git_command_path = (Get-Command -CommandType Application git)[0].Path - Write-Host "Git command path:$git_command_path" - $git_installation_folder = Split-Path -Path (Split-Path -Path $git_command_path) - $patch_path = Join-Path -Path $git_installation_folder "usr\bin\patch.exe" - } - if(Test-Path $patch_path -PathType Leaf){ - Write-Host "Patching abseil ..." - Get-Content $src_root\cmake\patches\abseil\absl_windows.patch | &$patch_path --ignore-whitespace -p1 - } else { - Write-Host "Skip patching abseil since we cannot find patch.exe at $patch_path" - } - - # Run cmake to generate Visual Studio sln file - [string[]]$cmake_args = ".", "-DABSL_PROPAGATE_CXX_STD=ON", "-DCMAKE_BUILD_TYPE=$build_config", "-DBUILD_TESTING=OFF", "-DABSL_USE_EXTERNAL_GOOGLETEST=ON", "-DCMAKE_INSTALL_PREFIX=$install_prefix" - $cmake_args += $cmake_extra_args - - &$cmake_path $cmake_args - if ($lastExitCode -ne 0) { - Write-Host -Object "CMake command failed. Exitcode: $exitCode" - exit $lastExitCode - } - - $msbuild_args = "-nodeReuse:false", "-nologo", "-nr:false", "-maxcpucount", "-p:UseMultiToolTask=true", "-p:configuration=`"$build_config`"" - - if ($use_cache) { - $msbuild_args += "/p:CLToolExe=cl.exe", "/p:CLToolPath=C:\ProgramData\chocolatey\bin", "/p:TrackFileAccess=false", "/p:UseMultiToolTask=true" - } - - if($cpu_arch -eq 'x86'){ - $msbuild_args += "/p:platform=Win32" - } elseif($cpu_arch -eq 'x64') { - $msbuild_args += "/p:platform=x64" - } - - $final_args = $msbuild_args + "absl.sln" - &$msbuild_path $final_args - if ($lastExitCode -ne 0) { - exit $lastExitCode - } - $final_args = $msbuild_args + "INSTALL.vcxproj" - &$msbuild_path $final_args - if ($lastExitCode -ne 0) { - exit $lastExitCode - } - Write-Host "Installing absl finished." - popd -} - -<# - .Description - The Install-UTF8-Range function installs Google's utf8_range library from source. - utf8_range depends on Abseil. - - .PARAMETER cmake_path - The full path of cmake.exe - - .PARAMETER src_root - The full path of ONNX Runtime's top level source diretory - - .PARAMETER build_config - The value of CMAKE_BUILD_TYPE, can be Debug, Release, RelWithDebInfo or MinSizeRel. -#> -function Install-UTF8-Range { - - param ( - [Parameter(Mandatory)][string]$cmake_path, - [Parameter(Mandatory)][string]$msbuild_path, - [Parameter(Mandatory)][string]$cpu_arch, - [Parameter(Mandatory)][string]$src_root, - [Parameter(Mandatory)][CMakeBuildType]$build_config, - [Parameter(Mandatory)][string[]]$cmake_extra_args - ) - - pushd . - $url=Get-DownloadURL -name utf8_range -src_root $src_root - Write-Host "Downloading utf8_range from $url" - $temp_dir = Get-TempDirectory - $absl_src_dir = Join-Path $temp_dir "utf8_range" - $download_finished = DownloadAndExtract -Uri $url -InstallDirectory $absl_src_dir -Force - if(-Not $download_finished){ - exit 1 - } - cd $absl_src_dir - cd * - - # Run cmake to generate Visual Studio sln file - [string[]]$cmake_args = ".", "-Dutf8_range_ENABLE_TESTS=OFF", "-Dutf8_range_ENABLE_INSTALL=ON", "-DCMAKE_BUILD_TYPE=$build_config", "-DBUILD_TESTING=OFF", "-DCMAKE_INSTALL_PREFIX=$install_prefix" - $cmake_args += $cmake_extra_args - - &$cmake_path $cmake_args - if ($lastExitCode -ne 0) { - Write-Host -Object "CMake command failed. Exitcode: $exitCode" - exit $lastExitCode - } - - $msbuild_args = "-nodeReuse:false", "-nologo", "-nr:false", "-maxcpucount", "-p:UseMultiToolTask=true", "-p:configuration=`"$build_config`"" - - if ($use_cache) { - $msbuild_args += "/p:CLToolExe=cl.exe", "/p:CLToolPath=C:\ProgramData\chocolatey\bin", "/p:TrackFileAccess=false", "/p:UseMultiToolTask=true" - } - - if($cpu_arch -eq 'x86'){ - $msbuild_args += "/p:platform=Win32" - } elseif($cpu_arch -eq 'x64') { - $msbuild_args += "/p:platform=x64" - } - - $final_args = $msbuild_args + "utf8_range.sln" - &$msbuild_path $final_args - if ($lastExitCode -ne 0) { - exit $lastExitCode - } - $final_args = $msbuild_args + "INSTALL.vcxproj" - &$msbuild_path $final_args - if ($lastExitCode -ne 0) { - exit $lastExitCode - } - Write-Host "Installing utf8_range finished." - popd -} - -<# - .Description - The Install-ONNX function installs ONNX python package from source and also the python packages that it depends on. - This script will build protobuf C/C++ lib/exe for the CPU arch of the current build machine, because we need to run - protoc.exe on this machine. - - .PARAMETER cmake_path - The full path of cmake.exe - - .PARAMETER src_root - The full path of ONNX Runtime's top level source diretory - - .PARAMETER build_config - The value of CMAKE_BUILD_TYPE, can be Debug, Release, RelWithDebInfo or MinSizeRel. -#> -function Install-Protobuf { - - param ( - [Parameter(Mandatory)][string]$cmake_path, - [Parameter(Mandatory)][string]$msbuild_path, - [Parameter(Mandatory)][string]$cpu_arch, - [Parameter(Mandatory)][string]$src_root, - [Parameter(Mandatory)][CMakeBuildType]$build_config, - [Parameter(Mandatory)][string[]]$cmake_extra_args - ) - - pushd . - $url=Get-DownloadURL -name protobuf -src_root $src_root - Write-Host "Downloading protobuf from $url" - $temp_dir = Get-TempDirectory - $protobuf_src_dir = Join-Path $temp_dir "protobuf" - $download_finished = DownloadAndExtract -Uri $url -InstallDirectory $protobuf_src_dir -Force - if(-Not $download_finished){ - exit 1 - } - cd $protobuf_src_dir - cd * - # Search patch.exe - $patch_path = 'C:\Program Files\Git\usr\bin\patch.exe' - if(-not (Test-Path $patch_path -PathType Leaf)){ - $git_command_path = (Get-Command -CommandType Application git)[0].Path - Write-Host "Git command path:$git_command_path" - $git_installation_folder = Split-Path -Path (Split-Path -Path $git_command_path) - $patch_path = Join-Path -Path $git_installation_folder "usr\bin\patch.exe" - } - if(Test-Path $patch_path -PathType Leaf){ - Write-Host "Patching protobuf ..." - Get-Content $src_root\cmake\patches\protobuf\protobuf_cmake.patch | &$patch_path --ignore-whitespace -p1 - } else { - Write-Host "Skip patching protobuf since we cannot find patch.exe at $patch_path" - } - - # Run cmake to generate Visual Studio sln file - [string[]]$cmake_args = ".", "-Dprotobuf_DISABLE_RTTI=ON", "-DCMAKE_BUILD_TYPE=$build_config", "-Dprotobuf_BUILD_TESTS=OFF", "-Dprotobuf_USE_EXTERNAL_GTEST=ON", "-DBUILD_SHARED_LIBS=OFF", "-DCMAKE_INSTALL_PREFIX=$install_prefix", "-Dprotobuf_MSVC_STATIC_RUNTIME=OFF", "-Dprotobuf_ABSL_PROVIDER=package" - $cmake_args += $cmake_extra_args - - &$cmake_path $cmake_args - if ($lastExitCode -ne 0) { - Write-Host -Object "CMake command failed. Exitcode: $exitCode" - exit $lastExitCode - } - - $msbuild_args = "-nodeReuse:false", "-nologo", "-nr:false", "-maxcpucount", "-p:UseMultiToolTask=true", "-p:configuration=`"$build_config`"" - if($cpu_arch -eq 'x86'){ - $msbuild_args += "/p:platform=Win32" - } elseif($cpu_arch -eq 'x64') { - $msbuild_args += "/p:platform=x64" - } - - if ($use_cache) { - $msbuild_args += "/p:CLToolExe=cl.exe", "/p:CLToolPath=C:\ProgramData\chocolatey\bin", "/p:TrackFileAccess=false", "/p:UseMultiToolTask=true" - } - - $final_args = $msbuild_args + "protobuf.sln" - &$msbuild_path $final_args - if ($lastExitCode -ne 0) { - exit $lastExitCode - } - $final_args = $msbuild_args + "INSTALL.vcxproj" - &$msbuild_path $final_args - if ($lastExitCode -ne 0) { - exit $lastExitCode - } - Write-Host "Installing protobuf finished." - popd -} - -<# - .Description - The Install-ONNX function installs ONNX python package from source and also the python packages that it depends on. - protoc.exe must exist in the PATH. -#> -function Install-ONNX { - - param ( - [Parameter(Mandatory)][CMakeBuildType]$build_config, - [Parameter(Mandatory)][string]$src_root, - [Parameter(Mandatory)][string]$protobuf_version - ) - - pushd . - - Write-Host "Uninstalling onnx and ignore errors if there is any..." - [string[]]$pip_args ="-m", "pip", "uninstall", "-y", "onnx", "-qq" - &"python.exe" $pip_args - if ($lastExitCode -ne 0) { - exit $lastExitCode - } - $temp_dir = Get-TempDirectory - $new_requirements_text_file = Join-Path $temp_dir "new_requirements.txt" - Write-Host "Installing python packages..." - Get-Content "$src_root\tools\ci_build\github\linux\python\requirements.txt" | Select-String -pattern 'onnx' -notmatch | Out-File $new_requirements_text_file - - [string[]]$pip_args = "-m", "pip", "install", "-qq", "--disable-pip-version-check", "-r", $new_requirements_text_file - &"python.exe" $pip_args - if ($lastExitCode -ne 0) { - exit $lastExitCode - } - - $url=Get-DownloadURL -name onnx -src_root $src_root - $onnx_src_dir = Join-Path $temp_dir "onnx" - $download_finished = DownloadAndExtract -Uri $url -InstallDirectory $onnx_src_dir -Force - if(-Not $download_finished){ - exit 1 - } - cd $onnx_src_dir - cd * - - # Search patch.exe - $patch_path = 'C:\Program Files\Git\usr\bin\patch.exe' - if(-not (Test-Path $patch_path -PathType Leaf)){ - $git_command_path = (Get-Command -CommandType Application git)[0].Path - Write-Host "Git command path:$git_command_path" - $git_installation_folder = Split-Path -Path (Split-Path -Path $git_command_path) - $patch_path = Join-Path -Path $git_installation_folder "usr\bin\patch.exe" - } - if(Test-Path $patch_path -PathType Leaf){ - Write-Host "Patching onnx ..." - Get-Content $src_root\cmake\patches\onnx\onnx.patch | &$patch_path --ignore-whitespace -p1 - } else { - Write-Host "Skip patching onnx since we cannot find patch.exe at $patch_path" - } - - [String]$requirements_txt_content = "protobuf==$protobuf_version`n" - foreach($line in Get-Content '.\requirements.txt') { - if($line -match "^protobuf"){ - Write-Host "Replacing protobuf version to $protobuf_version" - } else{ - $requirements_txt_content += "$line`n" - } - } - - Set-Content -Path '.\requirements.txt' -Value $requirements_txt_content - - - $Env:ONNX_ML=1 - if($build_config -eq 'Debug'){ - $Env:DEBUG='1' - } - $Env:CMAKE_ARGS="-DONNX_USE_PROTOBUF_SHARED_LIBS=OFF -DProtobuf_USE_STATIC_LIBS=ON -DONNX_USE_LITE_PROTO=OFF" - - python.exe "setup.py" "bdist_wheel" - - - Write-Host "Installing the newly built ONNX python package" - Get-ChildItem -Path dist/*.whl | foreach { - $p = Start-Process -NoNewWindow -Wait -PassThru -FilePath "python.exe" -ArgumentList "-m", "pip", "--disable-pip-version-check", "install", "--upgrade", $_.fullname - $exitCode = $p.ExitCode - if ($exitCode -ne 0) { - Write-Host -Object "Install wheel file failed. Exitcode: $exitCode" - exit $exitCode - } - } - Write-Host "Finished installing onnx" - popd -} diff --git a/tools/ci_build/github/windows/install_third_party_deps.ps1 b/tools/ci_build/github/windows/install_third_party_deps.ps1 deleted file mode 100644 index 168df90188791..0000000000000 --- a/tools/ci_build/github/windows/install_third_party_deps.ps1 +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -# This script depends on python.exe, cmake.exe and Visual C++ spectre-mitigated libs. -# Please setup AGENT_TEMPDIRECTORY env variable before running this script -# Your PATH must contain a dir that contains python.exe. And cpu arch of the python.exe -# must match the $cpu_arch passed in to this script. - - param ( - [string]$cpu_arch = "x64", - [string]$build_config = "RelWithDebInfo", - [string]$install_prefix = ".", - [switch]$use_cache - ) - -. "$PSScriptRoot\helpers.ps1" - -$ort_src_root = (Get-Item $PSScriptRoot).parent.parent.parent.parent.FullName - -Write-Host "ONNX Runtime src root: $ort_src_root" - -$ErrorActionPreference = "Stop" - -$Env:Path = "$install_prefix\bin;" + $env:Path -$Env:MSBUILDDISABLENODEREUSE=1 -$Env:CMAKE_PREFIX_PATH = "$install_prefix" -New-Item -Path "$install_prefix" -ItemType Directory -Force - -# Setup compile flags -$compile_flags = @('/MP', '/guard:cf', '/DWIN32', '/D_WINDOWS', '/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR', '/DWINVER=0x0A00', '/D_WIN32_WINNT=0x0A00', '/DNTDDI_VERSION=0x0A000000', '/W3') -$linker_flags=@('/guard:cf') - -if ($use_cache) { - $debug_info_format = "/Z7" -} -else { - $debug_info_format = "/Zi" -} - -if($build_config -eq 'Release'){ - $compile_flags += "/O2", "/Ob2", "/DNDEBUG", "/Gw", "/GL" -} elseif($build_config -eq 'RelWithDebInfo'){ - $compile_flags += "$debug_info_format", "/O2", "/Ob1", "/DNDEBUG", "/Gw", "/GL" -} elseif($build_config -eq 'Debug'){ - $compile_flags += "$debug_info_format", "/Ob0", "/Od", "/RTC1" -} elseif($build_config -eq 'MinSizeRel'){ - $compile_flags += "/O1", "/Ob1", "/DNDEBUG", "/Gw", "/GL" -} - -# cmake args that applies to every 3rd-party library -[string[]]$cmake_extra_args="`"-DCMAKE_C_FLAGS=$compile_flags`"", "--compile-no-warning-as-error", "--fresh", "-Wno-dev" - - -if($cpu_arch -eq 'x86'){ - $cmake_extra_args += "-A", "Win32", "-T", "host=x64" - $compile_flags += '/Qspectre' - $linker_flags += '/machine:x86' -} elseif($cpu_arch -eq 'x64') { - $linker_flags += '/machine:x64' - $compile_flags += '/Qspectre' -} elseif($cpu_arch -eq 'arm') { - $linker_flags += '/machine:ARM' -} elseif($cpu_arch -eq 'arm64') { - $linker_flags += '/machine:ARM64' -} elseif($cpu_arch -eq 'arm64ec') { - $linker_flags += '/machine:ARM64EC' -} else { - throw "$cpu_arch is not supported" -} - -Write-Host $compile_flags - -$cmake_extra_args += "-DCMAKE_CXX_STANDARD=17", "`"-DCMAKE_CXX_FLAGS=$compile_flags /EHsc`"" - -if ($use_cache) { - if ($build_config -eq 'RelWithDebInfo') { - $cmake_extra_args += "-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=`"/MD /Z7 /O2 /Ob1 /DNDEBUG`"" - } - elseif ($build_config -eq 'Debug') { - $cmake_extra_args += "-DCMAKE_CXX_FLAGS_DEBUG=`"/MDd /Z7 /Ob0 /Od /RTC1`"" - } -} - -$cmake_extra_args += "-DCMAKE_EXE_LINKER_FLAGS=`"$linker_flags`"" - -# Find the full path of cmake.exe -$cmake_command = (Get-Command -CommandType Application cmake)[0] -$cmake_path = $cmake_command.Path -$vshwere_path = Join-Path -Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe" -if(-not (Test-Path $vshwere_path -PathType Leaf)){ - $vshwere_path = Join-Path -Path ${env:ProgramFiles} "Microsoft Visual Studio\Installer\vswhere.exe" -} - -$msbuild_path = &$vshwere_path -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1 - -Install-Pybind -cmake_path $cmake_path -src_root $ort_src_root -build_config $build_config -cmake_extra_args $cmake_extra_args -msbuild_path $msbuild_path -cpu_arch $cpu_arch - -Install-Abseil -cmake_path $cmake_path -src_root $ort_src_root -build_config $build_config -cmake_extra_args $cmake_extra_args -msbuild_path $msbuild_path -cpu_arch $cpu_arch - -Install-Protobuf -cmake_path $cmake_path -src_root $ort_src_root -build_config $build_config -cmake_extra_args $cmake_extra_args -msbuild_path $msbuild_path -cpu_arch $cpu_arch - -$protobuf_version="4.21.12" - -# ONNX doesn't allow us to specify CMake's path -Install-ONNX -build_config $build_config -src_root $ort_src_root -protobuf_version $protobuf_version diff --git a/tools/ci_build/requirements/pybind/requirements.txt b/tools/ci_build/requirements/pybind/requirements.txt index 0a8caecd11e4e..6c31267d8bc84 100644 --- a/tools/ci_build/requirements/pybind/requirements.txt +++ b/tools/ci_build/requirements/pybind/requirements.txt @@ -1,4 +1,5 @@ setuptools +flatbuffers wheel pytest numpy>=1.19.0 From cba2ce9cbd470654ad96dc087934e881dcb26603 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 18 Jan 2025 22:15:16 +0000 Subject: [PATCH 02/43] update --- cmake/vcpkg-triplets/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/vcpkg-triplets/gen.py b/cmake/vcpkg-triplets/gen.py index e5443d5f46bdd..8886e23b4e496 100644 --- a/cmake/vcpkg-triplets/gen.py +++ b/cmake/vcpkg-triplets/gen.py @@ -92,7 +92,7 @@ def add_copyright_header(f): f.write('set(VCPKG_C_FLAGS "{}")\n'.format(" ".join(cflags))) if len(cxxflags) >= 1: f.write('set(VCPKG_CXX_FLAGS "{}")\n'.format(" ".join(cxxflags))) - f.write("list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17)\n") + f.write("list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17)\n") if ldflags: f.write('set(VCPKG_LINKER_FLAGS "{}")\n'.format(" ".join(ldflags))) add_port_configs(f) From aae20250faea12c8b393028bb4f946fb893b745f Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 18 Jan 2025 22:15:30 +0000 Subject: [PATCH 03/43] update --- cmake/vcpkg-triplets/asan/arm64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/asan/arm64-windows-static.cmake | 2 +- cmake/vcpkg-triplets/asan/arm64ec-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/asan/arm64ec-windows-static.cmake | 2 +- cmake/vcpkg-triplets/asan/x64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/asan/x64-windows-static.cmake | 2 +- cmake/vcpkg-triplets/asan/x86-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/asan/x86-windows-static.cmake | 2 +- cmake/vcpkg-triplets/asan_nortti/arm64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/asan_nortti/arm64-windows-static.cmake | 2 +- .../vcpkg-triplets/asan_nortti/arm64ec-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static.cmake | 2 +- cmake/vcpkg-triplets/asan_nortti/x64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/asan_nortti/x64-windows-static.cmake | 2 +- cmake/vcpkg-triplets/asan_nortti/x86-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/asan_nortti/x86-windows-static.cmake | 2 +- cmake/vcpkg-triplets/binskim/arm64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/binskim/arm64-windows-static.cmake | 2 +- cmake/vcpkg-triplets/binskim/arm64ec-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/binskim/arm64ec-windows-static.cmake | 2 +- cmake/vcpkg-triplets/binskim/x64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/binskim/x64-windows-static.cmake | 2 +- cmake/vcpkg-triplets/binskim/x86-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/binskim/x86-windows-static.cmake | 2 +- .../vcpkg-triplets/binskim_nortti/arm64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static.cmake | 2 +- .../binskim_nortti/arm64ec-windows-static-md.cmake | 2 +- .../vcpkg-triplets/binskim_nortti/arm64ec-windows-static.cmake | 2 +- cmake/vcpkg-triplets/binskim_nortti/x64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/binskim_nortti/x64-windows-static.cmake | 2 +- cmake/vcpkg-triplets/binskim_nortti/x86-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/binskim_nortti/x86-windows-static.cmake | 2 +- cmake/vcpkg-triplets/default/arm64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/default/arm64-windows-static.cmake | 2 +- cmake/vcpkg-triplets/default/arm64ec-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/default/arm64ec-windows-static.cmake | 2 +- cmake/vcpkg-triplets/default/x64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/default/x64-windows-static.cmake | 2 +- cmake/vcpkg-triplets/default/x86-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/default/x86-windows-static.cmake | 2 +- cmake/vcpkg-triplets/nortti/arm64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/nortti/arm64-windows-static.cmake | 2 +- cmake/vcpkg-triplets/nortti/arm64ec-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/nortti/arm64ec-windows-static.cmake | 2 +- cmake/vcpkg-triplets/nortti/x64-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/nortti/x64-windows-static.cmake | 2 +- cmake/vcpkg-triplets/nortti/x86-windows-static-md.cmake | 2 +- cmake/vcpkg-triplets/nortti/x86-windows-static.cmake | 2 +- 48 files changed, 48 insertions(+), 48 deletions(-) diff --git a/cmake/vcpkg-triplets/asan/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/asan/arm64-windows-static-md.cmake index 37b8008a7bef3..79e10ad9e4436 100644 --- a/cmake/vcpkg-triplets/asan/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/arm64-windows-static.cmake b/cmake/vcpkg-triplets/asan/arm64-windows-static.cmake index 01a81eae32cfb..d0a3305b1f74a 100644 --- a/cmake/vcpkg-triplets/asan/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/asan/arm64ec-windows-static-md.cmake index 845ed0eb414ad..05a9718835ffb 100644 --- a/cmake/vcpkg-triplets/asan/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/asan/arm64ec-windows-static.cmake index f40edf6fee6f6..e0f4b2e1e4183 100644 --- a/cmake/vcpkg-triplets/asan/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/asan/x64-windows-static-md.cmake index d8d5058baaf4b..c0edb9ca31cb6 100644 --- a/cmake/vcpkg-triplets/asan/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/x64-windows-static.cmake b/cmake/vcpkg-triplets/asan/x64-windows-static.cmake index ad8fb85a4f52d..3370987c55a12 100644 --- a/cmake/vcpkg-triplets/asan/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/asan/x86-windows-static-md.cmake index d77e925b0884b..429a4ac7cea36 100644 --- a/cmake/vcpkg-triplets/asan/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan/x86-windows-static.cmake b/cmake/vcpkg-triplets/asan/x86-windows-static.cmake index 65149e501be7a..404cb3fbd07fb 100644 --- a/cmake/vcpkg-triplets/asan/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static-md.cmake index 4e2d9033835e1..c4ba82b7cac2a 100644 --- a/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static.cmake b/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static.cmake index 774a5a11992e4..3b028c4e40bcc 100644 --- a/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static-md.cmake index 146dff06dffb4..d2d4bda334e38 100644 --- a/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static.cmake index 6028350578f06..8e986eb139862 100644 --- a/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/asan_nortti/x64-windows-static-md.cmake index df0e9e59191e0..ae3f00b851145 100644 --- a/cmake/vcpkg-triplets/asan_nortti/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/x64-windows-static.cmake b/cmake/vcpkg-triplets/asan_nortti/x64-windows-static.cmake index ce5e3107c3b27..d64f20d3ce7f6 100644 --- a/cmake/vcpkg-triplets/asan_nortti/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/asan_nortti/x86-windows-static-md.cmake index 727e50d5ddf3c..24ddfa43c0f59 100644 --- a/cmake/vcpkg-triplets/asan_nortti/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/asan_nortti/x86-windows-static.cmake b/cmake/vcpkg-triplets/asan_nortti/x86-windows-static.cmake index da9c6accc6971..53fcb44313c26 100644 --- a/cmake/vcpkg-triplets/asan_nortti/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/asan_nortti/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /fsanitize=address /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/binskim/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim/arm64-windows-static-md.cmake index 0b343b428609f..3818356b5c0ce 100644 --- a/cmake/vcpkg-triplets/binskim/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/arm64-windows-static.cmake b/cmake/vcpkg-triplets/binskim/arm64-windows-static.cmake index 4e606d0dc5c04..ab38e9f9a9f18 100644 --- a/cmake/vcpkg-triplets/binskim/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim/arm64ec-windows-static-md.cmake index e218dbad4dc5a..6937aea847a8a 100644 --- a/cmake/vcpkg-triplets/binskim/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/binskim/arm64ec-windows-static.cmake index 5899d7dc4ef81..84c0531033699 100644 --- a/cmake/vcpkg-triplets/binskim/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim/x64-windows-static-md.cmake index 80685a145d7cb..0f600d7931076 100644 --- a/cmake/vcpkg-triplets/binskim/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/x64-windows-static.cmake b/cmake/vcpkg-triplets/binskim/x64-windows-static.cmake index 26572c05ea4e9..17d41775c9d06 100644 --- a/cmake/vcpkg-triplets/binskim/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim/x86-windows-static-md.cmake index 996c6687172eb..cb981c264a2f1 100644 --- a/cmake/vcpkg-triplets/binskim/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim/x86-windows-static.cmake b/cmake/vcpkg-triplets/binskim/x86-windows-static.cmake index 56b0225f8ad0b..53342263d5ada 100644 --- a/cmake/vcpkg-triplets/binskim/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static-md.cmake index 1f93fcf58e012..9963cfb66f4b1 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static.cmake b/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static.cmake index 01e372cd591ef..0f4948ff076f1 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static-md.cmake index 2ccfa85dbc206..6a5c8b9f1058a 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static.cmake index 696dccdebc083..668d4fb4dc420 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static-md.cmake index 50ee3ea4a5bf6..6491d31ae469b 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static.cmake b/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static.cmake index 2984e5cd01a73..011999df2ac99 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static-md.cmake index 21e7ab3db4f20..bf843c3e950e2 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static.cmake b/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static.cmake index f11f9aea970fe..21e0858066ab8 100644 --- a/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/binskim_nortti/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /guard:cf /Qspectre /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) set(VCPKG_LINKER_FLAGS "/profile /DYNAMICBASE") if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS diff --git a/cmake/vcpkg-triplets/default/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/default/arm64-windows-static-md.cmake index 349cf9eb0e4ac..6d5cf67665f4f 100644 --- a/cmake/vcpkg-triplets/default/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/default/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/arm64-windows-static.cmake b/cmake/vcpkg-triplets/default/arm64-windows-static.cmake index 64b0980ca8d1f..19ca6f16cd890 100644 --- a/cmake/vcpkg-triplets/default/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/default/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/default/arm64ec-windows-static-md.cmake index 6480822cb887b..d7982158f390c 100644 --- a/cmake/vcpkg-triplets/default/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/default/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/default/arm64ec-windows-static.cmake index fc00cd92d3d00..fb14ad71c1d91 100644 --- a/cmake/vcpkg-triplets/default/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/default/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/default/x64-windows-static-md.cmake index db41d03399faf..bec5f2724da13 100644 --- a/cmake/vcpkg-triplets/default/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/default/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/x64-windows-static.cmake b/cmake/vcpkg-triplets/default/x64-windows-static.cmake index 4bcf3adc5d7e4..3f62418071583 100644 --- a/cmake/vcpkg-triplets/default/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/default/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/default/x86-windows-static-md.cmake index 47516cfd71652..d93d87b3289f3 100644 --- a/cmake/vcpkg-triplets/default/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/default/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/default/x86-windows-static.cmake b/cmake/vcpkg-triplets/default/x86-windows-static.cmake index 19c2073c5627f..727b35cd1f7cc 100644 --- a/cmake/vcpkg-triplets/default/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/default/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/arm64-windows-static-md.cmake b/cmake/vcpkg-triplets/nortti/arm64-windows-static-md.cmake index 5eaefc8b50926..9d3c86ce644d0 100644 --- a/cmake/vcpkg-triplets/nortti/arm64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/nortti/arm64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/arm64-windows-static.cmake b/cmake/vcpkg-triplets/nortti/arm64-windows-static.cmake index 0395d029b9dff..238f7405ec492 100644 --- a/cmake/vcpkg-triplets/nortti/arm64-windows-static.cmake +++ b/cmake/vcpkg-triplets/nortti/arm64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/arm64ec-windows-static-md.cmake b/cmake/vcpkg-triplets/nortti/arm64ec-windows-static-md.cmake index b6bd29fbfe2a8..da314824ca7cc 100644 --- a/cmake/vcpkg-triplets/nortti/arm64ec-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/nortti/arm64ec-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/arm64ec-windows-static.cmake b/cmake/vcpkg-triplets/nortti/arm64ec-windows-static.cmake index 13b5340a0345f..0c7fb60401f1d 100644 --- a/cmake/vcpkg-triplets/nortti/arm64ec-windows-static.cmake +++ b/cmake/vcpkg-triplets/nortti/arm64ec-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/x64-windows-static-md.cmake b/cmake/vcpkg-triplets/nortti/x64-windows-static-md.cmake index e94fe62a2b810..a8d2441583d0f 100644 --- a/cmake/vcpkg-triplets/nortti/x64-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/nortti/x64-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/x64-windows-static.cmake b/cmake/vcpkg-triplets/nortti/x64-windows-static.cmake index 5ce29a1c2e319..688ed230fd17c 100644 --- a/cmake/vcpkg-triplets/nortti/x64-windows-static.cmake +++ b/cmake/vcpkg-triplets/nortti/x64-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/x86-windows-static-md.cmake b/cmake/vcpkg-triplets/nortti/x86-windows-static-md.cmake index 14b44565e9ed3..1d3de9c1420c4 100644 --- a/cmake/vcpkg-triplets/nortti/x86-windows-static-md.cmake +++ b/cmake/vcpkg-triplets/nortti/x86-windows-static-md.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" diff --git a/cmake/vcpkg-triplets/nortti/x86-windows-static.cmake b/cmake/vcpkg-triplets/nortti/x86-windows-static.cmake index 88110ae1e2003..3a856c26797a4 100644 --- a/cmake/vcpkg-triplets/nortti/x86-windows-static.cmake +++ b/cmake/vcpkg-triplets/nortti/x86-windows-static.cmake @@ -5,7 +5,7 @@ set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_C_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000") set(VCPKG_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /DWINAPI_FAMILY=100 /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /Zc:__cplusplus /GR- /we4541") -list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DVCPKG_CMAKE_CONFIGURE_OPTIONS=17) +list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS --compile-no-warning-as-error -DCMAKE_CXX_STANDARD=17) if(PORT MATCHES "onnx") list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DONNX_DISABLE_STATIC_REGISTRATION=ON" From 64b243e76cb62a1eab8c588d430253d698b31082 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 18 Jan 2025 23:44:31 +0000 Subject: [PATCH 04/43] update --- .../azure-pipelines/bigmodels-ci-pipeline.yml | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml index 16fe599596f61..60e025353bf9f 100644 --- a/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml @@ -77,21 +77,6 @@ stages: " Repository: $(Repository) - - task: Cache@2 - inputs: - key: '"ccache" | "$(Build.SourceBranch)" | "$(Build.SourceVersion)"' - path: $(CCACHE_DIR) - restoreKeys: | - "ccache" | "$(Build.SourceBranch)" - "ccache" - cacheHitVar: CACHE_RESTORED - displayName: Cach Task - - - script: | - sudo mkdir -p $(Pipeline.Workspace)/ccache - condition: ne(variables.CACHE_RESTORED, 'true') - displayName: Create Cache Dir - - task: CmdLine@2 inputs: script: | @@ -102,16 +87,12 @@ stages: --volume $(Build.BinariesDirectory):/build \ --volume /data/models:/build/models:ro \ --volume $HOME/.onnx:/home/onnxruntimedev/.onnx \ - --volume $(Pipeline.Workspace)/ccache:/cache \ -e ALLOW_RELEASED_ONNX_OPSET_ONLY=0 \ -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ - -e CCACHE_DIR=/cache \ $(Repository) \ /bin/bash -c ' set -ex; \ - env; \ - ccache -s; \ PATH=/opt/python/cp310-cp310/bin:$PATH /opt/python/cp310-cp310/bin/python3 /onnxruntime_src/tools/ci_build/build.py \ --build_dir /build --cmake_generator Ninja \ --config Release --update --build \ @@ -122,10 +103,8 @@ stages: --enable_onnx_tests --use_cuda --cuda_version=11.8 --cuda_home=/usr/local/cuda-11.8 --cudnn_home=/usr/local/cuda-11.8 \ --enable_cuda_profiling \ --enable_pybind --build_java \ - --use_cache \ - --cmake_extra_defines 'CMAKE_CUDA_ARCHITECTURES=75;86' ; \ - ccache -sv; \ - ccache -z' + --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=75;86" ' + workingDirectory: $(Build.SourcesDirectory) - task: CmdLine@2 From e2f30204ee1c5c5279ecb90797704a44af9024ed Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 18 Jan 2025 23:46:30 +0000 Subject: [PATCH 05/43] update --- .github/workflows/mac.yml | 95 ---------------------------------- .github/workflows/windows.yml | 96 +---------------------------------- 2 files changed, 1 insertion(+), 190 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index e99f16afe700c..3218afe11edfd 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -109,101 +109,6 @@ jobs: --apple_sysroot=iphonesimulator \ --osx_arch=${{ matrix.target_arch }} - Vcpkg: - runs-on: macos-13 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{ env.python_version }} - - - name: "Run Homebrew" - run: brew install autoconf automake autoconf-archive - - - name: "Run vcpkg(x64-osx)" - uses: lukka/run-vcpkg@v11 - with: - vcpkgDirectory: "${{ runner.temp }}/vcpkg" - vcpkgGitCommitId: "b322364f06308bdd24823f9d8f03fe0cc86fd46f" # 2024.12.16 - runVcpkgInstall: true # vcpkg install --x-manifest-root cmake --x-install-root .build --overlay-triplets cmake/vcpkg-triplets/default - vcpkgJsonGlob: "cmake/vcpkg.json" - vcpkgConfigurationJsonGlob: "cmake/vcpkg-configuration.json" - env: - VCPKG_INSTALLED_DIR: "${{ github.workspace }}/.build" - VCPKG_DEFAULT_TRIPLET: "x64-osx" - VCPKG_OVERLAY_TRIPLETS: "${{ github.workspace }}/cmake/vcpkg-triplets/default" - # VCPKG_BINARY_SOURCES: "default" # https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching - - - name: "Run compile_schema.py" - run: | - set -e -x - # Runner's host triplet should be x64-osx or arm64-osx - export FLATC_DIR="${{ github.workspace }}/.build/${{ runner.arch }}-osx/tools/flatbuffers" - export PATH="$FLATC_DIR:$PATH" - flatc --version - python onnxruntime/core/flatbuffers/schema/compile_schema.py --flatc "$(which flatc)" - python onnxruntime/lora/adapter_format/compile_schema.py --flatc "$(which flatc)" - - - name: "Detect protoc" - id: protoc-detect - run: | - export PROTOC_DIR="${{ github.workspace }}/.build/${{ runner.arch }}-osx/tools/protobuf" - export PATH="$PROTOC_DIR:$PATH" - protoc --version - echo "protoc_path=$(which protoc)" >> "$GITHUB_OUTPUT" - - - name: "Run build.py(x64-osx)" - run: | - python ./tools/ci_build/build.py \ - --build_dir "build/x64-osx" \ - --skip_submodule_sync \ - --skip_tests \ - --compile_no_warning_as_error \ - --parallel \ - --path_to_protoc_exe "${{ steps.protoc-detect.outputs.protoc_path }}" \ - --osx_arch x86_64 \ - --use_vcpkg \ - --cmake_extra_defines "CMAKE_TOOLCHAIN_FILE:FILEPATH=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \ - --cmake_extra_defines "VCPKG_TARGET_TRIPLET=x64-osx" \ - --cmake_extra_defines "VCPKG_INSTALLED_DIR:PATH=${{ github.workspace }}/.build" \ - --cmake_extra_defines "VCPKG_INSTALL_OPTIONS=--x-feature=tests" - env: - VCPKG_OVERLAY_TRIPLETS: "${{ github.workspace }}/cmake/vcpkg-triplets/default" - shell: bash - - - name: "Run vcpkg(arm64-osx)" - uses: lukka/run-vcpkg@v11 - with: - vcpkgDirectory: "${{ runner.temp }}/vcpkg" - doNotUpdateVcpkg: true - runVcpkgInstall: true # vcpkg install --x-manifest-root cmake --x-install-root .build --overlay-triplets cmake/vcpkg-triplets/default - vcpkgJsonGlob: "cmake/vcpkg.json" - vcpkgConfigurationJsonGlob: "cmake/vcpkg-configuration.json" - env: - VCPKG_INSTALLED_DIR: "${{ github.workspace }}/.build" - VCPKG_DEFAULT_TRIPLET: "arm64-osx" - VCPKG_OVERLAY_TRIPLETS: "${{ github.workspace }}/cmake/vcpkg-triplets/default" - # VCPKG_BINARY_SOURCES: "default" # https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching - - - name: "Run build.py(arm64-osx)" - run: | - python ./tools/ci_build/build.py \ - --build_dir "build/arm64-osx" \ - --skip_submodule_sync \ - --skip_tests \ - --compile_no_warning_as_error \ - --parallel \ - --path_to_protoc_exe "${{ steps.protoc-detect.outputs.protoc_path }}" \ - --osx_arch arm64 \ - --use_vcpkg \ - --cmake_extra_defines "CMAKE_TOOLCHAIN_FILE:FILEPATH=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \ - --cmake_extra_defines "VCPKG_TARGET_TRIPLET=arm64-osx" \ - --cmake_extra_defines "VCPKG_INSTALLED_DIR:PATH=${{ github.workspace }}/.build" \ - --cmake_extra_defines "VCPKG_INSTALL_OPTIONS=--x-feature=tests" - env: - VCPKG_OVERLAY_TRIPLETS: "${{ github.workspace }}/cmake/vcpkg-triplets/default" - shell: bash - Objective-C-StaticAnalysis: runs-on: macos-14 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5adfad63093bc..593ca85e8ea4b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -41,98 +41,4 @@ jobs: # The build machine doesn't have a GPU. So the value of CMAKE_CUDA_ARCHITECTURES doesn't matter. - name: Build code - run: python tools\ci_build\build.py --windows_sdk_version 10.0.22621.0 --enable_training --build_java --config Debug --build_dir D:\b --skip_submodule_sync --build_csharp --update --build --parallel --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_pybind --use_cuda --cuda_home=${{ github.workspace }}\cuda_sdk\v12.2 --enable_cuda_profiling --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75 - - Vcpkg: - runs-on: "windows-latest" - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.11.x' - architecture: 'x64' - - - name: "Run vcpkg(x64-windows)" - uses: lukka/run-vcpkg@v11 - with: - vcpkgDirectory: "C:/vcpkg" # use VCPKG_INSTALLATION_ROOT of the image - vcpkgGitCommitId: "b322364f06308bdd24823f9d8f03fe0cc86fd46f" # 2024.12.16 - runVcpkgInstall: true # vcpkg install --x-manifest-root cmake --x-install-root .build --overlay-triplets cmake/vcpkg-triplets/default - vcpkgJsonGlob: "cmake/vcpkg.json" - vcpkgConfigurationJsonGlob: "cmake/vcpkg-configuration.json" - env: - VCPKG_INSTALLED_DIR: "${{ github.workspace }}/.build" - VCPKG_DEFAULT_TRIPLET: "x64-windows" - VCPKG_OVERLAY_TRIPLETS: "${{ github.workspace }}/cmake/vcpkg-triplets/default" - # VCPKG_BINARY_SOURCES: "default" # https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching - - - name: "Run compile_schema.py" - run: | - # Runner's host triplet should be x64-windows or arm64-windows - $FLATC_DIR="${{ github.workspace }}/.build/${{ runner.arch }}-windows/tools/flatbuffers" - $env:PATH="$FLATC_DIR;$env:PATH" - flatc --version - $FLATC_PATH = Join-Path "$FLATC_DIR" "flatc.exe" - python onnxruntime/core/flatbuffers/schema/compile_schema.py --flatc "$FLATC_PATH" - python onnxruntime/lora/adapter_format/compile_schema.py --flatc "$FLATC_PATH" - shell: pwsh - - - name: "Detect protoc" - id: protoc-detect - run: | - $PROTOC_DIR="${{ github.workspace }}/.build/${{ runner.arch }}-windows/tools/protobuf" - $env:PATH="$PROTOC_DIR;$env:PATH" - protoc --version - $PROTOC_PATH = Join-Path "$PROTOC_DIR" "protoc.exe" - "protoc_path=$PROTOC_PATH" >> $env:GITHUB_OUTPUT - shell: pwsh - - - name: "Run build.py(x64-windows)" - run: | - python tools\ci_build\build.py ` - --build_dir "cmake_build/x64-windows" ` - --skip_submodule_sync ` - --skip_tests ` - --compile_no_warning_as_error ` - --parallel ` - --path_to_protoc_exe "${{ steps.protoc-detect.outputs.protoc_path }}" ` - --use_vcpkg ` - --cmake_extra_defines "CMAKE_TOOLCHAIN_FILE:FILEPATH=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` - --cmake_extra_defines "VCPKG_TARGET_TRIPLET=x64-windows" ` - --cmake_extra_defines "VCPKG_INSTALLED_DIR:PATH=${{ github.workspace }}/.build" ` - --cmake_extra_defines "VCPKG_INSTALL_OPTIONS=--x-feature=tests" - env: - VCPKG_OVERLAY_TRIPLETS: "${{ github.workspace }}/cmake/vcpkg-triplets/default" - shell: pwsh - - - name: "Run vcpkg(arm64-windows)" - uses: lukka/run-vcpkg@v11 - with: - vcpkgDirectory: "C:/vcpkg" # use VCPKG_INSTALLATION_ROOT of the image - doNotUpdateVcpkg: true - runVcpkgInstall: true # vcpkg install --x-manifest-root cmake --x-install-root .build --overlay-triplets cmake/vcpkg-triplets/default - vcpkgJsonGlob: "cmake/vcpkg.json" - vcpkgConfigurationJsonGlob: "cmake/vcpkg-configuration.json" - env: - VCPKG_INSTALLED_DIR: "${{ github.workspace }}/.build" - VCPKG_DEFAULT_TRIPLET: "arm64-windows" - VCPKG_OVERLAY_TRIPLETS: "${{ github.workspace }}/cmake/vcpkg-triplets/default" - # VCPKG_BINARY_SOURCES: "default" # https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching - - - name: "Run build.py(arm64-windows)" - run: | - python tools\ci_build\build.py ` - --build_dir "cmake_build/arm64-windows" --arm64 ` - --skip_submodule_sync ` - --skip_tests ` - --compile_no_warning_as_error ` - --parallel ` - --path_to_protoc_exe "${{ steps.protoc-detect.outputs.protoc_path }}" ` - --use_vcpkg ` - --cmake_extra_defines "CMAKE_TOOLCHAIN_FILE:FILEPATH=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` - --cmake_extra_defines "VCPKG_TARGET_TRIPLET=arm64-windows" ` - --cmake_extra_defines "VCPKG_INSTALLED_DIR:PATH=${{ github.workspace }}/.build" ` - --cmake_extra_defines "VCPKG_INSTALL_OPTIONS=--x-feature=tests" - env: - VCPKG_OVERLAY_TRIPLETS: "${{ github.workspace }}/cmake/vcpkg-triplets/default" - shell: pwsh + run: python tools\ci_build\build.py --windows_sdk_version 10.0.22621.0 --enable_training --build_java --config Debug --build_dir D:\b --skip_submodule_sync --build_csharp --update --build --parallel --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_pybind --use_cuda --cuda_home=${{ github.workspace }}\cuda_sdk\v12.2 --enable_cuda_profiling --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75 \ No newline at end of file From 872fbe0bc5fcce944894033b0074faa7c6e4bc7d Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 18 Jan 2025 23:49:57 +0000 Subject: [PATCH 06/43] update --- .../github/azure-pipelines/templates/win-ci.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml index 954c7d2333c01..c6f49a700099e 100644 --- a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml @@ -60,10 +60,6 @@ parameters: type: boolean default: false -- name: PublishProtoc - type: boolean - default: false - - name: CudaVersion type: string default: '11.8' @@ -258,14 +254,6 @@ stages: artifactName: 'drop-onnxruntime-nodejs-win-${{ parameters.packageName }}${{ parameters.artifact_name_suffix }}' DoEsrp: ${{ parameters.DoEsrp }} - #Upload protoc.exe, which will be used in nuget build for generating C# files - - task: PublishPipelineArtifact@1 - displayName: Publish protoc as drop-extra - condition: and(succeeded(), or(eq('${{ parameters.packageName}}', 'x64'), eq('${{ parameters.PublishProtoc}}', true))) - inputs: - targetPath: '$(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe' - artifactName: 'drop-extra${{ parameters.artifact_name_suffix }}' - - task: CopyFiles@2 displayName: 'Copy custom_op_library to: $(Build.ArtifactStagingDirectory)' condition: and(succeeded(), eq('${{ parameters.packageName}}', 'x64')) From 42ad23f6ddf0ac6a55aadc86887b800972aee13d Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 21 Jan 2025 19:49:55 +0000 Subject: [PATCH 07/43] update headres --- .../core/providers/webgpu/buffer_manager.h | 2 +- .../core/providers/webgpu/compute_context.h | 2 +- .../core/providers/webgpu/program_manager.h | 2 +- .../core/providers/webgpu/shader_helper.h | 2 +- .../core/providers/webgpu/webgpu_context.h | 2 +- .../providers/webgpu/webgpu_external_header.h | 16 ++++++++++++++++ 6 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 onnxruntime/core/providers/webgpu/webgpu_external_header.h diff --git a/onnxruntime/core/providers/webgpu/buffer_manager.h b/onnxruntime/core/providers/webgpu/buffer_manager.h index 20bee52835c02..a5bba53c6798b 100644 --- a/onnxruntime/core/providers/webgpu/buffer_manager.h +++ b/onnxruntime/core/providers/webgpu/buffer_manager.h @@ -5,7 +5,7 @@ #include -#include +#include "core/providers/webgpu/webgpu_external_header.h" #include "core/framework/execution_provider.h" diff --git a/onnxruntime/core/providers/webgpu/compute_context.h b/onnxruntime/core/providers/webgpu/compute_context.h index 680e03aef0aa3..23fa10a0d5489 100644 --- a/onnxruntime/core/providers/webgpu/compute_context.h +++ b/onnxruntime/core/providers/webgpu/compute_context.h @@ -3,7 +3,7 @@ #pragma once -#include +#include "core/providers/webgpu/webgpu_external_header.h" #include diff --git a/onnxruntime/core/providers/webgpu/program_manager.h b/onnxruntime/core/providers/webgpu/program_manager.h index 55721770014d2..feeb703b95aa2 100644 --- a/onnxruntime/core/providers/webgpu/program_manager.h +++ b/onnxruntime/core/providers/webgpu/program_manager.h @@ -6,7 +6,7 @@ #include #include -#include +#include "core/providers/webgpu/webgpu_external_header.h" #include "core/common/common.h" diff --git a/onnxruntime/core/providers/webgpu/shader_helper.h b/onnxruntime/core/providers/webgpu/shader_helper.h index dac08f3bd9368..64b4c054f93d4 100644 --- a/onnxruntime/core/providers/webgpu/shader_helper.h +++ b/onnxruntime/core/providers/webgpu/shader_helper.h @@ -5,7 +5,7 @@ #include -#include +#include "core/providers/webgpu/webgpu_external_header.h" #include "core/framework/tensor_shape.h" diff --git a/onnxruntime/core/providers/webgpu/webgpu_context.h b/onnxruntime/core/providers/webgpu/webgpu_context.h index 80c8c64ce72b6..1a752a93a7116 100644 --- a/onnxruntime/core/providers/webgpu/webgpu_context.h +++ b/onnxruntime/core/providers/webgpu/webgpu_context.h @@ -6,7 +6,7 @@ #include #include -#include +#include "core/providers/webgpu/webgpu_external_header.h" #include "core/common/common.h" #include "core/framework/library_handles.h" diff --git a/onnxruntime/core/providers/webgpu/webgpu_external_header.h b/onnxruntime/core/providers/webgpu/webgpu_external_header.h new file mode 100644 index 0000000000000..62e8a24fba3ff --- /dev/null +++ b/onnxruntime/core/providers/webgpu/webgpu_external_header.h @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma once +#include "onnxruntime_config.h" + +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + +#include + +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif From 0fe3f90b0885bfb1e01da21298906e3530d3c976 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 21 Jan 2025 19:54:17 +0000 Subject: [PATCH 08/43] Update header --- include/onnxruntime/core/graph/node_arg.h | 2 +- {onnxruntime => include/onnxruntime}/core/graph/onnx_protobuf.h | 0 onnxruntime/core/graph/function_template.h | 2 +- .../nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc | 2 +- .../nnapi_builtin/builders/impl/depthtospace_op_builder.cc | 2 +- .../nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc | 2 +- .../nnapi_builtin/builders/impl/quantizelinear_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/split_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc | 2 +- .../core/providers/nnapi/nnapi_builtin/builders/model_builder.h | 2 +- onnxruntime/core/providers/rknpu/node_attr_helper.h | 2 +- onnxruntime/core/providers/rknpu/onnx_converter.h | 2 +- onnxruntime/test/fuzzing/include/OnnxPrediction.h | 2 +- onnxruntime/test/fuzzing/ort_libfuzzer/OrtProtoLibfuzzer.cpp | 2 +- onnxruntime/test/providers/coreml/coreml_basic_test.cc | 2 +- onnxruntime/test/providers/qnn/argmaxmin_op_test.cc | 2 +- onnxruntime/test/providers/qnn/average_pool_test.cc | 2 +- onnxruntime/test/providers/qnn/cast_test.cc | 2 +- onnxruntime/test/providers/qnn/clip_op_test.cc | 2 +- onnxruntime/test/providers/qnn/flatten_op_test.cc | 2 +- onnxruntime/test/providers/qnn/gather_elems_op_test.cc | 2 +- onnxruntime/test/providers/qnn/gemm_op_test.cc | 2 +- onnxruntime/test/providers/qnn/logical_comp_ops_test.cc | 2 +- onnxruntime/test/providers/qnn/lrn_op_test.cc | 2 +- onnxruntime/test/providers/qnn/matmul_test.cpp | 2 +- onnxruntime/test/providers/qnn/max_min_op_test.cc | 2 +- onnxruntime/test/providers/qnn/pad_op_test.cpp | 2 +- onnxruntime/test/providers/qnn/pool_op_test.cpp | 2 +- onnxruntime/test/providers/qnn/reshape_expand_op_test.cc | 2 +- onnxruntime/test/providers/qnn/resize_test.cc | 2 +- onnxruntime/test/providers/qnn/split_op_test.cc | 2 +- onnxruntime/test/providers/qnn/squeeze_unsqueeze_op_test.cc | 2 +- onnxruntime/test/providers/qnn/tile_op_test.cc | 2 +- onnxruntime/test/providers/qnn/topk_op_test.cc | 2 +- 58 files changed, 57 insertions(+), 57 deletions(-) rename {onnxruntime => include/onnxruntime}/core/graph/onnx_protobuf.h (100%) diff --git a/include/onnxruntime/core/graph/node_arg.h b/include/onnxruntime/core/graph/node_arg.h index 921bff59fb6d4..0ddf1a2b9d3de 100644 --- a/include/onnxruntime/core/graph/node_arg.h +++ b/include/onnxruntime/core/graph/node_arg.h @@ -3,7 +3,7 @@ #pragma once -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "core/graph/basic_types.h" #include "core/common/status.h" diff --git a/onnxruntime/core/graph/onnx_protobuf.h b/include/onnxruntime/core/graph/onnx_protobuf.h similarity index 100% rename from onnxruntime/core/graph/onnx_protobuf.h rename to include/onnxruntime/core/graph/onnx_protobuf.h diff --git a/onnxruntime/core/graph/function_template.h b/onnxruntime/core/graph/function_template.h index 978174d943f14..0d3fee18d5d59 100644 --- a/onnxruntime/core/graph/function_template.h +++ b/onnxruntime/core/graph/function_template.h @@ -2,7 +2,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" namespace onnxruntime { diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc index 91cad034d8854..fd1720d69eebd 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc index 75a66d3a14643..5874eb1e7dc3b 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc index 5599fbdc69bdd..91d1a38e71e6f 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc index 9059de817e210..03329b9159c06 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc index 9821d9267c71f..becd677e32ac1 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc index a8394faec51be..fa5e292be0ecd 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc index 5477cd16f9c01..a7a837ae210b4 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc index ef8709641e2d0..039d8510bb8d2 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc index 7d0e04fbd7b0e..ed9062f894660 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc index 218c41d6f07c0..fc2348951edb7 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc index b5e9c011990ce..986ce78fb1acc 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc index d6da9181b5a3d..ccd3f8b571fcb 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc index 66eefcd6e4840..cff96c2f1ff99 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc index d7b35572e6cd1..250b190091a52 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc index 6a633c443c9e5..e3dcee1e3d597 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/framework/tensorprotoutils.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc index aeadbd17053cf..a80742aef9cb6 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc index b0404ebec0583..8127de0a0f05f 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc index a2a4786b72ec7..10c5efb84ed8f 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc index d13b81c2a14b8..eb81f5e3f59ee 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc index a6da290753b74..fbb353f949f48 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc index c8641093ee7eb..d65c069851c1f 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc index f2f9165d2f3cc..fad5d8289c6b0 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc index 44403010c936c..af5aeba6c8236 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc index facdc7132dc00..52b075b0271ef 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc index a2a8b4512b028..8fa915de95a72 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc index edee298ad1ccf..7509fd15f1c5e 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include #include "core/common/logging/logging.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc index fb3ca5e6175fa..44510c33c004c 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc index 6fe5ca32fe044..4a9e3eb00a787 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc index dbd960ee5536c..77df9d2fd771c 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc index 95cd813800c9a..b9ebbace8d391 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h index 4db335afa98b0..3cbf7d1ee40e8 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h @@ -2,7 +2,7 @@ // Licensed under the MIT License. #pragma once -#include +#include "core/graph/onnx_protobuf.h" #include #include "core/common/inlined_containers_fwd.h" diff --git a/onnxruntime/core/providers/rknpu/node_attr_helper.h b/onnxruntime/core/providers/rknpu/node_attr_helper.h index 6ab8f8c6bb953..76a0c721f70aa 100644 --- a/onnxruntime/core/providers/rknpu/node_attr_helper.h +++ b/onnxruntime/core/providers/rknpu/node_attr_helper.h @@ -4,7 +4,7 @@ #pragma once -#include +#include "core/graph/onnx_protobuf.h" #include #include diff --git a/onnxruntime/core/providers/rknpu/onnx_converter.h b/onnxruntime/core/providers/rknpu/onnx_converter.h index e90efd75b9c7f..10cc09a9dba92 100644 --- a/onnxruntime/core/providers/rknpu/onnx_converter.h +++ b/onnxruntime/core/providers/rknpu/onnx_converter.h @@ -2,7 +2,7 @@ #pragma once -#include +#include "core/graph/onnx_protobuf.h" #include #include diff --git a/onnxruntime/test/fuzzing/include/OnnxPrediction.h b/onnxruntime/test/fuzzing/include/OnnxPrediction.h index c169aaa16fd6e..c99120dc45479 100644 --- a/onnxruntime/test/fuzzing/include/OnnxPrediction.h +++ b/onnxruntime/test/fuzzing/include/OnnxPrediction.h @@ -20,7 +20,7 @@ #include #include "BetaDistribution.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "onnxruntime_cxx_api.h" #include "testlog.h" diff --git a/onnxruntime/test/fuzzing/ort_libfuzzer/OrtProtoLibfuzzer.cpp b/onnxruntime/test/fuzzing/ort_libfuzzer/OrtProtoLibfuzzer.cpp index 607d9cfd9c755..472122be58e89 100644 --- a/onnxruntime/test/fuzzing/ort_libfuzzer/OrtProtoLibfuzzer.cpp +++ b/onnxruntime/test/fuzzing/ort_libfuzzer/OrtProtoLibfuzzer.cpp @@ -5,7 +5,7 @@ #include "OnnxPrediction.h" #include "onnxruntime_session_options_config_keys.h" #include "src/libfuzzer/libfuzzer_macro.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include diff --git a/onnxruntime/test/providers/coreml/coreml_basic_test.cc b/onnxruntime/test/providers/coreml/coreml_basic_test.cc index 302ad57fb88c5..a9aa78b7a3229 100644 --- a/onnxruntime/test/providers/coreml/coreml_basic_test.cc +++ b/onnxruntime/test/providers/coreml/coreml_basic_test.cc @@ -15,7 +15,7 @@ #include "test/util/include/inference_session_wrapper.h" #include "test/util/include/test_environment.h" #include "test/util/include/test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #if !defined(ORT_MINIMAL_BUILD) // if this is a full build we need the provider test utils diff --git a/onnxruntime/test/providers/qnn/argmaxmin_op_test.cc b/onnxruntime/test/providers/qnn/argmaxmin_op_test.cc index c514cf16b2f3c..da6eda1317778 100644 --- a/onnxruntime/test/providers/qnn/argmaxmin_op_test.cc +++ b/onnxruntime/test/providers/qnn/argmaxmin_op_test.cc @@ -9,7 +9,7 @@ #include "core/graph/node_attr_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/average_pool_test.cc b/onnxruntime/test/providers/qnn/average_pool_test.cc index 1a0f9bfcbae97..f897a08da6b2e 100644 --- a/onnxruntime/test/providers/qnn/average_pool_test.cc +++ b/onnxruntime/test/providers/qnn/average_pool_test.cc @@ -11,7 +11,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/cast_test.cc b/onnxruntime/test/providers/qnn/cast_test.cc index 9b83dd281a56d..e2e4b0d714e54 100644 --- a/onnxruntime/test/providers/qnn/cast_test.cc +++ b/onnxruntime/test/providers/qnn/cast_test.cc @@ -9,7 +9,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/clip_op_test.cc b/onnxruntime/test/providers/qnn/clip_op_test.cc index cfa77a46210b3..21bd6fcc98d74 100644 --- a/onnxruntime/test/providers/qnn/clip_op_test.cc +++ b/onnxruntime/test/providers/qnn/clip_op_test.cc @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/flatten_op_test.cc b/onnxruntime/test/providers/qnn/flatten_op_test.cc index 637d3257ddea7..b33f8f9c00fc4 100644 --- a/onnxruntime/test/providers/qnn/flatten_op_test.cc +++ b/onnxruntime/test/providers/qnn/flatten_op_test.cc @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/gather_elems_op_test.cc b/onnxruntime/test/providers/qnn/gather_elems_op_test.cc index 81c08873064c8..85dc792666827 100644 --- a/onnxruntime/test/providers/qnn/gather_elems_op_test.cc +++ b/onnxruntime/test/providers/qnn/gather_elems_op_test.cc @@ -11,7 +11,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/gemm_op_test.cc b/onnxruntime/test/providers/qnn/gemm_op_test.cc index da0c7f2c36854..0c1146ba22360 100644 --- a/onnxruntime/test/providers/qnn/gemm_op_test.cc +++ b/onnxruntime/test/providers/qnn/gemm_op_test.cc @@ -9,7 +9,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/logical_comp_ops_test.cc b/onnxruntime/test/providers/qnn/logical_comp_ops_test.cc index 59105136781f4..522b781379119 100644 --- a/onnxruntime/test/providers/qnn/logical_comp_ops_test.cc +++ b/onnxruntime/test/providers/qnn/logical_comp_ops_test.cc @@ -9,7 +9,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/lrn_op_test.cc b/onnxruntime/test/providers/qnn/lrn_op_test.cc index a99cba66bf167..4b26ed0da93c7 100644 --- a/onnxruntime/test/providers/qnn/lrn_op_test.cc +++ b/onnxruntime/test/providers/qnn/lrn_op_test.cc @@ -9,7 +9,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/matmul_test.cpp b/onnxruntime/test/providers/qnn/matmul_test.cpp index f3f584f24a102..dec9369b81748 100644 --- a/onnxruntime/test/providers/qnn/matmul_test.cpp +++ b/onnxruntime/test/providers/qnn/matmul_test.cpp @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/max_min_op_test.cc b/onnxruntime/test/providers/qnn/max_min_op_test.cc index 3deff121f3c72..9a45d11b7e34f 100644 --- a/onnxruntime/test/providers/qnn/max_min_op_test.cc +++ b/onnxruntime/test/providers/qnn/max_min_op_test.cc @@ -7,7 +7,7 @@ #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/pad_op_test.cpp b/onnxruntime/test/providers/qnn/pad_op_test.cpp index a6b8664c6c0c9..4ce6db7facc69 100644 --- a/onnxruntime/test/providers/qnn/pad_op_test.cpp +++ b/onnxruntime/test/providers/qnn/pad_op_test.cpp @@ -10,7 +10,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/pool_op_test.cpp b/onnxruntime/test/providers/qnn/pool_op_test.cpp index 5dd3a6aaa3620..f0ca3557191c7 100644 --- a/onnxruntime/test/providers/qnn/pool_op_test.cpp +++ b/onnxruntime/test/providers/qnn/pool_op_test.cpp @@ -10,7 +10,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/reshape_expand_op_test.cc b/onnxruntime/test/providers/qnn/reshape_expand_op_test.cc index 3964edc11461b..b66547a939983 100644 --- a/onnxruntime/test/providers/qnn/reshape_expand_op_test.cc +++ b/onnxruntime/test/providers/qnn/reshape_expand_op_test.cc @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/resize_test.cc b/onnxruntime/test/providers/qnn/resize_test.cc index 15612e3267a75..651f55bc05d3f 100644 --- a/onnxruntime/test/providers/qnn/resize_test.cc +++ b/onnxruntime/test/providers/qnn/resize_test.cc @@ -9,7 +9,7 @@ #include "test/optimizer/qdq_test_utils.h" #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" diff --git a/onnxruntime/test/providers/qnn/split_op_test.cc b/onnxruntime/test/providers/qnn/split_op_test.cc index 6dc721edb421e..23682f7e934c3 100644 --- a/onnxruntime/test/providers/qnn/split_op_test.cc +++ b/onnxruntime/test/providers/qnn/split_op_test.cc @@ -7,7 +7,7 @@ #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/squeeze_unsqueeze_op_test.cc b/onnxruntime/test/providers/qnn/squeeze_unsqueeze_op_test.cc index 33d2f64c0315e..abc1b3a89d85c 100644 --- a/onnxruntime/test/providers/qnn/squeeze_unsqueeze_op_test.cc +++ b/onnxruntime/test/providers/qnn/squeeze_unsqueeze_op_test.cc @@ -7,7 +7,7 @@ #include "test/providers/qnn/qnn_test_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/tile_op_test.cc b/onnxruntime/test/providers/qnn/tile_op_test.cc index 2b35c730ee5fe..85541efe5646c 100644 --- a/onnxruntime/test/providers/qnn/tile_op_test.cc +++ b/onnxruntime/test/providers/qnn/tile_op_test.cc @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { diff --git a/onnxruntime/test/providers/qnn/topk_op_test.cc b/onnxruntime/test/providers/qnn/topk_op_test.cc index 5a9351b9366ec..354a5d1e3b49a 100644 --- a/onnxruntime/test/providers/qnn/topk_op_test.cc +++ b/onnxruntime/test/providers/qnn/topk_op_test.cc @@ -8,7 +8,7 @@ #include "test/providers/qnn/qnn_test_utils.h" #include "core/graph/node_attr_utils.h" -#include "onnx/onnx_pb.h" +#include "core/graph/onnx_protobuf.h" #include "gtest/gtest.h" namespace onnxruntime { From e6f4a7c290813f514094d4378ff461963c197e11 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 21 Jan 2025 20:10:47 +0000 Subject: [PATCH 09/43] suppress warnings --- onnxruntime/core/providers/webgpu/generator/range.cc | 9 +++++++++ .../core/providers/webgpu/math/unary_elementwise_ops.cc | 7 +++++++ onnxruntime/core/providers/webgpu/program.h | 9 +++++++++ onnxruntime/core/providers/webgpu/shader_variable.h | 8 ++++++++ onnxruntime/core/providers/webgpu/webgpu_context.cc | 8 ++++++++ .../core/providers/webgpu/webgpu_external_header.h | 1 - 6 files changed, 41 insertions(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/webgpu/generator/range.cc b/onnxruntime/core/providers/webgpu/generator/range.cc index ee7c67ec24185..a0b65f08a5b4e 100644 --- a/onnxruntime/core/providers/webgpu/generator/range.cc +++ b/onnxruntime/core/providers/webgpu/generator/range.cc @@ -25,6 +25,11 @@ Status Range::ComputeInternal(ComputeContext& context) const { uint32_t output_size = gsl::narrow(n); RangeProgram program{}; +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + program.AddOutput({output_tensor, ProgramTensorMetadataDependency::Type}) .SetDispatchGroupSize((output_size + WORKGROUP_SIZE - 1) / WORKGROUP_SIZE) .AddUniformVariables({ @@ -33,6 +38,10 @@ Status Range::ComputeInternal(ComputeContext& context) const { *reinterpret_cast(&delta), }); +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + return context.RunProgram(program); } diff --git a/onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.cc b/onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.cc index 8dcf63671092b..eaaad206ebaf5 100644 --- a/onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.cc +++ b/onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.cc @@ -194,6 +194,10 @@ class Clip final : public UnaryElementwise { "Clip", std::is_same_v ? ClipF16Impl : ClipImpl, "", ShaderUsage::UseElementTypeAlias} {} +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif Status ConfigureProgram(const ComputeContext& context, UnaryElementwiseProgram& program) const override { const auto* clip_min_tensor = context.Input(1); @@ -214,6 +218,9 @@ class Clip final : public UnaryElementwise { } return Status::OK(); } +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif // uniforms.attr is a f32 value. It is encoded as a float for 2 f16 values. // bitcast>(uniforms.attr)[0] is clip_min, bitcast>(uniforms.attr)[1] is clip_max diff --git a/onnxruntime/core/providers/webgpu/program.h b/onnxruntime/core/providers/webgpu/program.h index 1562ec158b40a..7bfd9e8800099 100644 --- a/onnxruntime/core/providers/webgpu/program.h +++ b/onnxruntime/core/providers/webgpu/program.h @@ -150,6 +150,11 @@ enum class ProgramTensorMetadataDependency : int { }; std::ostream& operator<<(std::ostream& os, ProgramTensorMetadataDependency); +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + inline ProgramTensorMetadataDependency operator|(ProgramTensorMetadataDependency a, ProgramTensorMetadataDependency b) { return (ProgramTensorMetadataDependency)((int&)a | (int&)b); } @@ -163,6 +168,10 @@ inline ProgramTensorMetadataDependency& operator&=(ProgramTensorMetadataDependen return (ProgramTensorMetadataDependency&)((int&)a &= (int&)b); } +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + constexpr SafeInt WORKGROUP_SIZE = 64; // data type of variable diff --git a/onnxruntime/core/providers/webgpu/shader_variable.h b/onnxruntime/core/providers/webgpu/shader_variable.h index 4c87bc9158890..2aba2a59d157f 100644 --- a/onnxruntime/core/providers/webgpu/shader_variable.h +++ b/onnxruntime/core/providers/webgpu/shader_variable.h @@ -189,6 +189,10 @@ class ShaderVariableHelper : public ShaderIndicesHelper { friend class ShaderHelper; }; +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif inline ShaderUsage operator|(ShaderUsage a, ShaderUsage b) { return (uint32_t)a.usage | (uint32_t)b.usage; @@ -205,6 +209,10 @@ inline ShaderUsage& operator&=(ShaderUsage& a, ShaderUsage b) { return a; } +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + namespace detail { template >> std::string pass_as_string(T&& v) { diff --git a/onnxruntime/core/providers/webgpu/webgpu_context.cc b/onnxruntime/core/providers/webgpu/webgpu_context.cc index 1c9a16bf36e8e..f7d94207019da 100644 --- a/onnxruntime/core/providers/webgpu/webgpu_context.cc +++ b/onnxruntime/core/providers/webgpu/webgpu_context.cc @@ -4,12 +4,20 @@ #include #include +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + #if !defined(__wasm__) #include "dawn/dawn_proc.h" #if !defined(USE_EXTERNAL_DAWN) #include "dawn/native/DawnNative.h" #endif #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif #include "core/common/common.h" #include "core/common/path_string.h" diff --git a/onnxruntime/core/providers/webgpu/webgpu_external_header.h b/onnxruntime/core/providers/webgpu/webgpu_external_header.h index 62e8a24fba3ff..485fa729f1d9f 100644 --- a/onnxruntime/core/providers/webgpu/webgpu_external_header.h +++ b/onnxruntime/core/providers/webgpu/webgpu_external_header.h @@ -2,7 +2,6 @@ // Licensed under the MIT License. #pragma once -#include "onnxruntime_config.h" #if defined(__GNUC__) #pragma GCC diagnostic push From 838f361ddf91407580d833d5a73aa3ae7daa5a51 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 21 Jan 2025 20:42:46 +0000 Subject: [PATCH 10/43] Use the same lib --- cmake/external/abseil-cpp.cmake | 8 +++++++- cmake/external/onnxruntime_external_deps.cmake | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake index 7b6e2141eeb1b..6b4404a124926 100644 --- a/cmake/external/abseil-cpp.cmake +++ b/cmake/external/abseil-cpp.cmake @@ -32,7 +32,13 @@ FetchContent_Declare( onnxruntime_fetchcontent_makeavailable(abseil_cpp) FetchContent_GetProperties(abseil_cpp) -set(ABSEIL_SOURCE_DIR ${abseil_cpp_SOURCE_DIR}) +if(abseil_cpp_SOURCE_DIR) + set(ABSEIL_SOURCE_DIR ${abseil_cpp_SOURCE_DIR}) + if(onnxruntime_USE_WEBGPU) + set(DAWN_ABSEIL_DIR ${abseil_cpp_SOURCE_DIR}) + endif() +endif() + # abseil_cpp_SOURCE_DIR is non-empty if we build it from source message(STATUS "Abseil source dir:" ${ABSEIL_SOURCE_DIR}) # abseil_cpp_VERSION is non-empty if we find a preinstalled ABSL diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index 0aa6b7018777f..417a12030df22 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -222,6 +222,11 @@ onnxruntime_fetchcontent_makeavailable(Protobuf) if(Protobuf_FOUND) message(STATUS "Protobuf version: ${Protobuf_VERSION}") else() + if(protobuf_SOURCE_DIR) + if(onnxruntime_USE_WEBGPU) + set(DAWN_PROTOBUF_DIR ${protobuf_SOURCE_DIR}) + endif() + endif() # Adjust warning flags if (TARGET libprotoc) if (NOT MSVC) From 81780a44e4b8fb4a0223d7f32ed1fe6d5357f48e Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 21 Jan 2025 19:56:23 +0000 Subject: [PATCH 11/43] stash --- onnxruntime/core/framework/tensor_allocator.h | 2 +- .../nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc | 2 +- .../nnapi_builtin/builders/impl/depthtospace_op_builder.cc | 2 +- .../nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc | 2 +- .../nnapi_builtin/builders/impl/quantizelinear_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/split_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc | 2 +- .../nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc | 2 +- .../core/providers/nnapi/nnapi_builtin/builders/model_builder.h | 2 +- onnxruntime/core/providers/rknpu/node_attr_helper.h | 2 +- onnxruntime/core/providers/rknpu/onnx_converter.h | 2 +- onnxruntime/test/onnx/microbenchmark/batchnorm2.cc | 2 +- onnxruntime/test/onnx/microbenchmark/main.cc | 2 +- onnxruntime/test/onnx/microbenchmark/pooling.cc | 2 +- 37 files changed, 37 insertions(+), 37 deletions(-) diff --git a/onnxruntime/core/framework/tensor_allocator.h b/onnxruntime/core/framework/tensor_allocator.h index 923320681e683..a7ba6deab5da0 100644 --- a/onnxruntime/core/framework/tensor_allocator.h +++ b/onnxruntime/core/framework/tensor_allocator.h @@ -7,7 +7,7 @@ #include #include #include -#include +#include "core/graph/onnx_protobuf.h" #include #include #include "execution_plan_base.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc index d5c73fdc88a2a..fd1720d69eebd 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/LRN_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc index f55d5757d8c21..5874eb1e7dc3b 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/batchnorm_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc index 771430b56ca7f..91d1a38e71e6f 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/binary_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc index 88af8ba96c76b..03329b9159c06 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/cast_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc index c078aebb966a5..becd677e32ac1 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/clip_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc index deea532b57790..fa5e292be0ecd 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/concat_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc index 789efed9c6727..a7a837ae210b4 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/conv_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc index dc79682ab1b5b..039d8510bb8d2 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/depthtospace_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc index c99810d1f603a..ed9062f894660 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/dequantizelinear_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc index f4bc9928c4ab1..fc2348951edb7 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/elu_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc index a4c731de577cf..986ce78fb1acc 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/flatten_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc index 72e0eceb60e9e..ccd3f8b571fcb 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gather_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc index a3c2f0e957d92..cff96c2f1ff99 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/gemm_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc index 5751f93b2f015..250b190091a52 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/identity_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc index 19044bf7fb7a0..e3dcee1e3d597 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/leakyrelu_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/framework/tensorprotoutils.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc index d7339a7c2c349..a80742aef9cb6 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/minmax_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc index 8d586056ad615..8127de0a0f05f 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pad_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc index 8505a858d7686..10c5efb84ed8f 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/pool_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc index 83b0cad4124de..eb81f5e3f59ee 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/quantizelinear_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc index 8f1baa86e8bdb..fbb353f949f48 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reduction_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc index ac7e2f7a95571..d65c069851c1f 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/relu_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc index f15365aa39f2b..fad5d8289c6b0 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/reshape_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc index fc84c91f14d4a..af5aeba6c8236 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/resize_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc index 925947cccc7c6..52b075b0271ef 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/slice_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc index 1618cb5c234eb..8fa915de95a72 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/softmax_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc index 820d7e0324723..7509fd15f1c5e 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/split_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include #include "core/common/logging/logging.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc index 28db46acc736a..44510c33c004c 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/squeeze_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc index d9860de9317c9..4a9e3eb00a787 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/transpose_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc index 58a0512cd6053..77df9d2fd771c 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unary_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc index 3ece362e48724..b9ebbace8d391 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/impl/unsqueeze_op_builder.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include "core/common/logging/logging.h" #include "core/common/safeint.h" diff --git a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h index 089904c9d559f..3cbf7d1ee40e8 100644 --- a/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h +++ b/onnxruntime/core/providers/nnapi/nnapi_builtin/builders/model_builder.h @@ -2,7 +2,7 @@ // Licensed under the MIT License. #pragma once -#include +#include "core/graph/onnx_protobuf.h" #include #include "core/common/inlined_containers_fwd.h" diff --git a/onnxruntime/core/providers/rknpu/node_attr_helper.h b/onnxruntime/core/providers/rknpu/node_attr_helper.h index 0b9f5d5b71662..76a0c721f70aa 100644 --- a/onnxruntime/core/providers/rknpu/node_attr_helper.h +++ b/onnxruntime/core/providers/rknpu/node_attr_helper.h @@ -4,7 +4,7 @@ #pragma once -#include +#include "core/graph/onnx_protobuf.h" #include #include diff --git a/onnxruntime/core/providers/rknpu/onnx_converter.h b/onnxruntime/core/providers/rknpu/onnx_converter.h index 379cf39c0863c..10cc09a9dba92 100644 --- a/onnxruntime/core/providers/rknpu/onnx_converter.h +++ b/onnxruntime/core/providers/rknpu/onnx_converter.h @@ -2,7 +2,7 @@ #pragma once -#include +#include "core/graph/onnx_protobuf.h" #include #include diff --git a/onnxruntime/test/onnx/microbenchmark/batchnorm2.cc b/onnxruntime/test/onnx/microbenchmark/batchnorm2.cc index ed1dc808871ec..a8a2f09dfda5a 100644 --- a/onnxruntime/test/onnx/microbenchmark/batchnorm2.cc +++ b/onnxruntime/test/onnx/microbenchmark/batchnorm2.cc @@ -1,5 +1,5 @@ -#include +#include "core/graph/onnx_protobuf.h" #include #include #include "core/platform/threadpool.h" diff --git a/onnxruntime/test/onnx/microbenchmark/main.cc b/onnxruntime/test/onnx/microbenchmark/main.cc index 70faa6f11989d..2c0955c4debee 100644 --- a/onnxruntime/test/onnx/microbenchmark/main.cc +++ b/onnxruntime/test/onnx/microbenchmark/main.cc @@ -2,7 +2,7 @@ // Licensed under the MIT License. #include -#include +#include "core/graph/onnx_protobuf.h" #include #include #include diff --git a/onnxruntime/test/onnx/microbenchmark/pooling.cc b/onnxruntime/test/onnx/microbenchmark/pooling.cc index bf3194576d804..59d7bfa5723f8 100644 --- a/onnxruntime/test/onnx/microbenchmark/pooling.cc +++ b/onnxruntime/test/onnx/microbenchmark/pooling.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include +#include "core/graph/onnx_protobuf.h" #include #include #include From 67bb67acb4854607c805cbe31b6f40f9a6719870 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 21 Jan 2025 20:42:46 +0000 Subject: [PATCH 12/43] Use the same lib --- cmake/external/abseil-cpp.cmake | 8 +++++++- cmake/external/onnxruntime_external_deps.cmake | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake index 1bb59adce8ecc..98310d4dac4e0 100644 --- a/cmake/external/abseil-cpp.cmake +++ b/cmake/external/abseil-cpp.cmake @@ -33,7 +33,13 @@ onnxruntime_fetchcontent_declare( onnxruntime_fetchcontent_makeavailable(abseil_cpp) FetchContent_GetProperties(abseil_cpp) -set(ABSEIL_SOURCE_DIR ${abseil_cpp_SOURCE_DIR}) +if(abseil_cpp_SOURCE_DIR) + set(ABSEIL_SOURCE_DIR ${abseil_cpp_SOURCE_DIR}) + if(onnxruntime_USE_WEBGPU) + set(DAWN_ABSEIL_DIR ${abseil_cpp_SOURCE_DIR}) + endif() +endif() + # abseil_cpp_SOURCE_DIR is non-empty if we build it from source message(STATUS "Abseil source dir:" ${ABSEIL_SOURCE_DIR}) # abseil_cpp_VERSION is non-empty if we find a preinstalled ABSL diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index 43b1c2085981f..d13bef89fa91c 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -228,6 +228,11 @@ onnxruntime_fetchcontent_makeavailable(Protobuf) if(Protobuf_FOUND) message(STATUS "Protobuf version: ${Protobuf_VERSION}") else() + if(protobuf_SOURCE_DIR) + if(onnxruntime_USE_WEBGPU) + set(DAWN_PROTOBUF_DIR ${protobuf_SOURCE_DIR}) + endif() + endif() # Adjust warning flags if (TARGET libprotoc) if (NOT MSVC) From e5e2a286149ded21a723ad96e887188330b86715 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Tue, 21 Jan 2025 20:48:31 +0000 Subject: [PATCH 13/43] update --- tools/ci_build/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index d4dc6c0d349b0..a26b4eb5ee9ea 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -2611,7 +2611,7 @@ def main(): print(args) - if args.build_wasm or args.use_webgpu: + if args.build_wasm: # No custom triplet for the wasm builds yet args.use_vcpkg = False elif args.minimal_build is not None: From ce10f37bf42ae95b0962ad2fc896c8912a125b36 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Wed, 22 Jan 2025 04:33:31 +0000 Subject: [PATCH 14/43] webgpu change --- tools/ci_build/build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index a26b4eb5ee9ea..377cc8f5982f9 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -2622,6 +2622,9 @@ def main(): elif args.use_extensions: # ORT extension no longer supports combined build, except for WASM. Due to dependency version conflicts args.use_vcpkg = False + elif args.use_webgpu and is_windows(): + # We have a special build patch for DirectML, which is Windows only. And the patch does not work good + args.use_vcpkg = False if os.getenv("ORT_BUILD_WITH_CACHE") == "1": args.use_cache = True From 3663a536c3a7140a808bf5b409ab7ff3159ae568 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Wed, 22 Jan 2025 21:24:26 +0000 Subject: [PATCH 15/43] update --- .../external/onnxruntime_external_deps.cmake | 35 +++++++++++----- cmake/onnxruntime_providers_coreml.cmake | 40 ++----------------- 2 files changed, 28 insertions(+), 47 deletions(-) diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index 75aeeb7b2b29e..ab3c3789ce2b9 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -613,17 +613,6 @@ if(onnxruntime_ENABLE_TRAINING OR (onnxruntime_ENABLE_TRAINING_APIS AND onnxrunt onnxruntime_fetchcontent_makeavailable(cxxopts) endif() -if (onnxruntime_USE_COREML) - 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) -endif() if (onnxruntime_USE_WEBGPU) if (onnxruntime_CUSTOM_DAWN_SRC_PATH) @@ -741,6 +730,30 @@ if (onnxruntime_USE_WEBGPU) endif() endif() +if(onnxruntime_USE_COREML) + # Setup coremltools fp16 and json dependencies for creating an mlpackage. + # + # 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) + + 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) + +endif() + set(onnxruntime_LINK_DIRS) if (onnxruntime_USE_CUDA) find_package(CUDAToolkit REQUIRED) diff --git a/cmake/onnxruntime_providers_coreml.cmake b/cmake/onnxruntime_providers_coreml.cmake index de74396e9da9b..b727eff06f1a9 100644 --- a/cmake/onnxruntime_providers_coreml.cmake +++ b/cmake/onnxruntime_providers_coreml.cmake @@ -6,27 +6,7 @@ if (onnxruntime_MINIMAL_BUILD AND NOT onnxruntime_EXTENDED_MINIMAL_BUILD) 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() +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 +73,6 @@ 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 +99,7 @@ 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,22 +153,11 @@ 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. - # - # fp16 depends on psimd - 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) + onnxruntime_add_include_to_target(onnxruntime_providers_coreml nlohmann_json::nlohmann_json) # 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} ${coremltools_SOURCE_DIR}/mlmodel/src/ ${coremltools_SOURCE_DIR}/modelpackage/src/ @@ -200,7 +168,7 @@ if (_enable_ML_PROGRAM) if (LINUX) target_link_libraries(onnxruntime_providers_coreml PRIVATE uuid) endif() -endif() + if (APPLE) target_link_libraries(onnxruntime_providers_coreml PRIVATE "-framework Foundation" "-framework CoreML") From 9faa9f9bf2ce35ebf9225d2be0054fca8eab999b Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 23 Jan 2025 04:21:51 +0000 Subject: [PATCH 16/43] update --- cmake/CMakeLists.txt | 2 +- cmake/onnxruntime_providers_coreml.cmake | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 1c697c8c3b8a4..92dee1dc2163e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1125,7 +1125,7 @@ function(onnxruntime_set_compile_flags target_name) endforeach() if(VCPKG_INSTALLED_DIR) cmake_path(NATIVE_PATH VCPKG_INSTALLED_DIR NORMALIZE VCPKG_INSTALLED_DIR_native) - target_compile_options(${target_name} PRIVATE "$<$:SHELL:/external:I ${VCPKG_INSTALLED_DIR}>") + target_compile_options(${target_name} PRIVATE "$<$:SHELL:/external:I ${VCPKG_INSTALLED_DIR_native}>") endif() foreach(onnxruntime_external_lib IN LISTS onnxruntime_EXTERNAL_LIBRARIES) #TODO: the list contains cmake keywords like "debug". We should exclude them. diff --git a/cmake/onnxruntime_providers_coreml.cmake b/cmake/onnxruntime_providers_coreml.cmake index b727eff06f1a9..ac8d0c5133de7 100644 --- a/cmake/onnxruntime_providers_coreml.cmake +++ b/cmake/onnxruntime_providers_coreml.cmake @@ -142,9 +142,11 @@ onnxruntime_add_static_library(onnxruntime_providers_coreml onnxruntime_add_include_to_target(onnxruntime_providers_coreml onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11 - safeint_interface + safeint_interface nlohmann_json::nlohmann_json ) - +if(VCPKG_INSTALLED_DIR) + target_include_directories(onnxruntime_providers_coreml PRIVATE ${VCPKG_INSTALLED_DIR}/include/nlohmann) +endif() onnxruntime_add_include_to_target(onnxruntime_providers_coreml coreml_proto) target_link_libraries(onnxruntime_providers_coreml PRIVATE coreml_proto) add_dependencies(onnxruntime_providers_coreml coreml_proto) @@ -154,7 +156,6 @@ if (APPLE) endif() - onnxruntime_add_include_to_target(onnxruntime_providers_coreml nlohmann_json::nlohmann_json) # 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 From 13a7d926e7e151036a048dba154b16f23d838e9b Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 23 Jan 2025 18:13:38 +0000 Subject: [PATCH 17/43] Upgrade cmake min version --- cmake/CMakeLists.txt | 14 ++---------- .../external/onnxruntime_external_deps.cmake | 5 ++++- cmake/external/pybind11.cmake | 1 + cmake/onnxruntime_providers_coreml.cmake | 22 ++++++++++++++++--- cmake/onnxruntime_python.cmake | 2 +- cmake/vcpkg-configuration.json | 2 +- 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 92dee1dc2163e..a6c070d43815c 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -3,20 +3,11 @@ # Licensed under the MIT License. # Minimum CMake required -cmake_minimum_required(VERSION 3.26) +cmake_minimum_required(VERSION 3.27) -cmake_policy(SET CMP0069 NEW) -set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) - -cmake_policy(SET CMP0092 NEW) -cmake_policy(SET CMP0091 NEW) -cmake_policy(SET CMP0117 NEW) # Don't let cmake set a default value for CMAKE_CUDA_ARCHITECTURES cmake_policy(SET CMP0104 OLD) -# Enable Hot Reload for MSVC compilers if supported. -cmake_policy(SET CMP0141 NEW) - # Project project(onnxruntime C CXX ASM) @@ -59,8 +50,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) # Enable CTest enable_testing() -include(Dart) - +include(CTest) if (NOT CMAKE_BUILD_TYPE) message(STATUS "Build type not set - using RelWithDebInfo") set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose build type: Debug Release RelWithDebInfo MinSizeRel." FORCE) diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index ab3c3789ce2b9..7c14b0885e14d 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -226,7 +226,7 @@ include(protobuf_function) onnxruntime_fetchcontent_makeavailable(Protobuf) if(Protobuf_FOUND) - message(STATUS "Protobuf version: ${Protobuf_VERSION}") + message(STATUS "Using protobuf from find_package(or vcpkg). Protobuf version: ${Protobuf_VERSION}") else() if(protobuf_SOURCE_DIR) if(onnxruntime_USE_WEBGPU) @@ -497,6 +497,9 @@ else() set(ONNXRUNTIME_ONNX_PATCH_COMMAND "") endif() +if(onnxruntime_ENABLE_PYTHON) + include(pybind11) +endif() onnxruntime_fetchcontent_declare( onnx URL ${DEP_URL_onnx} diff --git a/cmake/external/pybind11.cmake b/cmake/external/pybind11.cmake index 16ed3449e20f6..ffddd1beaf816 100644 --- a/cmake/external/pybind11.cmake +++ b/cmake/external/pybind11.cmake @@ -1,3 +1,4 @@ +set(PYBIND11_NOPYTHON ON CACHE BOOL "" FORCE) onnxruntime_fetchcontent_declare( pybind11_project URL ${DEP_URL_pybind11} diff --git a/cmake/onnxruntime_providers_coreml.cmake b/cmake/onnxruntime_providers_coreml.cmake index ac8d0c5133de7..94ebc39217198 100644 --- a/cmake/onnxruntime_providers_coreml.cmake +++ b/cmake/onnxruntime_providers_coreml.cmake @@ -144,9 +144,26 @@ onnxruntime_add_include_to_target(onnxruntime_providers_coreml onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11 safeint_interface nlohmann_json::nlohmann_json ) -if(VCPKG_INSTALLED_DIR) - target_include_directories(onnxruntime_providers_coreml PRIVATE ${VCPKG_INSTALLED_DIR}/include/nlohmann) + +# In ONNX Runtime's code, when we need to use the json library, we have: `#include "nlohmann/json.hpp"`. +# But, coremltool's code includes the json.hpp directly without the folder name: `#include "json.hpp"`. +# Therefore here we need to tweak INCLUDE_DIRECTORIES a little bit to fix that. + +if(nlohmann_json_SOURCE_DIR) + target_include_directories(onnxruntime_providers_coreml PRIVATE ${nlohmann_json_SOURCE_DIR}/single_include/nlohmann) +elif(TARGET nlohmann_json::nlohmann_json) + get_target_property(nlohmann_json_include_dirs INTERFACE_INCLUDE_DIRECTORIES nlohmann_json::nlohmann_json) + foreach(nlohmann_json_include_dir IN LISTS nlohmann_json_include_dirs){ + target_include_directories(onnxruntime_providers_coreml PRIVATE "${nlohmann_json_include_dir}/nlohmann") + } endif() + +if(fp16_SOURCE_DIR) + target_include_directories(onnxruntime_providers_coreml PRIVATE ${fp16_SOURCE_DIR}/include) +else() + message(FATAL_ERROR "Cannot find fp16's source code") +endif() + onnxruntime_add_include_to_target(onnxruntime_providers_coreml coreml_proto) target_link_libraries(onnxruntime_providers_coreml PRIVATE coreml_proto) add_dependencies(onnxruntime_providers_coreml coreml_proto) @@ -158,7 +175,6 @@ endif() # 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 ${coremltools_SOURCE_DIR} ${coremltools_SOURCE_DIR}/mlmodel/src/ ${coremltools_SOURCE_DIR}/modelpackage/src/ diff --git a/cmake/onnxruntime_python.cmake b/cmake/onnxruntime_python.cmake index 15a2862cede0c..de82eabcec3d9 100644 --- a/cmake/onnxruntime_python.cmake +++ b/cmake/onnxruntime_python.cmake @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -include(pybind11) + # ---[ Python + Numpy set(onnxruntime_pybind_srcs_pattern diff --git a/cmake/vcpkg-configuration.json b/cmake/vcpkg-configuration.json index a9f3fb4a93ff0..951816551af98 100644 --- a/cmake/vcpkg-configuration.json +++ b/cmake/vcpkg-configuration.json @@ -2,7 +2,7 @@ "default-registry": { "kind": "git", "repository": "https://github.com/Microsoft/vcpkg", - "baseline": "96dbba1e03d1ecc7c7096e97d5a09ff3c58e21df" + "baseline": "01be99fec01f777c4113ceea192a45115c69cdb7" }, "overlay-ports": [ "./vcpkg-ports" From 5bc8031527f961585b3239e697322834f54e9eb9 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 23 Jan 2025 13:49:07 -0800 Subject: [PATCH 18/43] update --- cmake/onnxruntime_providers_coreml.cmake | 4 ++-- tools/ci_build/build.py | 30 +++++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/cmake/onnxruntime_providers_coreml.cmake b/cmake/onnxruntime_providers_coreml.cmake index 94ebc39217198..3bc5e93190cf7 100644 --- a/cmake/onnxruntime_providers_coreml.cmake +++ b/cmake/onnxruntime_providers_coreml.cmake @@ -153,9 +153,9 @@ if(nlohmann_json_SOURCE_DIR) target_include_directories(onnxruntime_providers_coreml PRIVATE ${nlohmann_json_SOURCE_DIR}/single_include/nlohmann) elif(TARGET nlohmann_json::nlohmann_json) get_target_property(nlohmann_json_include_dirs INTERFACE_INCLUDE_DIRECTORIES nlohmann_json::nlohmann_json) - foreach(nlohmann_json_include_dir IN LISTS nlohmann_json_include_dirs){ + foreach(nlohmann_json_include_dir IN LISTS nlohmann_json_include_dirs) target_include_directories(onnxruntime_providers_coreml PRIVATE "${nlohmann_json_include_dir}/nlohmann") - } + endforeach() endif() if(fp16_SOURCE_DIR) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 758367594b5e9..2518f7d437ca1 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -485,6 +485,12 @@ def convert_arg_line_to_args(self, arg_line): default="VCPKG_INSTALLATION_ROOT" in os.environ, help="Use vcpkg to search dependencies. Requires CMAKE_TOOLCHAIN_FILE for vcpkg.cmake", ) + + parser.add_argument( + "--use_vcpkg_asset_cache", + action="store_true", + help="An internal flag. Microsoft only.", + ) # WebAssembly build parser.add_argument("--build_wasm", action="store_true", help="Build for WebAssembly") @@ -1130,13 +1136,26 @@ def generate_build_tree( # TODO: set VCPKG_PLATFORM_TOOLSET_VERSION # Setup CMake flags for vcpkg vcpkg_install_options = ["--x-feature=tests"] + + # Find VCPKG's toolchain cmake file + vcpkg_cmd_path = shutil.which("vcpkg") + vcpkg_toolchain_path = None + if vcpkg_cmd_path is not None: + vcpkg_toolchain_path = Path(vcpkg_cmd_path).parent / "scripts" / "buildsystems"/ "vcpkg.cmake" + if not vcpkg_toolchain_path.exists(): + if is_windows(): + raise BuildError("Cannot find VCPKG's toolchain cmake file. Please check if your vcpkg command was provided by Visual Studio") + # Fallback to the next + vcpkg_toolchain_path = None + # Fallback to use the "VCPKG_INSTALLATION_ROOT" env var vcpkg_installation_root = os.environ.get("VCPKG_INSTALLATION_ROOT") if vcpkg_installation_root is None: + # Fallback to checkout vcpkg from github vcpkg_installation_root = os.path.join(os.path.abspath(build_dir), "vcpkg") if not os.path.exists(vcpkg_installation_root): run_subprocess(["git", "clone", "https://github.com/microsoft/vcpkg.git", "--recursive"], cwd=build_dir) - vcpkg_toolchain_path = os.path.join(vcpkg_installation_root, "scripts", "buildsystems", "vcpkg.cmake") - add_default_definition(cmake_extra_defines, "CMAKE_TOOLCHAIN_FILE", vcpkg_toolchain_path) + vcpkg_toolchain_path = Path(vcpkg_cmd_path).parent / "scripts" / "buildsystems"/ "vcpkg.cmake" + add_default_definition(cmake_extra_defines, "CMAKE_TOOLCHAIN_FILE", str(vcpkg_toolchain_path)) overlay_triplets_dir = None # The enable_address_sanitizer and use_binskim_compliant_compile_flags flags cannot be both enabled if args.enable_address_sanitizer: @@ -1152,7 +1171,11 @@ def generate_build_tree( if overlay_triplets_dir is None: overlay_triplets_dir = os.path.join(source_dir, "cmake", "vcpkg-triplets", "default") vcpkg_install_options.append(f"--overlay-triplets={overlay_triplets_dir}") - + if args.use_vcpkg_asset_cache: + terrapin_cmd_path = shutil.which("TerrapinRetrievalTool") + + vcpkg_install_options.append("--x-asset-sources=x-script," + terrapin_cmd_path + " -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a true -u Environment -p {url} -s {sha512} -d {dst}\\;x-block-origin") + # VCPKG_INSTALL_OPTIONS is a CMake list. It must be joined by semicolons add_default_definition(cmake_extra_defines, "VCPKG_INSTALL_OPTIONS", ";".join(vcpkg_install_options)) # Choose the cmake triplet @@ -2651,6 +2674,7 @@ def main(): # We have a special build patch for DirectML, which is Windows only. And the patch does not work good args.use_vcpkg = False + if os.getenv("ORT_BUILD_WITH_CACHE") == "1": args.use_cache = True From 4c3c2c14a4103fbae133ed2d75250f16d56ba85b Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 23 Jan 2025 14:35:23 -0800 Subject: [PATCH 19/43] update --- cmake/vcpkg-ports/xnnpack/vcpkg.json | 1 - cmake/vcpkg.json | 5 ++++- tools/ci_build/build.py | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cmake/vcpkg-ports/xnnpack/vcpkg.json b/cmake/vcpkg-ports/xnnpack/vcpkg.json index 5e383c0b37810..6f2d6c322345b 100644 --- a/cmake/vcpkg-ports/xnnpack/vcpkg.json +++ b/cmake/vcpkg-ports/xnnpack/vcpkg.json @@ -4,7 +4,6 @@ "description": "High-efficiency floating-point neural network inference operators for mobile, server, and Web", "homepage": "https://github.com/google/XNNPACK", "license": "BSD-3-Clause", - "supports": "!(arm & windows) & !uwp & !arm32", "dependencies": [ "cpuinfo", "fxdiv", diff --git a/cmake/vcpkg.json b/cmake/vcpkg.json index cd503c93e7c65..351728d475ac1 100644 --- a/cmake/vcpkg.json +++ b/cmake/vcpkg.json @@ -62,7 +62,10 @@ "name": "wil", "platform": "windows" }, - "xnnpack", + { + "name": "xnnpack", + "platform": "!windows | x64" + }, { "name": "zlib", "platform": "windows" diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 2518f7d437ca1..3d5cb575a91b0 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1154,7 +1154,7 @@ def generate_build_tree( vcpkg_installation_root = os.path.join(os.path.abspath(build_dir), "vcpkg") if not os.path.exists(vcpkg_installation_root): run_subprocess(["git", "clone", "https://github.com/microsoft/vcpkg.git", "--recursive"], cwd=build_dir) - vcpkg_toolchain_path = Path(vcpkg_cmd_path).parent / "scripts" / "buildsystems"/ "vcpkg.cmake" + vcpkg_toolchain_path = Path(vcpkg_installation_root) / "scripts" / "buildsystems"/ "vcpkg.cmake" add_default_definition(cmake_extra_defines, "CMAKE_TOOLCHAIN_FILE", str(vcpkg_toolchain_path)) overlay_triplets_dir = None # The enable_address_sanitizer and use_binskim_compliant_compile_flags flags cannot be both enabled @@ -1184,6 +1184,10 @@ def generate_build_tree( triplet = "wasm32-emscripten" elif is_windows(): target_arch = platform.machine() + if args.arm64: + target_arch = "ARM64" + elif args.arm64: + target_arch = "ARM64EC" cpu_arch = platform.architecture()[0] if target_arch == "AMD64": if cpu_arch == "32bit" or args.x86: @@ -1192,6 +1196,8 @@ def generate_build_tree( triplet = "x64-windows-static" if args.enable_msvc_static_runtime else "x64-windows-static-md" elif target_arch == "ARM64": triplet = "arm64-windows-static" if args.enable_msvc_static_runtime else "arm64-windows-static-md" + elif target_arch == "ARM64EC": + triplet = "arm64ec-windows-static" if args.enable_msvc_static_runtime else "arm64ec-windows-static-md" else: raise BuildError("unknown python arch") if triplet: From 8ecda669a8962ea99da91c09550ccc5314fc2906 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 23 Jan 2025 15:12:05 -0800 Subject: [PATCH 20/43] update --- cmake/CMakeLists.txt | 2 +- cmake/onnxruntime_providers_coreml.cmake | 2 +- tools/ci_build/build.py | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index a6c070d43815c..3815f235b2641 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -3,7 +3,7 @@ # Licensed under the MIT License. # Minimum CMake required -cmake_minimum_required(VERSION 3.27) +cmake_minimum_required(VERSION 3.26) # Don't let cmake set a default value for CMAKE_CUDA_ARCHITECTURES cmake_policy(SET CMP0104 OLD) diff --git a/cmake/onnxruntime_providers_coreml.cmake b/cmake/onnxruntime_providers_coreml.cmake index 3bc5e93190cf7..eb6050b6c02e5 100644 --- a/cmake/onnxruntime_providers_coreml.cmake +++ b/cmake/onnxruntime_providers_coreml.cmake @@ -151,7 +151,7 @@ onnxruntime_add_include_to_target(onnxruntime_providers_coreml if(nlohmann_json_SOURCE_DIR) target_include_directories(onnxruntime_providers_coreml PRIVATE ${nlohmann_json_SOURCE_DIR}/single_include/nlohmann) -elif(TARGET nlohmann_json::nlohmann_json) +elseif(TARGET nlohmann_json::nlohmann_json) get_target_property(nlohmann_json_include_dirs INTERFACE_INCLUDE_DIRECTORIES nlohmann_json::nlohmann_json) foreach(nlohmann_json_include_dir IN LISTS nlohmann_json_include_dirs) target_include_directories(onnxruntime_providers_coreml PRIVATE "${nlohmann_json_include_dir}/nlohmann") diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 3d5cb575a91b0..a816248a470a0 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1173,8 +1173,12 @@ def generate_build_tree( vcpkg_install_options.append(f"--overlay-triplets={overlay_triplets_dir}") if args.use_vcpkg_asset_cache: terrapin_cmd_path = shutil.which("TerrapinRetrievalTool") - - vcpkg_install_options.append("--x-asset-sources=x-script," + terrapin_cmd_path + " -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a true -u Environment -p {url} -s {sha512} -d {dst}\\;x-block-origin") + if terrapin_cmd_path is None: + terrapin_cmd_path = "C:\\local\Terrapin\\TerrapinRetrievalTool.exe" + if not os.path.exists(terrapin_cmd_path) + terrapin_cmd_path = None + if terrapin_cmd_path is not None: + vcpkg_install_options.append("--x-asset-sources=x-script," + terrapin_cmd_path + " -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a true -u Environment -p {url} -s {sha512} -d {dst}\\;x-block-origin") # VCPKG_INSTALL_OPTIONS is a CMake list. It must be joined by semicolons add_default_definition(cmake_extra_defines, "VCPKG_INSTALL_OPTIONS", ";".join(vcpkg_install_options)) From bf7da9f297a54fe7084980d684c90723653349cc Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 23 Jan 2025 15:34:56 -0800 Subject: [PATCH 21/43] update --- tools/ci_build/build.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index a816248a470a0..abb7a96d81a82 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -485,12 +485,6 @@ def convert_arg_line_to_args(self, arg_line): default="VCPKG_INSTALLATION_ROOT" in os.environ, help="Use vcpkg to search dependencies. Requires CMAKE_TOOLCHAIN_FILE for vcpkg.cmake", ) - - parser.add_argument( - "--use_vcpkg_asset_cache", - action="store_true", - help="An internal flag. Microsoft only.", - ) # WebAssembly build parser.add_argument("--build_wasm", action="store_true", help="Build for WebAssembly") @@ -1171,13 +1165,12 @@ def generate_build_tree( if overlay_triplets_dir is None: overlay_triplets_dir = os.path.join(source_dir, "cmake", "vcpkg-triplets", "default") vcpkg_install_options.append(f"--overlay-triplets={overlay_triplets_dir}") - if args.use_vcpkg_asset_cache: - terrapin_cmd_path = shutil.which("TerrapinRetrievalTool") - if terrapin_cmd_path is None: + terrapin_cmd_path = shutil.which("TerrapinRetrievalTool") + if terrapin_cmd_path is None: terrapin_cmd_path = "C:\\local\Terrapin\\TerrapinRetrievalTool.exe" - if not os.path.exists(terrapin_cmd_path) + if not os.path.exists(terrapin_cmd_path): terrapin_cmd_path = None - if terrapin_cmd_path is not None: + if terrapin_cmd_path is not None: vcpkg_install_options.append("--x-asset-sources=x-script," + terrapin_cmd_path + " -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a true -u Environment -p {url} -s {sha512} -d {dst}\\;x-block-origin") # VCPKG_INSTALL_OPTIONS is a CMake list. It must be joined by semicolons From 61b3b730a0781faae7a673c20f60e391c42fe014 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 23 Jan 2025 23:35:48 +0000 Subject: [PATCH 22/43] format code --- tools/ci_build/build.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index abb7a96d81a82..d2e214f2b358f 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1130,15 +1130,17 @@ def generate_build_tree( # TODO: set VCPKG_PLATFORM_TOOLSET_VERSION # Setup CMake flags for vcpkg vcpkg_install_options = ["--x-feature=tests"] - + # Find VCPKG's toolchain cmake file vcpkg_cmd_path = shutil.which("vcpkg") vcpkg_toolchain_path = None if vcpkg_cmd_path is not None: - vcpkg_toolchain_path = Path(vcpkg_cmd_path).parent / "scripts" / "buildsystems"/ "vcpkg.cmake" + vcpkg_toolchain_path = Path(vcpkg_cmd_path).parent / "scripts" / "buildsystems" / "vcpkg.cmake" if not vcpkg_toolchain_path.exists(): if is_windows(): - raise BuildError("Cannot find VCPKG's toolchain cmake file. Please check if your vcpkg command was provided by Visual Studio") + raise BuildError( + "Cannot find VCPKG's toolchain cmake file. Please check if your vcpkg command was provided by Visual Studio" + ) # Fallback to the next vcpkg_toolchain_path = None # Fallback to use the "VCPKG_INSTALLATION_ROOT" env var @@ -1148,7 +1150,7 @@ def generate_build_tree( vcpkg_installation_root = os.path.join(os.path.abspath(build_dir), "vcpkg") if not os.path.exists(vcpkg_installation_root): run_subprocess(["git", "clone", "https://github.com/microsoft/vcpkg.git", "--recursive"], cwd=build_dir) - vcpkg_toolchain_path = Path(vcpkg_installation_root) / "scripts" / "buildsystems"/ "vcpkg.cmake" + vcpkg_toolchain_path = Path(vcpkg_installation_root) / "scripts" / "buildsystems" / "vcpkg.cmake" add_default_definition(cmake_extra_defines, "CMAKE_TOOLCHAIN_FILE", str(vcpkg_toolchain_path)) overlay_triplets_dir = None # The enable_address_sanitizer and use_binskim_compliant_compile_flags flags cannot be both enabled @@ -1167,12 +1169,16 @@ def generate_build_tree( vcpkg_install_options.append(f"--overlay-triplets={overlay_triplets_dir}") terrapin_cmd_path = shutil.which("TerrapinRetrievalTool") if terrapin_cmd_path is None: - terrapin_cmd_path = "C:\\local\Terrapin\\TerrapinRetrievalTool.exe" - if not os.path.exists(terrapin_cmd_path): - terrapin_cmd_path = None + terrapin_cmd_path = "C:\\local\\Terrapin\\TerrapinRetrievalTool.exe" + if not os.path.exists(terrapin_cmd_path): + terrapin_cmd_path = None if terrapin_cmd_path is not None: - vcpkg_install_options.append("--x-asset-sources=x-script," + terrapin_cmd_path + " -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a true -u Environment -p {url} -s {sha512} -d {dst}\\;x-block-origin") - + vcpkg_install_options.append( + "--x-asset-sources=x-script," + + terrapin_cmd_path + + " -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a true -u Environment -p {url} -s {sha512} -d {dst}\\;x-block-origin" + ) + # VCPKG_INSTALL_OPTIONS is a CMake list. It must be joined by semicolons add_default_definition(cmake_extra_defines, "VCPKG_INSTALL_OPTIONS", ";".join(vcpkg_install_options)) # Choose the cmake triplet @@ -2677,7 +2683,6 @@ def main(): # We have a special build patch for DirectML, which is Windows only. And the patch does not work good args.use_vcpkg = False - if os.getenv("ORT_BUILD_WITH_CACHE") == "1": args.use_cache = True From 75291b41799bc7b4c5b5d399bc572d73fd86c71a Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 23 Jan 2025 16:42:43 -0800 Subject: [PATCH 23/43] update --- cmake/onnxruntime_providers_coreml.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/onnxruntime_providers_coreml.cmake b/cmake/onnxruntime_providers_coreml.cmake index eb6050b6c02e5..2fa038776b0d8 100644 --- a/cmake/onnxruntime_providers_coreml.cmake +++ b/cmake/onnxruntime_providers_coreml.cmake @@ -152,7 +152,7 @@ onnxruntime_add_include_to_target(onnxruntime_providers_coreml if(nlohmann_json_SOURCE_DIR) target_include_directories(onnxruntime_providers_coreml PRIVATE ${nlohmann_json_SOURCE_DIR}/single_include/nlohmann) elseif(TARGET nlohmann_json::nlohmann_json) - get_target_property(nlohmann_json_include_dirs INTERFACE_INCLUDE_DIRECTORIES nlohmann_json::nlohmann_json) + get_target_property(nlohmann_json_include_dirs nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES) foreach(nlohmann_json_include_dir IN LISTS nlohmann_json_include_dirs) target_include_directories(onnxruntime_providers_coreml PRIVATE "${nlohmann_json_include_dir}/nlohmann") endforeach() From 1fb5ec15949d86787e573058f8a38175f4e92265 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 23 Jan 2025 16:46:26 -0800 Subject: [PATCH 24/43] update --- tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh b/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh index 4bc609fc0badb..67902d57761a7 100755 --- a/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh +++ b/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh @@ -52,7 +52,6 @@ PACKAGE_LIST=( "pkg-config" "python3-dev" "python3-distutils" - "python3-numpy" "python3-pip" "python3-pytest" "python3-setuptools" From 9089d8b38acf2e7e7c48eafa9bd3c92d7a0a5408 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 24 Jan 2025 01:21:32 +0000 Subject: [PATCH 25/43] Update patch --- .../coremltools/crossplatformbuild.patch | 67 ++++++++++++------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/cmake/patches/coremltools/crossplatformbuild.patch b/cmake/patches/coremltools/crossplatformbuild.patch index 7f2268f50c82e..8bff14942ce59 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,17 +12,30 @@ index adc7bfcf..7b2bf9cc 100644 #include #include +#endif - + using namespace MILBlob; using namespace MILBlob::Blob; +diff --git a/mlmodel/src/MILBlob/Blob/FileWriter.hpp b/mlmodel/src/MILBlob/Blob/FileWriter.hpp +index 2bc99403..8400fb76 100644 +--- a/mlmodel/src/MILBlob/Blob/FileWriter.hpp ++++ b/mlmodel/src/MILBlob/Blob/FileWriter.hpp +@@ -6,7 +6,7 @@ + #pragma once + + #include "MILBlob/Util/Span.hpp" +- ++#include + #include + #include + #include diff --git a/mlmodel/src/MILBlob/Fp16.cpp b/mlmodel/src/MILBlob/Fp16.cpp 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,11 +48,11 @@ 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 +index 8fee56b9..ec9d785e 100644 --- a/modelpackage/src/ModelPackage.cpp +++ b/modelpackage/src/ModelPackage.cpp @@ -26,7 +26,14 @@ namespace std { @@ -55,22 +68,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 +100,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 +@@ -468,7 +493,15 @@ 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)); @@ -108,12 +121,14 @@ index 8fee56b9..99e0d8d6 100644 +#else 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) +@@ -514,7 +547,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,8 +136,8 @@ 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) + +@@ -525,13 +560,16 @@ bool ModelPackageImpl::isValid(const std::filesystem::path& path) { try { ModelPackageImpl(path, false, true); @@ -132,16 +147,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() - +@@ -544,7 +582,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 +166,5 @@ 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) From 082da8bc66b9c12cc664b16a2621b4c347ba36a9 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 23 Jan 2025 17:22:09 -0800 Subject: [PATCH 26/43] update cmake --- cmake/vcpkg-ports/xnnpack/portfile.cmake | 7 +++---- cmake/vcpkg-ports/xnnpack/vcpkg.json | 2 +- tools/ci_build/build.py | 5 ++++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cmake/vcpkg-ports/xnnpack/portfile.cmake b/cmake/vcpkg-ports/xnnpack/portfile.cmake index b07da3186b4b4..f8a0a67527cd8 100644 --- a/cmake/vcpkg-ports/xnnpack/portfile.cmake +++ b/cmake/vcpkg-ports/xnnpack/portfile.cmake @@ -5,18 +5,17 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/XNNPACK - REF 854b343f9cad36bd596e4390959ca3648208e048 - SHA512 f37384b43022cb74bf87bd99c2e82e51d48fe4e0e4642611fcbc10cbb86ff2468b67964027f13f82a715dc7201c490d88d5020fb565ad236187b9dd219f3f644 + REF 953dcb96cc1b21b4b966952f8ee67a9e1f0d3e71 + SHA512 8c12930ef3b2f832962682d73c362518c014bb4e56d0c5cad2b8b63a03c91dccf6e6a3fd0eb91931fc5872c7df9773e76bf08553fc9c3cc22c94636c74815e94 HEAD_REF master PATCHES fix-build.patch - disable_gcc_warning.patch ) vcpkg_find_acquire_program(PYTHON3) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" - WINDOWS_USE_MSBUILD + WINDOWS_USE_MSBUILD OPTIONS "-DPython3_EXECUTABLE=${PYTHON3}" "-DPython_EXECUTABLE=${PYTHON3}" diff --git a/cmake/vcpkg-ports/xnnpack/vcpkg.json b/cmake/vcpkg-ports/xnnpack/vcpkg.json index 6f2d6c322345b..e0d0600902f36 100644 --- a/cmake/vcpkg-ports/xnnpack/vcpkg.json +++ b/cmake/vcpkg-ports/xnnpack/vcpkg.json @@ -1,6 +1,6 @@ { "name": "xnnpack", - "version-date": "2025-01-17", + "version-date": "2025-01-23", "description": "High-efficiency floating-point neural network inference operators for mobile, server, and Web", "homepage": "https://github.com/google/XNNPACK", "license": "BSD-3-Clause", diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index d2e214f2b358f..e524f36bd2e60 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1761,6 +1761,9 @@ def generate_build_tree( "-DCMAKE_MODULE_LINKER_FLAGS_INIT={}".format(" ".join(ldflags)), "-DCMAKE_SHARED_LINKER_FLAGS_INIT={}".format(" ".join(ldflags)), ] + env = {} + if args.use_vcpkg: + env["VCPKG_KEEP_ENV_VARS"]="TRT_UPLOAD_AUTH_TOKEN" run_subprocess( [ *temp_cmake_args, @@ -1772,7 +1775,7 @@ def generate_build_tree( ), ], cwd=config_build_dir, - cuda_home=cuda_home, + cuda_home=cuda_home, env=env ) From 1f0d72d63f459851a84adaf9650e2a31231df8af Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 24 Jan 2025 01:35:51 +0000 Subject: [PATCH 27/43] update --- cmake/patches/coremltools/crossplatformbuild.patch | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cmake/patches/coremltools/crossplatformbuild.patch b/cmake/patches/coremltools/crossplatformbuild.patch index 8bff14942ce59..bb69b5d2db4ed 100644 --- a/cmake/patches/coremltools/crossplatformbuild.patch +++ b/cmake/patches/coremltools/crossplatformbuild.patch @@ -52,7 +52,7 @@ index ae1e71a1..77a7161f 100644 using namespace MILBlob; diff --git a/modelpackage/src/ModelPackage.cpp b/modelpackage/src/ModelPackage.cpp -index 8fee56b9..ec9d785e 100644 +index 8fee56b9..5508e316 100644 --- a/modelpackage/src/ModelPackage.cpp +++ b/modelpackage/src/ModelPackage.cpp @@ -26,7 +26,14 @@ namespace std { @@ -110,7 +110,7 @@ index 8fee56b9..ec9d785e 100644 } ModelPackageItemInfo ModelPackageImpl::createFile(const std::string& name, const std::string& author, const std::string& description) { -@@ -468,7 +493,15 @@ std::shared_ptr ModelPackageImpl::findItem(const std::stri +@@ -468,7 +493,14 @@ std::shared_ptr ModelPackageImpl::findItem(const std::stri auto author = itemInfoEntry->getString(kModelPackageItemInfoAuthorKey); auto description = itemInfoEntry->getString(kModelPackageItemInfoDescriptionKey); @@ -121,12 +121,11 @@ index 8fee56b9..ec9d785e 100644 +#else 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 +547,9 @@ void ModelPackageImpl::removeItem(const std::string& identifier) +@@ -514,7 +546,9 @@ void ModelPackageImpl::removeItem(const std::string& identifier) } auto path = m_packageDataDirPath / itemInfoEntry->getString(kModelPackageItemInfoPathKey); @@ -137,7 +136,7 @@ index 8fee56b9..ec9d785e 100644 throw std::runtime_error("Failed to remove file at path: " + path.string()); } -@@ -525,13 +560,16 @@ bool ModelPackageImpl::isValid(const std::filesystem::path& path) +@@ -525,13 +559,16 @@ bool ModelPackageImpl::isValid(const std::filesystem::path& path) { try { ModelPackageImpl(path, false, true); @@ -155,7 +154,7 @@ index 8fee56b9..ec9d785e 100644 ModelPackage::ModelPackage(const std::string& packagePath, bool createIfNecessary, bool readOnly) : m_modelPackageImpl(std::make_shared(packagePath, createIfNecessary, readOnly)) -@@ -544,7 +582,12 @@ ModelPackage::~ModelPackage() +@@ -544,7 +581,12 @@ ModelPackage::~ModelPackage() std::string ModelPackage::path() const { From 785d6b63aa3718a57d75e2c510f800c6c1345859 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 24 Jan 2025 02:15:45 +0000 Subject: [PATCH 28/43] Add disable_gcc_warning.patch back --- cmake/vcpkg-ports/xnnpack/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/vcpkg-ports/xnnpack/portfile.cmake b/cmake/vcpkg-ports/xnnpack/portfile.cmake index f8a0a67527cd8..d63ad0fbd0cce 100644 --- a/cmake/vcpkg-ports/xnnpack/portfile.cmake +++ b/cmake/vcpkg-ports/xnnpack/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-build.patch + disable_gcc_warning.patch ) vcpkg_find_acquire_program(PYTHON3) From 59819c71fb05a7681de52755de9cb05544f439f3 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 24 Jan 2025 02:26:50 +0000 Subject: [PATCH 29/43] Update patch --- cmake/patches/coremltools/crossplatformbuild.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmake/patches/coremltools/crossplatformbuild.patch b/cmake/patches/coremltools/crossplatformbuild.patch index bb69b5d2db4ed..ddbed185bae61 100644 --- a/cmake/patches/coremltools/crossplatformbuild.patch +++ b/cmake/patches/coremltools/crossplatformbuild.patch @@ -167,3 +167,16 @@ index 8fee56b9..5508e316 100644 } 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..ba6a9d19 100644 +--- a/modelpackage/src/utils/JsonMap.hpp ++++ b/modelpackage/src/utils/JsonMap.hpp +@@ -10,7 +10,7 @@ + #include + #include + #include +- ++#include + class JsonMapImpl; + + class JsonMap { From 616ad5e14916b7d1fd1d65bb7f97280cbfd61159 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 24 Jan 2025 21:52:49 +0000 Subject: [PATCH 30/43] update --- cmake/external/pybind11.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/external/pybind11.cmake b/cmake/external/pybind11.cmake index ffddd1beaf816..42f77d417bb26 100644 --- a/cmake/external/pybind11.cmake +++ b/cmake/external/pybind11.cmake @@ -9,7 +9,9 @@ onnxruntime_fetchcontent_declare( onnxruntime_fetchcontent_makeavailable(pybind11_project) if(TARGET pybind11::module) + message("Setting pybind11_lib") set(pybind11_lib pybind11::module) else() + message("Setting pybind11_dep") set(pybind11_dep pybind11::pybind11) endif() From 74760493bde325870d75e99dbda777f2a1a66eff Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 24 Jan 2025 21:55:07 +0000 Subject: [PATCH 31/43] Set policy 148 to new --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 3815f235b2641..e4310edf9514e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.26) # Don't let cmake set a default value for CMAKE_CUDA_ARCHITECTURES cmake_policy(SET CMP0104 OLD) - +cmake_policy(SET CMP0148 NEW) # Project project(onnxruntime C CXX ASM) From 9f44b11549f0199ba42c8dd450ce43df5427db1e Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 24 Jan 2025 22:33:00 +0000 Subject: [PATCH 32/43] update --- .../ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml | 2 +- .../ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml | 4 ++-- .../github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml | 4 ++-- .../linux-gpu-tensorrt-cuda-minimal-ci-pipeline.yml | 4 ++-- .../azure-pipelines/py-cuda-alt-package-test-pipeline.yml | 2 +- .../github/azure-pipelines/py-cuda-package-test-pipeline.yml | 2 +- .../azure-pipelines/stages/java-cuda-packaging-stage.yml | 4 ++-- .../stages/jobs/py-linux-cuda-package-test-job.yml | 4 ++-- .../github/azure-pipelines/stages/py-gpu-packaging-stage.yml | 4 ++-- .../ci_build/github/linux/docker/Dockerfile.manylinux2_28_cpu | 2 +- .../linux/docker/inference/aarch64/default/cpu/Dockerfile | 2 +- .../linux/docker/inference/aarch64/python/cpu/Dockerfile | 2 +- .../linux/docker/inference/x86_64/default/cpu/Dockerfile | 2 +- .../linux/docker/inference/x86_64/default/cuda11/Dockerfile | 2 +- .../linux/docker/inference/x86_64/default/cuda12/Dockerfile | 2 +- .../linux/docker/inference/x86_64/python/cpu/Dockerfile | 2 +- 16 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml index 60e025353bf9f..9f62e6fb2af11 100644 --- a/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml @@ -41,7 +41,7 @@ parameters: variables: - name: docker_base_image - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250124.1 - name: linux_trt_version value: 10.3.0.26-1.cuda11.8 - name: Repository diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml index 518aec8c2f92a..71f7ab6e49b70 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml @@ -49,9 +49,9 @@ parameters: variables: - name: docker_base_image ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250124.1 ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250124.1 - name: Repository ${{ if eq(parameters.CudaVersion, '11.8') }}: diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml index 9025f084d5982..c08eaaaa1308d 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml @@ -40,9 +40,9 @@ variables: - template: templates/common-variables.yml - name: docker_base_image ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250124.1 ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250124.1 - name: linux_trt_version ${{ if eq(parameters.CudaVersion, '11.8') }}: value: ${{ variables.linux_trt_version_cuda11 }} diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-cuda-minimal-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-cuda-minimal-ci-pipeline.yml index 8d42e7201411b..4a86da167ff1f 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-cuda-minimal-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-cuda-minimal-ci-pipeline.yml @@ -40,9 +40,9 @@ variables: - template: templates/common-variables.yml - name: docker_base_image ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250124.1 ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250124.1 - name: linux_trt_version ${{ if eq(parameters.CudaVersion, '11.8') }}: value: ${{ variables.linux_trt_version_cuda11 }} diff --git a/tools/ci_build/github/azure-pipelines/py-cuda-alt-package-test-pipeline.yml b/tools/ci_build/github/azure-pipelines/py-cuda-alt-package-test-pipeline.yml index 4b94ffc7e302e..960b59f93bee0 100644 --- a/tools/ci_build/github/azure-pipelines/py-cuda-alt-package-test-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/py-cuda-alt-package-test-pipeline.yml @@ -18,7 +18,7 @@ stages: machine_pool: 'Onnxruntime-Linux-GPU' python_wheel_suffix: '_gpu' timeout: 480 - docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250109.1 + docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250124.1 cuda_version: '11.8' - stage: Republish_Wheels diff --git a/tools/ci_build/github/azure-pipelines/py-cuda-package-test-pipeline.yml b/tools/ci_build/github/azure-pipelines/py-cuda-package-test-pipeline.yml index 48d1e6b1ac7a7..021f7c5ece140 100644 --- a/tools/ci_build/github/azure-pipelines/py-cuda-package-test-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/py-cuda-package-test-pipeline.yml @@ -18,7 +18,7 @@ stages: machine_pool: 'Onnxruntime-Linux-GPU' python_wheel_suffix: '_gpu' timeout: 480 - docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250109.1 + docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250124.1 cuda_version: '12.2' - stage: Republish_Wheels diff --git a/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml index 0517fec3bad04..b081b39ad9bcc 100644 --- a/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml @@ -142,9 +142,9 @@ stages: value: false - name: docker_base_image ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250124.1 ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250124.1 timeoutInMinutes: 60 steps: diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml index 4adf41d3db4e5..85366ffc28b3a 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml @@ -45,9 +45,9 @@ jobs: - template: ../../templates/common-variables.yml - name: docker_base_image ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250124.1 ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250109.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250124.1 - name: linux_trt_version ${{ if eq(parameters.CudaVersion, '11.8') }}: value: ${{ variables.linux_trt_version_cuda11 }} diff --git a/tools/ci_build/github/azure-pipelines/stages/py-gpu-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/py-gpu-packaging-stage.yml index a3c804055d8fb..f48573abd3dba 100644 --- a/tools/ci_build/github/azure-pipelines/stages/py-gpu-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/py-gpu-packaging-stage.yml @@ -68,9 +68,9 @@ stages: cmake_build_type: ${{ parameters.cmake_build_type }} cuda_version: ${{ parameters.cuda_version }} ${{ if eq(parameters.cuda_version, '11.8') }}: - docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250109.1 + docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20250124.1 ${{ if eq(parameters.cuda_version, '12.2') }}: - docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250109.1 + docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20250124.1 - ${{ if eq(parameters.enable_windows_dml, true) }}: - ${{ each python_version in parameters.PythonVersions }}: diff --git a/tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cpu b/tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cpu index 72912acce885e..02938f015ec57 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cpu +++ b/tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cpu @@ -1,4 +1,4 @@ -FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc14:20250109.1 +FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc14:20250124.1 ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-17 diff --git a/tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/Dockerfile b/tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/Dockerfile index 9569aa2fcda63..f9d84e3b0e130 100644 --- a/tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/Dockerfile +++ b/tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/Dockerfile @@ -2,7 +2,7 @@ # Licensed under the MIT License. # This file is used by Zip-Nuget Packaging NoContribOps Pipeline,Zip-Nuget-Java Packaging Pipeline -FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_aarch64_ubi8_gcc14_dotnet:20250109.1 +FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_aarch64_ubi8_gcc14_dotnet:20250124.1 ENV LANG=en_US.UTF-8 ENV LC_ALL=en_US.UTF-8 diff --git a/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/Dockerfile b/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/Dockerfile index 589bd869ba89f..20b9a6c224120 100644 --- a/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/Dockerfile +++ b/tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/Dockerfile @@ -1,4 +1,4 @@ -FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_aarch64_ubi8_gcc14:20250109.1 +FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_aarch64_ubi8_gcc14:20250124.1 ADD scripts /tmp/scripts RUN cd /tmp/scripts && /tmp/scripts/install_centos.sh && /tmp/scripts/install_deps.sh && rm -rf /tmp/scripts diff --git a/tools/ci_build/github/linux/docker/inference/x86_64/default/cpu/Dockerfile b/tools/ci_build/github/linux/docker/inference/x86_64/default/cpu/Dockerfile index 1c1f716d81e95..d94e7562f19d4 100644 --- a/tools/ci_build/github/linux/docker/inference/x86_64/default/cpu/Dockerfile +++ b/tools/ci_build/github/linux/docker/inference/x86_64/default/cpu/Dockerfile @@ -2,7 +2,7 @@ # Licensed under the MIT License. # This file is used by Zip-Nuget Packaging NoContribOps Pipeline,Zip-Nuget-Java Packaging Pipeline -FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc14_dotnet:20250109.1 +FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc14_dotnet:20250124.1 ENV LANG=en_US.UTF-8 ENV LC_ALL=en_US.UTF-8 diff --git a/tools/ci_build/github/linux/docker/inference/x86_64/default/cuda11/Dockerfile b/tools/ci_build/github/linux/docker/inference/x86_64/default/cuda11/Dockerfile index 6caf21c475545..24287fd34d3ea 100644 --- a/tools/ci_build/github/linux/docker/inference/x86_64/default/cuda11/Dockerfile +++ b/tools/ci_build/github/linux/docker/inference/x86_64/default/cuda11/Dockerfile @@ -2,7 +2,7 @@ # Licensed under the MIT License. # This file is used by Zip-Nuget Packaging NoContribOps Pipeline,Zip-Nuget-Java Packaging Pipeline -FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11_dotnet:20250109.1 +FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11_dotnet:20250124.1 ARG TRT_VERSION #Install TensorRT only if TRT_VERSION is not empty diff --git a/tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/Dockerfile b/tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/Dockerfile index a5dda5904de49..764a79135d7a3 100644 --- a/tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/Dockerfile +++ b/tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/Dockerfile @@ -2,7 +2,7 @@ # Licensed under the MIT License. # This file is used by Zip-Nuget Packaging NoContribOps Pipeline,Zip-Nuget-Java Packaging Pipeline -FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12_dotnet:20250109.1 +FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12_dotnet:20250124.1 ARG TRT_VERSION #Install TensorRT only if TRT_VERSION is not empty diff --git a/tools/ci_build/github/linux/docker/inference/x86_64/python/cpu/Dockerfile b/tools/ci_build/github/linux/docker/inference/x86_64/python/cpu/Dockerfile index 04c6398e061b7..7590d5dd18347 100644 --- a/tools/ci_build/github/linux/docker/inference/x86_64/python/cpu/Dockerfile +++ b/tools/ci_build/github/linux/docker/inference/x86_64/python/cpu/Dockerfile @@ -1,4 +1,4 @@ -FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc14:20250109.1 +FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_ubi8_gcc14:20250124.1 ADD scripts /tmp/scripts RUN cd /tmp/scripts && /tmp/scripts/install_centos.sh && rm -rf /tmp/scripts From c05c2e1caf3730e01703a2cf3b5b60f66613781b Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 24 Jan 2025 22:35:13 +0000 Subject: [PATCH 33/43] update --- tools/ci_build/build.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index e524f36bd2e60..4e2f3c9edf7c8 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1763,7 +1763,7 @@ def generate_build_tree( ] env = {} if args.use_vcpkg: - env["VCPKG_KEEP_ENV_VARS"]="TRT_UPLOAD_AUTH_TOKEN" + env["VCPKG_KEEP_ENV_VARS"] = "TRT_UPLOAD_AUTH_TOKEN" run_subprocess( [ *temp_cmake_args, @@ -1775,7 +1775,8 @@ def generate_build_tree( ), ], cwd=config_build_dir, - cuda_home=cuda_home, env=env + cuda_home=cuda_home, + env=env, ) From e11d1a83e27c7b6c46b79a9f6ea03bfb17382c36 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 24 Jan 2025 23:58:20 +0000 Subject: [PATCH 34/43] update --- cmake/patches/coremltools/crossplatformbuild.patch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/patches/coremltools/crossplatformbuild.patch b/cmake/patches/coremltools/crossplatformbuild.patch index ddbed185bae61..832191b366d4d 100644 --- a/cmake/patches/coremltools/crossplatformbuild.patch +++ b/cmake/patches/coremltools/crossplatformbuild.patch @@ -16,14 +16,15 @@ index adc7bfcf..7b2bf9cc 100644 using namespace MILBlob; using namespace MILBlob::Blob; diff --git a/mlmodel/src/MILBlob/Blob/FileWriter.hpp b/mlmodel/src/MILBlob/Blob/FileWriter.hpp -index 2bc99403..8400fb76 100644 +index 2bc99403..49239513 100644 --- a/mlmodel/src/MILBlob/Blob/FileWriter.hpp +++ b/mlmodel/src/MILBlob/Blob/FileWriter.hpp -@@ -6,7 +6,7 @@ +@@ -6,7 +6,8 @@ #pragma once #include "MILBlob/Util/Span.hpp" - ++// ORT_EDIT: add missing header +#include #include #include @@ -168,14 +169,15 @@ index 8fee56b9..5508e316 100644 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..ba6a9d19 100644 +index 0d7dc3f4..b700cfd5 100644 --- a/modelpackage/src/utils/JsonMap.hpp +++ b/modelpackage/src/utils/JsonMap.hpp -@@ -10,7 +10,7 @@ +@@ -10,7 +10,8 @@ #include #include #include - ++// ORT_EDIT: add missing header +#include class JsonMapImpl; From 4a643dda3d6add70429e5bc71c0c494fa1643f4c Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 25 Jan 2025 00:43:44 +0000 Subject: [PATCH 35/43] update --- tools/ci_build/build.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 4e2f3c9edf7c8..b23a0f003aff4 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1203,6 +1203,11 @@ def generate_build_tree( triplet = "arm64ec-windows-static" if args.enable_msvc_static_runtime else "arm64ec-windows-static-md" else: raise BuildError("unknown python arch") + elif is_macOS(): + for kvp in cmake_extra_args: + key,value = s.split('=') + if key == CMAKE_OSX_ARCHITECTURES and len(value.split(';')) == 2: + triplet = "universal2-osx" if triplet: add_default_definition(cmake_extra_defines, "VCPKG_TARGET_TRIPLET", triplet) From 881d525cd05d97bf009f0ae65f182ee4538cefb3 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 25 Jan 2025 02:35:17 +0000 Subject: [PATCH 36/43] update --- tools/ci_build/build.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index b23a0f003aff4..7f292373b0977 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1205,10 +1205,11 @@ def generate_build_tree( raise BuildError("unknown python arch") elif is_macOS(): for kvp in cmake_extra_args: - key,value = s.split('=') - if key == CMAKE_OSX_ARCHITECTURES and len(value.split(';')) == 2: + key, value = s.split("=") + if key == "CMAKE_OSX_ARCHITECTURES" and len(value.split(";")) == 2: triplet = "universal2-osx" if triplet: + log.info(f"setting target triplet to {triplet}") add_default_definition(cmake_extra_defines, "VCPKG_TARGET_TRIPLET", triplet) # By default on Windows we currently support only cross compiling for ARM/ARM64 @@ -1391,7 +1392,7 @@ def generate_build_tree( raise BuildError("You must set dml_path or dml_external_project when building with the GDK.") if is_macOS() and not args.android: - cmake_args += ["-DCMAKE_OSX_ARCHITECTURES=" + args.osx_arch] + add_default_definition(cmake_extra_defines, "CMAKE_OSX_ARCHITECTURES", args.osx_arch) if args.apple_deploy_target: cmake_args += ["-DCMAKE_OSX_DEPLOYMENT_TARGET=" + args.apple_deploy_target] # Code sign the binaries, if the code signing development identity and/or team id are provided From 579316f532549dff9ad23b635dbb15f99da44edd Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 25 Jan 2025 03:33:04 +0000 Subject: [PATCH 37/43] update --- tools/ci_build/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 7f292373b0977..f6e71b5701b7e 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1205,7 +1205,7 @@ def generate_build_tree( raise BuildError("unknown python arch") elif is_macOS(): for kvp in cmake_extra_args: - key, value = s.split("=") + key, value = kvp.split("=") if key == "CMAKE_OSX_ARCHITECTURES" and len(value.split(";")) == 2: triplet = "universal2-osx" if triplet: From 997c4e6a5e6f4d19ae256d91f7e730bdd3f1e104 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 25 Jan 2025 03:35:13 +0000 Subject: [PATCH 38/43] update --- cmake/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index e4310edf9514e..3a252a73a5466 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -7,7 +7,9 @@ cmake_minimum_required(VERSION 3.26) # Don't let cmake set a default value for CMAKE_CUDA_ARCHITECTURES cmake_policy(SET CMP0104 OLD) -cmake_policy(SET CMP0148 NEW) +if(POLICY CMP0148) + cmake_policy(SET CMP0148 NEW) +endif() # Project project(onnxruntime C CXX ASM) From 26c90ff6f7dc3217f04e0585acb1b8a8a68125b2 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 25 Jan 2025 03:50:57 +0000 Subject: [PATCH 39/43] update --- tools/ci_build/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index f6e71b5701b7e..c8ae247a34a28 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1206,7 +1206,7 @@ def generate_build_tree( elif is_macOS(): for kvp in cmake_extra_args: key, value = kvp.split("=") - if key == "CMAKE_OSX_ARCHITECTURES" and len(value.split(";")) == 2: + if key == "-DCMAKE_OSX_ARCHITECTURES" and len(value.split(";")) == 2: triplet = "universal2-osx" if triplet: log.info(f"setting target triplet to {triplet}") From 4f8d062805b351cda35871ed77b22ad2ab9b42b3 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 25 Jan 2025 04:00:51 +0000 Subject: [PATCH 40/43] update --- tools/ci_build/build.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index c8ae247a34a28..ac228a78ca5a4 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1205,7 +1205,11 @@ def generate_build_tree( raise BuildError("unknown python arch") elif is_macOS(): for kvp in cmake_extra_args: - key, value = kvp.split("=") + parts = kvp.split("=") + if len(parts) !=2: + continue + key = parts[0] + value = parts[1] if key == "-DCMAKE_OSX_ARCHITECTURES" and len(value.split(";")) == 2: triplet = "universal2-osx" if triplet: From 382a43d102fe1afdc313c1ca35aaac78322629a5 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 25 Jan 2025 04:11:33 +0000 Subject: [PATCH 41/43] update --- tools/ci_build/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index ac228a78ca5a4..bce96f2c44129 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1204,13 +1204,13 @@ def generate_build_tree( else: raise BuildError("unknown python arch") elif is_macOS(): - for kvp in cmake_extra_args: + for kvp in cmake_extra_defines: parts = kvp.split("=") if len(parts) !=2: continue key = parts[0] value = parts[1] - if key == "-DCMAKE_OSX_ARCHITECTURES" and len(value.split(";")) == 2: + if key == "CMAKE_OSX_ARCHITECTURES" and len(value.split(";")) == 2: triplet = "universal2-osx" if triplet: log.info(f"setting target triplet to {triplet}") From c1e8246ef3490dd02f35617716148e7b6580e9fd Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 25 Jan 2025 04:20:11 +0000 Subject: [PATCH 42/43] revert --- onnxruntime/core/framework/tensor_allocator.h | 2 +- onnxruntime/core/providers/webgpu/buffer_manager.h | 2 +- onnxruntime/core/providers/webgpu/compute_context.h | 2 +- onnxruntime/core/providers/webgpu/program_manager.h | 2 +- onnxruntime/core/providers/webgpu/shader_helper.h | 2 +- onnxruntime/core/providers/webgpu/webgpu_context.h | 2 +- onnxruntime/test/onnx/microbenchmark/batchnorm2.cc | 2 +- onnxruntime/test/onnx/microbenchmark/main.cc | 2 +- onnxruntime/test/onnx/microbenchmark/pooling.cc | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/onnxruntime/core/framework/tensor_allocator.h b/onnxruntime/core/framework/tensor_allocator.h index a7ba6deab5da0..923320681e683 100644 --- a/onnxruntime/core/framework/tensor_allocator.h +++ b/onnxruntime/core/framework/tensor_allocator.h @@ -7,7 +7,7 @@ #include #include #include -#include "core/graph/onnx_protobuf.h" +#include #include #include #include "execution_plan_base.h" diff --git a/onnxruntime/core/providers/webgpu/buffer_manager.h b/onnxruntime/core/providers/webgpu/buffer_manager.h index a5bba53c6798b..20bee52835c02 100644 --- a/onnxruntime/core/providers/webgpu/buffer_manager.h +++ b/onnxruntime/core/providers/webgpu/buffer_manager.h @@ -5,7 +5,7 @@ #include -#include "core/providers/webgpu/webgpu_external_header.h" +#include #include "core/framework/execution_provider.h" diff --git a/onnxruntime/core/providers/webgpu/compute_context.h b/onnxruntime/core/providers/webgpu/compute_context.h index 23fa10a0d5489..680e03aef0aa3 100644 --- a/onnxruntime/core/providers/webgpu/compute_context.h +++ b/onnxruntime/core/providers/webgpu/compute_context.h @@ -3,7 +3,7 @@ #pragma once -#include "core/providers/webgpu/webgpu_external_header.h" +#include #include diff --git a/onnxruntime/core/providers/webgpu/program_manager.h b/onnxruntime/core/providers/webgpu/program_manager.h index feeb703b95aa2..55721770014d2 100644 --- a/onnxruntime/core/providers/webgpu/program_manager.h +++ b/onnxruntime/core/providers/webgpu/program_manager.h @@ -6,7 +6,7 @@ #include #include -#include "core/providers/webgpu/webgpu_external_header.h" +#include #include "core/common/common.h" diff --git a/onnxruntime/core/providers/webgpu/shader_helper.h b/onnxruntime/core/providers/webgpu/shader_helper.h index 64b4c054f93d4..dac08f3bd9368 100644 --- a/onnxruntime/core/providers/webgpu/shader_helper.h +++ b/onnxruntime/core/providers/webgpu/shader_helper.h @@ -5,7 +5,7 @@ #include -#include "core/providers/webgpu/webgpu_external_header.h" +#include #include "core/framework/tensor_shape.h" diff --git a/onnxruntime/core/providers/webgpu/webgpu_context.h b/onnxruntime/core/providers/webgpu/webgpu_context.h index 1a752a93a7116..80c8c64ce72b6 100644 --- a/onnxruntime/core/providers/webgpu/webgpu_context.h +++ b/onnxruntime/core/providers/webgpu/webgpu_context.h @@ -6,7 +6,7 @@ #include #include -#include "core/providers/webgpu/webgpu_external_header.h" +#include #include "core/common/common.h" #include "core/framework/library_handles.h" diff --git a/onnxruntime/test/onnx/microbenchmark/batchnorm2.cc b/onnxruntime/test/onnx/microbenchmark/batchnorm2.cc index a8a2f09dfda5a..ed1dc808871ec 100644 --- a/onnxruntime/test/onnx/microbenchmark/batchnorm2.cc +++ b/onnxruntime/test/onnx/microbenchmark/batchnorm2.cc @@ -1,5 +1,5 @@ -#include "core/graph/onnx_protobuf.h" +#include #include #include #include "core/platform/threadpool.h" diff --git a/onnxruntime/test/onnx/microbenchmark/main.cc b/onnxruntime/test/onnx/microbenchmark/main.cc index 2c0955c4debee..70faa6f11989d 100644 --- a/onnxruntime/test/onnx/microbenchmark/main.cc +++ b/onnxruntime/test/onnx/microbenchmark/main.cc @@ -2,7 +2,7 @@ // Licensed under the MIT License. #include -#include "core/graph/onnx_protobuf.h" +#include #include #include #include diff --git a/onnxruntime/test/onnx/microbenchmark/pooling.cc b/onnxruntime/test/onnx/microbenchmark/pooling.cc index 59d7bfa5723f8..bf3194576d804 100644 --- a/onnxruntime/test/onnx/microbenchmark/pooling.cc +++ b/onnxruntime/test/onnx/microbenchmark/pooling.cc @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include "core/graph/onnx_protobuf.h" +#include #include #include #include From 2491d10bf5911e6bc97ace96e9bd7ad2f3c8c03d Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sat, 25 Jan 2025 04:28:21 +0000 Subject: [PATCH 43/43] modify xnnpack's condition --- cmake/vcpkg.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/vcpkg.json b/cmake/vcpkg.json index 351728d475ac1..840fe73326fb9 100644 --- a/cmake/vcpkg.json +++ b/cmake/vcpkg.json @@ -62,9 +62,9 @@ "name": "wil", "platform": "windows" }, - { + { "name": "xnnpack", - "platform": "!windows | x64" + "platform": "(windows & x64) | (osx & native) | (!windows && !osx)" }, { "name": "zlib",