diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index b36b0aa555940..04b5fdb85ed56 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -117,17 +117,21 @@ jobs: 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: "1de2026f28ead93ff1773e6e680387643e914ea1" # 2024.07.12 - runVcpkgInstall: true + vcpkgGitCommitId: "b322364f06308bdd24823f9d8f03fe0cc86fd46f" # 2024.12.16 + runVcpkgInstall: true # vcpkg install --x-manifest-root cmake --x-install-root .build --overlay-triplets cmake/vcpkg-triplets 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" # VCPKG_BINARY_SOURCES: "default" # https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching - name: "Run compile_schema.py" @@ -163,19 +167,22 @@ jobs: --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" shell: bash - name: "Run vcpkg(arm64-osx)" uses: lukka/run-vcpkg@v11 with: vcpkgDirectory: "${{ runner.temp }}/vcpkg" - vcpkgGitCommitId: "1de2026f28ead93ff1773e6e680387643e914ea1" # 2024.07.12 - runVcpkgInstall: true + doNotUpdateVcpkg: true + runVcpkgInstall: true # vcpkg install --x-manifest-root cmake --x-install-root .build --overlay-triplets cmake/vcpkg-triplets 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" # VCPKG_BINARY_SOURCES: "default" # https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching - name: "Run build.py(arm64-osx)" @@ -193,6 +200,8 @@ jobs: --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" shell: bash Objective-C-StaticAnalysis: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8a95e8a7b7b89..0f73aaac60014 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -56,12 +56,14 @@ jobs: uses: lukka/run-vcpkg@v11 with: vcpkgDirectory: "C:/vcpkg" # use VCPKG_INSTALLATION_ROOT of the image - runVcpkgInstall: true + vcpkgGitCommitId: "b322364f06308bdd24823f9d8f03fe0cc86fd46f" # 2024.12.16 + runVcpkgInstall: true # vcpkg install --x-manifest-root cmake --x-install-root .build --overlay-triplets cmake/vcpkg-triplets 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" # VCPKG_BINARY_SOURCES: "default" # https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching - name: "Run compile_schema.py" @@ -99,6 +101,8 @@ jobs: --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" shell: pwsh - name: "Run vcpkg(arm64-windows)" @@ -106,12 +110,13 @@ jobs: with: vcpkgDirectory: "C:/vcpkg" # use VCPKG_INSTALLATION_ROOT of the image doNotUpdateVcpkg: true - runVcpkgInstall: true + runVcpkgInstall: true # vcpkg install --x-manifest-root cmake --x-install-root .build --overlay-triplets cmake/vcpkg-triplets 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" # VCPKG_BINARY_SOURCES: "default" # https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching - name: "Run build.py(arm64-windows)" @@ -128,4 +133,6 @@ jobs: --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" shell: pwsh diff --git a/cmake/CMakePresets.json b/cmake/CMakePresets.json index 1b7aa11975a3e..4987edaf85513 100644 --- a/cmake/CMakePresets.json +++ b/cmake/CMakePresets.json @@ -14,6 +14,7 @@ "VCPKG_INSTALLED_DIR": "${sourceParentDir}/.build" }, "environment": { + "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/vcpkg-triplets", "VCPKG_FEATURE_FLGAS": "manifests,versions" } }, diff --git a/cmake/vcpkg-configuration.json b/cmake/vcpkg-configuration.json index 4afc30a3b969d..89954eaec9afd 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": "c82f74667287d3dc386bce81e44964370c91a289" + "baseline": "93570a28ecdf49d3d9676cec8aa0cc72935d43db" }, "registries": [] } diff --git a/cmake/vcpkg-triplets/arm64-osx.cmake b/cmake/vcpkg-triplets/arm64-osx.cmake new file mode 100644 index 0000000000000..543081c5073c4 --- /dev/null +++ b/cmake/vcpkg-triplets/arm64-osx.cmake @@ -0,0 +1,14 @@ +# https://learn.microsoft.com/en-us/vcpkg/users/triplets +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_OSX_ARCHITECTURES arm64) + +# provide build options for vcpkg installed packages +if(PORT MATCHES "onnx") + list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS + "-DONNX_DISABLE_STATIC_REGISTRATION=ON" + ) +endif() diff --git a/cmake/vcpkg-triplets/arm64-windows.cmake b/cmake/vcpkg-triplets/arm64-windows.cmake new file mode 100644 index 0000000000000..13caf5a12f72b --- /dev/null +++ b/cmake/vcpkg-triplets/arm64-windows.cmake @@ -0,0 +1,11 @@ +# https://learn.microsoft.com/en-us/vcpkg/users/triplets +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) + +# provide build options for vcpkg installed packages +if(PORT MATCHES "onnx") + list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS + "-DONNX_DISABLE_STATIC_REGISTRATION=ON" + ) +endif() diff --git a/cmake/vcpkg-triplets/x64-osx.cmake b/cmake/vcpkg-triplets/x64-osx.cmake new file mode 100644 index 0000000000000..be656a060490c --- /dev/null +++ b/cmake/vcpkg-triplets/x64-osx.cmake @@ -0,0 +1,14 @@ +# https://learn.microsoft.com/en-us/vcpkg/users/triplets +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_OSX_ARCHITECTURES x86_64) + +# provide build options for vcpkg installed packages +if(PORT MATCHES "onnx") + list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS + "-DONNX_DISABLE_STATIC_REGISTRATION=ON" + ) +endif() diff --git a/cmake/vcpkg-triplets/x64-windows.cmake b/cmake/vcpkg-triplets/x64-windows.cmake new file mode 100644 index 0000000000000..ee137a9586a7d --- /dev/null +++ b/cmake/vcpkg-triplets/x64-windows.cmake @@ -0,0 +1,11 @@ +# https://learn.microsoft.com/en-us/vcpkg/users/triplets +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) + +# provide build options for vcpkg installed packages +if(PORT MATCHES "onnx") + list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS + "-DONNX_DISABLE_STATIC_REGISTRATION=ON" + ) +endif() diff --git a/cmake/vcpkg.json b/cmake/vcpkg.json index fcb2c7d5de89b..e874c29a13f1c 100644 --- a/cmake/vcpkg.json +++ b/cmake/vcpkg.json @@ -30,15 +30,15 @@ }, "ms-gsl", "nlohmann-json", - { - "name": "nsync", - "platform": "!windows" - }, { "name": "nsync", "platform": "!windows", "version>=": "1.26.0" }, + { + "name": "onnx", + "version>=": "1.16.2" + }, "optional-lite", { "name": "protobuf", @@ -66,12 +66,6 @@ "platform": "windows" } ], - "overrides": [ - { - "name": "flatbuffers", - "version": "23.5.26" - } - ], "features": { "tests": { "description": "Build ONNXRuntime unit tests", @@ -80,5 +74,15 @@ "gtest" ] } - } + }, + "overrides": [ + { + "name": "protobuf", + "version": "3.21.12#4" + }, + { + "name": "flatbuffers", + "version": "23.5.26" + } + ] }