Skip to content

Commit

Permalink
Merge branch 'main' into port/tensorflow-lite
Browse files Browse the repository at this point in the history
  • Loading branch information
luncliff committed Sep 28, 2023
2 parents f6a383e + bee211f commit 7994935
Show file tree
Hide file tree
Showing 15 changed files with 899 additions and 481 deletions.
28 changes: 11 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
Pop-Location
- restore_cache:
keys:
- 2326-downs-{{ checksum ".circleci/config.yml" }}
- v2338-downs-{{ checksum ".circleci/config.yml" }}
- restore_cache:
keys:
- 2326-bins-{{ checksum ".circleci/config.yml" }}
- v2338-bins-{{ checksum ".circleci/config.yml" }}
- run:
name: "Install: port-setup.txt"
command: |
Expand All @@ -59,12 +59,12 @@ jobs:
$(Get-Content "$env:CIRCLE_WORKING_DIRECTORY/.circleci/port-setup.txt")
working_directory: vcpkg
- save_cache:
key: 2326-downs-{{ checksum ".circleci/config.yml" }}
key: v2338-downs-{{ checksum ".circleci/config.yml" }}
paths:
- C:/vcpkg-downs
when: always
- save_cache:
key: 2326-bins-{{ checksum ".circleci/config.yml" }}
key: v2338-bins-{{ checksum ".circleci/config.yml" }}
paths:
- C:/vcpkg-bins
when: always
Expand All @@ -91,16 +91,12 @@ jobs:
Pop-Location
- restore_cache:
keys:
- 2326-downs-{{ checksum ".circleci/config.yml" }}
- v2338-downs-{{ .Branch }}
- v2338-downs-{{ checksum ".circleci/config.yml" }}
- restore_cache:
keys:
- 2326-bins-{{ checksum ".circleci/config.yml" }}
- restore_cache:
keys:
- 2338-downs-{{ checksum ".circleci/config.yml" }}
- restore_cache:
keys:
- 2338-bins-{{ checksum ".circleci/config.yml" }}
- v2338-bins-{{ .Branch }}
- v2338-bins-{{ checksum ".circleci/config.yml" }}
- run:
name: "Install: port-windows.txt"
command: |
Expand All @@ -116,19 +112,17 @@ jobs:
equal: [ main, << pipeline.git.branch >> ]
steps:
- save_cache:
key: 2338-bins-{{ .Branch }}
key: v2338-bins-{{ .Branch }}
paths:
- C:/vcpkg-bins
- save_cache:
key: 2338-downs-{{ checksum ".circleci/config.yml" }}
key: v2338-downs-{{ .Branch }}
paths:
- C:/vcpkg-downs
when: always
- save_cache:
key: 2338-bins-{{ checksum ".circleci/config.yml" }}
key: v2338-bins-{{ .Branch }}
paths:
- C:/vcpkg-bins
when: always
- store_artifacts:
name: "Upload buildtrees log"
path: vcpkg/buildtrees/ # buildtrees-log
Expand Down
8 changes: 8 additions & 0 deletions .circleci/port-setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ zstd:x64-windows
draco:x64-windows
civetweb:x64-windows
cgltf:x64-windows
protobuf:x64-windows
grpc[codegen]:x64-windows
flatbuffers:x64-windows
opencl:x64-windows
egl-registry:x64-windows
opengl-registry:x64-windows
vulkan-headers:x64-windows
nlohmann-json:x64-windows
1 change: 0 additions & 1 deletion .circleci/port-uwp.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
onnxruntime[xnnpack]:x64-uwp
onnxruntime[directml,xnnpack]:x64-windows
3 changes: 2 additions & 1 deletion .circleci/port-windows.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
google-filament[gles3,test]:x64-windows
grpc[codegen]:x64-windows
onnxruntime[directml,xnnpack,test]:x64-windows
24 changes: 13 additions & 11 deletions ports/onnx/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,22 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
protobuf-lite ONNX_USE_LITE_PROTO
)

# Like protoc, python is required for codegen.
x_vcpkg_get_python_packages(
PYTHON_VERSION 3
PACKAGES numpy pybind11
OUT_PYTHON_VAR PYTHON3
)
if("python" IN_LIST FEATURES)
x_vcpkg_get_python_packages(
PYTHON_VERSION 3
PACKAGES numpy pybind11
OUT_PYTHON_VAR PYTHON3
)
get_filename_component(PYTHON_PATH "${PYTHON3}" PATH)
else()
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON_PATH "${PYTHON3}" PATH)
endif()
message(STATUS "Using python3: ${PYTHON3}")
get_filename_component(PYTHON_PATH "${PYTHON3}" PATH)
get_filename_component(PYTHON_ROOT "${PYTHON_PATH}" PATH)
# PATH for .bat scripts so it can find 'python'
vcpkg_add_to_path(PREPEND "${PYTHON_PATH}")

if("python" IN_LIST FEATURES)
get_filename_component(PYTHON_ROOT "${PYTHON_PATH}" PATH)
find_path(pybind11_DIR NAMES pybind11Targets.cmake PATHS "${PYTHON_ROOT}/Lib/site-packages/pybind11/share/cmake/pybind11" REQUIRED)
message(STATUS "Using pybind11: ${pybind11_DIR}")
list(APPEND FEATURE_OPTIONS
Expand Down Expand Up @@ -74,8 +77,6 @@ vcpkg_cmake_configure(
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ONNX)

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/share"
Expand Down Expand Up @@ -105,3 +106,4 @@ file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/include/onnx/onnx_data"
"${CURRENT_PACKAGES_DIR}/include/onnx/onnx_operators_ml"
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
13 changes: 8 additions & 5 deletions ports/onnx/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "onnx",
"version-semver": "1.14.1",
"port-version": 1,
"description": "Open standard for machine learning interoperability",
"homepage": "https://onnx.ai",
"license": "Apache-2.0",
Expand All @@ -17,16 +18,18 @@
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "vcpkg-get-python-packages",
"host": true
}
],
"features": {
"python": {
"description": "Build Python binaries",
"supports": "x64"
"supports": "x64",
"dependencies": [
{
"name": "vcpkg-get-python-packages",
"host": true
}
]
}
}
}
Loading

0 comments on commit 7994935

Please sign in to comment.