From 3823a43d583e523fef04150ea71e0c566af3e087 Mon Sep 17 00:00:00 2001 From: luncliff Date: Wed, 19 May 2021 06:20:49 +0900 Subject: [PATCH 01/19] [onnx] create a new port --- ports/onnx/fix-apple.patch | 15 ++++++++ ports/onnx/fix-install.patch | 42 ++++++++++++++++++++++ ports/onnx/portfile.cmake | 68 ++++++++++++++++++++++++++++++++++++ ports/onnx/vcpkg.json | 17 +++++++++ 4 files changed, 142 insertions(+) create mode 100644 ports/onnx/fix-apple.patch create mode 100644 ports/onnx/fix-install.patch create mode 100644 ports/onnx/portfile.cmake create mode 100644 ports/onnx/vcpkg.json diff --git a/ports/onnx/fix-apple.patch b/ports/onnx/fix-apple.patch new file mode 100644 index 00000000000000..a21df379bd48a8 --- /dev/null +++ b/ports/onnx/fix-apple.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d63e12c..cd37eb4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -658,10 +658,6 @@ if (NOT ANDROID AND NOT IOS) + target_compile_definitions(onnxifi_wrapper PRIVATE "ONNXIFI_PUBLIC=__attribute__((__dllexport__))") + endif() + endif() +- if(APPLE) +- # By default CMake would use .so suffix on Mac +- set_target_properties(onnxifi_wrapper PROPERTIES SUFFIX ".dylib") +- endif() + endif() + + # ---[ ONNXIFI dummy backend diff --git a/ports/onnx/fix-install.patch b/ports/onnx/fix-install.patch new file mode 100644 index 00000000000000..f6311099b62245 --- /dev/null +++ b/ports/onnx/fix-install.patch @@ -0,0 +1,42 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5a640cd..ba5f960 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -697,27 +697,27 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/onnx + PATTERN "*.h") + + configure_file( +- ${PROJECT_SOURCE_DIR}/cmake/ONNXConfigVersion.cmake.in +- ${PROJECT_BINARY_DIR}/ONNXConfigVersion.cmake ++ ${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake.in ++ ${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + @ONLY) + configure_file( +- ${PROJECT_SOURCE_DIR}/cmake/ONNXConfig.cmake.in +- ${PROJECT_BINARY_DIR}/ONNXConfig.cmake ++ ${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in ++ ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + @ONLY) + install(FILES +- ${PROJECT_BINARY_DIR}/ONNXConfigVersion.cmake +- ${PROJECT_BINARY_DIR}/ONNXConfig.cmake ++ ${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake ++ ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ONNX + COMPONENT dev) +-install(EXPORT ONNXTargets DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ONNX") ++install(EXPORT ${PROJECT_NAME}Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ONNX) + install(TARGETS + onnx onnx_proto +- onnxifi onnxifi_dummy onnxifi_loader +- EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ # onnxifi onnxifi_dummy onnxifi_loader ++ EXPORT ${PROJECT_NAME}Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if(NOT ANDROID AND NOT IOS) + install(TARGETS onnxifi_wrapper +- EXPORT ONNXTargets DESTINATION lib) ++ EXPORT ${PROJECT_NAME}Targets DESTINATION lib) + endif() + + if(ONNXIFI_DUMMY_BACKEND) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake new file mode 100644 index 00000000000000..50bb37302f7cb7 --- /dev/null +++ b/ports/onnx/portfile.cmake @@ -0,0 +1,68 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO onnx/onnx + REF v1.9.0 + SHA512 a3eecc74ce4f22524603fb86367d21c87a143ba27eef93ef4bd2e2868c2cadeb724b84df58a429286e7824adebdeba7fa059095b7ab29df8dcea8777bd7f4101 + PATCHES + fix-apple.patch + # fix-install.patch +) + +vcpkg_find_acquire_program(PYTHON3) + +vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DPYTHON_EXECUTABLE=${PYTHON3} + -DBUILD_ONNX_PYTHON=ON + -DONNX_GEN_PB_TYPE_STUBS=ON + -DONNX_USE_LITE_PROTO=OFF + -DONNX_BUILD_TESTS=OFF + -DONNX_BUILD_BENCHMARKS=OFF + -DONNX_VERIFY_PROTO3=ON +) +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ONNX) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +# install protobuf files together +get_filename_component(CODEGEN_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/onnx ABSOLUTE) +file(INSTALL ${CODEGEN_DIR}/onnx-data.proto + ${CODEGEN_DIR}/onnx-data.proto3 + ${CODEGEN_DIR}/onnx-ml.proto + ${CODEGEN_DIR}/onnx-ml.proto3 + ${CODEGEN_DIR}/onnx-operators-ml.proto + ${CODEGEN_DIR}/onnx-operators-ml.proto3 + DESTINATION ${CURRENT_PACKAGES_DIR}/include/onnx +) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share + # these are for python scripts + ${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/onnx_cpp2py_export + # the others are empty + ${CURRENT_PACKAGES_DIR}/include/onnx/backend + ${CURRENT_PACKAGES_DIR}/include/onnx/tools + ${CURRENT_PACKAGES_DIR}/include/onnx/test + ${CURRENT_PACKAGES_DIR}/include/onnx/bin + ${CURRENT_PACKAGES_DIR}/include/onnx/examples + ${CURRENT_PACKAGES_DIR}/include/onnx/frontend + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/training + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/math + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/quantization + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/generator + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/reduction + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/logical + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/object_detection + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/traditionalml + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/sequence + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/controlflow + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/rnn + ${CURRENT_PACKAGES_DIR}/include/onnx/defs/nn +) diff --git a/ports/onnx/vcpkg.json b/ports/onnx/vcpkg.json new file mode 100644 index 00000000000000..bfdc571a4ba86c --- /dev/null +++ b/ports/onnx/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "onnx", + "version": "1.9.0", + "description": "Open standard for machine learning interoperability", + "homepage": "https://onnx.ai", + "dependencies": [ + "protobuf", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} From b53dfa57ffb354eedd86efddac634d355da684f6 Mon Sep 17 00:00:00 2001 From: luncliff Date: Wed, 19 May 2021 06:21:20 +0900 Subject: [PATCH 02/19] [onnx] update baseline --- versions/baseline.json | 4 ++++ versions/o-/onnx.json | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 versions/o-/onnx.json diff --git a/versions/baseline.json b/versions/baseline.json index ae0396a56267b4..058ad0e261846f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4540,6 +4540,10 @@ "baseline": "6.9.4", "port-version": 0 }, + "onnx": { + "baseline": "1.9.0", + "port-version": 0 + }, "onnxruntime-gpu": { "baseline": "1.5.1", "port-version": 0 diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json new file mode 100644 index 00000000000000..aac3258cb6fd4f --- /dev/null +++ b/versions/o-/onnx.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "1087de71f980c0979547e499031ba0c12b9cabdd", + "version": "1.9.0", + "port-version": 0 + } + ] +} From 54399488c92aa03fdfe8ff8a15c89e0b11670a79 Mon Sep 17 00:00:00 2001 From: luncliff Date: Sun, 23 May 2021 20:49:44 +0900 Subject: [PATCH 03/19] [onnx] fix pybind11 build in Linux --- ports/onnx/fix-install.patch | 42 ---------------------------------- ports/onnx/fix-pybind11.patch | 43 +++++++++++++++++++++++++++++++++++ ports/onnx/portfile.cmake | 12 ++++++++-- ports/onnx/vcpkg.json | 7 +++++- versions/o-/onnx.json | 2 +- 5 files changed, 60 insertions(+), 46 deletions(-) delete mode 100644 ports/onnx/fix-install.patch create mode 100644 ports/onnx/fix-pybind11.patch diff --git a/ports/onnx/fix-install.patch b/ports/onnx/fix-install.patch deleted file mode 100644 index f6311099b62245..00000000000000 --- a/ports/onnx/fix-install.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5a640cd..ba5f960 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -697,27 +697,27 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/onnx - PATTERN "*.h") - - configure_file( -- ${PROJECT_SOURCE_DIR}/cmake/ONNXConfigVersion.cmake.in -- ${PROJECT_BINARY_DIR}/ONNXConfigVersion.cmake -+ ${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake.in -+ ${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake - @ONLY) - configure_file( -- ${PROJECT_SOURCE_DIR}/cmake/ONNXConfig.cmake.in -- ${PROJECT_BINARY_DIR}/ONNXConfig.cmake -+ ${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in -+ ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake - @ONLY) - install(FILES -- ${PROJECT_BINARY_DIR}/ONNXConfigVersion.cmake -- ${PROJECT_BINARY_DIR}/ONNXConfig.cmake -+ ${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake -+ ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ONNX - COMPONENT dev) --install(EXPORT ONNXTargets DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ONNX") -+install(EXPORT ${PROJECT_NAME}Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ONNX) - install(TARGETS - onnx onnx_proto -- onnxifi onnxifi_dummy onnxifi_loader -- EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ # onnxifi onnxifi_dummy onnxifi_loader -+ EXPORT ${PROJECT_NAME}Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - if(NOT ANDROID AND NOT IOS) - install(TARGETS onnxifi_wrapper -- EXPORT ONNXTargets DESTINATION lib) -+ EXPORT ${PROJECT_NAME}Targets DESTINATION lib) - endif() - - if(ONNXIFI_DUMMY_BACKEND) diff --git a/ports/onnx/fix-pybind11.patch b/ports/onnx/fix-pybind11.patch new file mode 100644 index 00000000000000..60cca0ce0839fa --- /dev/null +++ b/ports/onnx/fix-pybind11.patch @@ -0,0 +1,43 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1ff0fd3..d04a390 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -110,9 +110,9 @@ 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(PythonLibs ${PY_VERSION}) ++find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) ++# find_package(PythonInterp ${PY_VERSION} REQUIRED) ++# find_package(PythonLibs ${PY_VERSION}) + + if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) + +index d04a390..e1bfceb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -441,10 +441,10 @@ if(BUILD_ONNX_PYTHON) + $ + $ + $ +- ${PYTHON_INCLUDE_DIR}) ++ ${Python_INCLUDE_DIRS}) + + # pybind11 is a header only lib +- find_package(pybind11 2.2) ++ find_package(pybind11 2.2 REQUIRED) + if(pybind11_FOUND) + target_include_directories(onnx_cpp2py_export PUBLIC + ${pybind11_INCLUDE_DIRS}) +@@ -635,7 +635,7 @@ endif() + + if (NOT ANDROID AND NOT IOS) + # ---[ ONNXIFI wrapper +- add_library(onnxifi_wrapper MODULE onnx/onnxifi_wrapper.c) ++ add_library(onnxifi_wrapper onnx/onnxifi_wrapper.c) + if(MSVC) + add_msvc_runtime_flag(onnxifi_wrapper) + endif() diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index 50bb37302f7cb7..e9cea8703585bc 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -7,16 +7,24 @@ vcpkg_from_github( SHA512 a3eecc74ce4f22524603fb86367d21c87a143ba27eef93ef4bd2e2868c2cadeb724b84df58a429286e7824adebdeba7fa059095b7ab29df8dcea8777bd7f4101 PATCHES fix-apple.patch - # fix-install.patch + fix-pybind11.patch ) vcpkg_find_acquire_program(PYTHON3) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + pybind11 BUILD_ONNX_PYTHON +) +if(NOT VCPKG_TARGET_IS_LINUX AND "pybind11" IN_LIST FEATURES) + message(FATAL_ERROR "Feature 'pybind11' is for Linux platform") +endif() + vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS + ${FEATURE_OPTIONS} -DPYTHON_EXECUTABLE=${PYTHON3} - -DBUILD_ONNX_PYTHON=ON -DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_USE_LITE_PROTO=OFF -DONNX_BUILD_TESTS=OFF diff --git a/ports/onnx/vcpkg.json b/ports/onnx/vcpkg.json index bfdc571a4ba86c..5468baf063a654 100644 --- a/ports/onnx/vcpkg.json +++ b/ports/onnx/vcpkg.json @@ -13,5 +13,10 @@ "name": "vcpkg-cmake-config", "host": true } - ] + ], + "features": { + "pybind11": { + "description": "Build Python binaries (Linux only)" + } + } } diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index aac3258cb6fd4f..202fd4b069b035 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "1087de71f980c0979547e499031ba0c12b9cabdd", + "git-tree": "c6c1b86d2fa771911a271fa665ff65a25f0cfc7a", "version": "1.9.0", "port-version": 0 } From a1b00fbcb6278ed0b0c482c2fb6d31fb11680168 Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Mon, 24 May 2021 00:08:19 +0900 Subject: [PATCH 04/19] [onnx] fix windows build * rewrite cmake patch * provide CRT related options --- ports/onnx/fix-apple.patch | 15 ------- ports/onnx/fix-cmakelists.patch | 38 ++++++++++++++++++ ports/onnx/fix-pybind11.patch | 71 +++++++++++++-------------------- ports/onnx/portfile.cmake | 35 ++++++++++------ ports/onnx/vcpkg.json | 2 +- versions/o-/onnx.json | 2 +- 6 files changed, 90 insertions(+), 73 deletions(-) delete mode 100644 ports/onnx/fix-apple.patch create mode 100644 ports/onnx/fix-cmakelists.patch diff --git a/ports/onnx/fix-apple.patch b/ports/onnx/fix-apple.patch deleted file mode 100644 index a21df379bd48a8..00000000000000 --- a/ports/onnx/fix-apple.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d63e12c..cd37eb4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -658,10 +658,6 @@ if (NOT ANDROID AND NOT IOS) - target_compile_definitions(onnxifi_wrapper PRIVATE "ONNXIFI_PUBLIC=__attribute__((__dllexport__))") - endif() - endif() -- if(APPLE) -- # By default CMake would use .so suffix on Mac -- set_target_properties(onnxifi_wrapper PROPERTIES SUFFIX ".dylib") -- endif() - endif() - - # ---[ ONNXIFI dummy backend diff --git a/ports/onnx/fix-cmakelists.patch b/ports/onnx/fix-cmakelists.patch new file mode 100644 index 00000000000000..faafe9dd633f75 --- /dev/null +++ b/ports/onnx/fix-cmakelists.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 628dcaa..6758666 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -635,7 +635,7 @@ endif() + + if (NOT ANDROID AND NOT IOS) + # ---[ ONNXIFI wrapper +- add_library(onnxifi_wrapper MODULE onnx/onnxifi_wrapper.c) ++ add_library(onnxifi_wrapper onnx/onnxifi_wrapper.c) + if(MSVC) + add_msvc_runtime_flag(onnxifi_wrapper) + endif() +@@ -658,10 +658,6 @@ if (NOT ANDROID AND NOT IOS) + target_compile_definitions(onnxifi_wrapper PRIVATE "ONNXIFI_PUBLIC=__attribute__((__dllexport__))") + endif() + endif() +- if(APPLE) +- # By default CMake would use .so suffix on Mac +- set_target_properties(onnxifi_wrapper PROPERTIES SUFFIX ".dylib") +- endif() + endif() + + # ---[ ONNXIFI dummy backend +@@ -712,8 +708,11 @@ install(FILES + install(EXPORT ONNXTargets DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ONNX") + install(TARGETS + onnx onnx_proto +- onnxifi onnxifi_dummy onnxifi_loader +- EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ onnxifi onnxifi_loader # onnxifi_dummy ++ EXPORT ONNXTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if(NOT ANDROID AND NOT IOS) + install(TARGETS onnxifi_wrapper diff --git a/ports/onnx/fix-pybind11.patch b/ports/onnx/fix-pybind11.patch index 60cca0ce0839fa..fcf4eda88c880c 100644 --- a/ports/onnx/fix-pybind11.patch +++ b/ports/onnx/fix-pybind11.patch @@ -1,43 +1,28 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1ff0fd3..d04a390 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -110,9 +110,9 @@ 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(PythonLibs ${PY_VERSION}) -+find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) -+# find_package(PythonInterp ${PY_VERSION} REQUIRED) -+# find_package(PythonLibs ${PY_VERSION}) - - if(CMAKE_SYSTEM_NAME STREQUAL "AIX") - set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) - -index d04a390..e1bfceb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -441,10 +441,10 @@ if(BUILD_ONNX_PYTHON) - $ - $ - $ -- ${PYTHON_INCLUDE_DIR}) -+ ${Python_INCLUDE_DIRS}) - - # pybind11 is a header only lib -- find_package(pybind11 2.2) -+ find_package(pybind11 2.2 REQUIRED) - if(pybind11_FOUND) - target_include_directories(onnx_cpp2py_export PUBLIC - ${pybind11_INCLUDE_DIRS}) -@@ -635,7 +635,7 @@ endif() - - if (NOT ANDROID AND NOT IOS) - # ---[ ONNXIFI wrapper -- add_library(onnxifi_wrapper MODULE onnx/onnxifi_wrapper.c) -+ add_library(onnxifi_wrapper onnx/onnxifi_wrapper.c) - if(MSVC) - add_msvc_runtime_flag(onnxifi_wrapper) - endif() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6758666..e4f4185 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -110,9 +110,7 @@ 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(PythonLibs ${PY_VERSION}) ++find_package(Python ${PY_VERSION} COMPONENTS Interpreter REQUIRED) + + if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) +@@ -441,10 +439,10 @@ if(BUILD_ONNX_PYTHON) + $ + $ + $ +- ${PYTHON_INCLUDE_DIR}) ++ ${Python_INCLUDE_DIRS}) + + # pybind11 is a header only lib +- find_package(pybind11 2.2) ++ find_package(pybind11 2.2 CONFIG REQUIRED) + if(pybind11_FOUND) + target_include_directories(onnx_cpp2py_export PUBLIC + ${pybind11_INCLUDE_DIRS}) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index e9cea8703585bc..3bf9161b207769 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -1,25 +1,32 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO onnx/onnx REF v1.9.0 SHA512 a3eecc74ce4f22524603fb86367d21c87a143ba27eef93ef4bd2e2868c2cadeb724b84df58a429286e7824adebdeba7fa059095b7ab29df8dcea8777bd7f4101 PATCHES - fix-apple.patch + fix-cmakelists.patch fix-pybind11.patch ) -vcpkg_find_acquire_program(PYTHON3) - vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES pybind11 BUILD_ONNX_PYTHON ) -if(NOT VCPKG_TARGET_IS_LINUX AND "pybind11" IN_LIST FEATURES) - message(FATAL_ERROR "Feature 'pybind11' is for Linux platform") + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" USE_PROTOBUF_SHARED) +list(APPEND FEATURE_OPTIONS + -DONNX_USE_PROTOBUF_SHARED_LIBS=${USE_PROTOBUF_SHARED} +) +if(VCPKG_TARGET_IS_WINDOWS) + string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" USE_STATIC_RUNTIME) + list(APPEND FEATURE_OPTIONS + -DONNX_USE_MSVC_STATIC_RUNTIME=${USE_STATIC_RUNTIME} + ) endif() +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +vcpkg_find_acquire_program(PYTHON3) + vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS @@ -29,7 +36,6 @@ vcpkg_cmake_configure( -DONNX_USE_LITE_PROTO=OFF -DONNX_BUILD_TESTS=OFF -DONNX_BUILD_BENCHMARKS=OFF - -DONNX_VERIFY_PROTO3=ON ) vcpkg_cmake_install() vcpkg_copy_pdbs() @@ -49,11 +55,6 @@ file(INSTALL ${CODEGEN_DIR}/onnx-data.proto file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share - # these are for python scripts - ${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/onnx_cpp2py_export # the others are empty ${CURRENT_PACKAGES_DIR}/include/onnx/backend ${CURRENT_PACKAGES_DIR}/include/onnx/tools @@ -74,3 +75,11 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include/onnx/defs/rnn ${CURRENT_PACKAGES_DIR}/include/onnx/defs/nn ) +if(NOT "pybind11" IN_LIST FEATURES) + # these are for python scripts + file(REMOVE_RECURSE ${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/onnx_cpp2py_export + ) +endif() diff --git a/ports/onnx/vcpkg.json b/ports/onnx/vcpkg.json index 5468baf063a654..1e922cd5ad2c86 100644 --- a/ports/onnx/vcpkg.json +++ b/ports/onnx/vcpkg.json @@ -16,7 +16,7 @@ ], "features": { "pybind11": { - "description": "Build Python binaries (Linux only)" + "description": "Build Python binaries" } } } diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index 202fd4b069b035..f02850f143842b 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "c6c1b86d2fa771911a271fa665ff65a25f0cfc7a", + "git-tree": "702f8b86295e1ec52d627ccea79581bae9ae16d5", "version": "1.9.0", "port-version": 0 } From 47a8e8e51303de4d384eb7313a6976a1e8c92e9a Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Mon, 24 May 2021 00:17:08 +0900 Subject: [PATCH 05/19] [onnx] use Python_EXECUTABLE --- ports/onnx/portfile.cmake | 2 +- versions/o-/onnx.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index 3bf9161b207769..d77ac98fb3a7e8 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -31,7 +31,7 @@ vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS ${FEATURE_OPTIONS} - -DPYTHON_EXECUTABLE=${PYTHON3} + -DPython_EXECUTABLE=${PYTHON3} -DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_USE_LITE_PROTO=OFF -DONNX_BUILD_TESTS=OFF diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index f02850f143842b..5d06edc45c5d6a 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "702f8b86295e1ec52d627ccea79581bae9ae16d5", + "git-tree": "85b96f2a51f4963a0aedb05d6c509e6e8b2e54c5", "version": "1.9.0", "port-version": 0 } From 8c09f2a81b484f7fa8b70a8a309575b0f659dfc1 Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Mon, 24 May 2021 00:45:31 +0900 Subject: [PATCH 06/19] [onnx] run codegen targets explicitly * Disable UWP support --- ports/onnx/portfile.cmake | 14 +++++++++++++- ports/onnx/vcpkg.json | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index d77ac98fb3a7e8..094ac2bddf54f0 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -1,3 +1,6 @@ +# uwp: LOAD_LIBRARY_SEARCH_DEFAULT_DIRS undefined identifier +vcpkg_fail_port_install(ON_TARGET "uwp") + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO onnx/onnx @@ -31,12 +34,21 @@ vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS ${FEATURE_OPTIONS} - -DPython_EXECUTABLE=${PYTHON3} + -DPYTHON_EXECUTABLE=${PYTHON3} -DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_USE_LITE_PROTO=OFF -DONNX_BUILD_TESTS=OFF -DONNX_BUILD_BENCHMARKS=OFF ) +# These are custom targets for codegen +# Sadly there are no add_dependency controls in the project's CMakeLists.txt +vcpkg_cmake_build(TARGET gen_onnx_proto) +vcpkg_cmake_build(TARGET gen_onnx_operators_proto) +vcpkg_cmake_build(TARGET gen_onnx_data_proto) +if("pybind11" IN_LIST FEATURES) + # This target is not in install/export + vcpkg_cmake_build(TARGET onnx_cpp2py_export) +endif() vcpkg_cmake_install() vcpkg_copy_pdbs() vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ONNX) diff --git a/ports/onnx/vcpkg.json b/ports/onnx/vcpkg.json index 1e922cd5ad2c86..d3460d0412ac6d 100644 --- a/ports/onnx/vcpkg.json +++ b/ports/onnx/vcpkg.json @@ -3,6 +3,7 @@ "version": "1.9.0", "description": "Open standard for machine learning interoperability", "homepage": "https://onnx.ai", + "supports": "!uwp", "dependencies": [ "protobuf", { From 77c37655283831b63c041431a8e2aad400872e09 Mon Sep 17 00:00:00 2001 From: luncliff Date: Mon, 24 May 2021 01:07:59 +0900 Subject: [PATCH 07/19] [onnx] fix python script install --- ports/onnx/fix-pybind11.patch | 2 +- ports/onnx/portfile.cmake | 23 +++++++++++++++-------- versions/o-/onnx.json | 2 +- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ports/onnx/fix-pybind11.patch b/ports/onnx/fix-pybind11.patch index fcf4eda88c880c..be328239b02ec5 100644 --- a/ports/onnx/fix-pybind11.patch +++ b/ports/onnx/fix-pybind11.patch @@ -9,7 +9,7 @@ index 6758666..e4f4185 100644 -# find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) -find_package(PythonInterp ${PY_VERSION} REQUIRED) -find_package(PythonLibs ${PY_VERSION}) -+find_package(Python ${PY_VERSION} COMPONENTS Interpreter REQUIRED) ++find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) if(CMAKE_SYSTEM_NAME STREQUAL "AIX") set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index 094ac2bddf54f0..c544fb8000fbdc 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -34,6 +34,7 @@ vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS ${FEATURE_OPTIONS} + -DPython_EXECUTABLE=${PYTHON3} -DPYTHON_EXECUTABLE=${PYTHON3} -DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_USE_LITE_PROTO=OFF @@ -64,9 +65,23 @@ file(INSTALL ${CODEGEN_DIR}/onnx-data.proto ${CODEGEN_DIR}/onnx-operators-ml.proto3 DESTINATION ${CURRENT_PACKAGES_DIR}/include/onnx ) +if("pybind11" IN_LIST FEATURES) + file(INSTALL ${CODEGEN_DIR}/onnx_data_pb.py + ${CODEGEN_DIR}/onnx_data_pb2.py + ${CODEGEN_DIR}/onnx_ml_pb2.py + ${CODEGEN_DIR}/onnx_operators_ml_pb2.py + ${CODEGEN_DIR}/onnx_operators_pb.py + ${CODEGEN_DIR}/onnx_pb.py + DESTINATION ${CURRENT_PACKAGES_DIR}/include/onnx + ) +endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share + ${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/onnx_cpp2py_export # the others are empty ${CURRENT_PACKAGES_DIR}/include/onnx/backend ${CURRENT_PACKAGES_DIR}/include/onnx/tools @@ -87,11 +102,3 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include/onnx/defs/rnn ${CURRENT_PACKAGES_DIR}/include/onnx/defs/nn ) -if(NOT "pybind11" IN_LIST FEATURES) - # these are for python scripts - file(REMOVE_RECURSE ${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/onnx_cpp2py_export - ) -endif() diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index 5d06edc45c5d6a..4a0fd5018d3e61 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "85b96f2a51f4963a0aedb05d6c509e6e8b2e54c5", + "git-tree": "5fb69819aaabf315d7d2eb72297ca854e0500a08", "version": "1.9.0", "port-version": 0 } From 9f1b69fe5ae08eec3d3aeec237700d8a2628331b Mon Sep 17 00:00:00 2001 From: luncliff Date: Mon, 24 May 2021 01:24:28 +0900 Subject: [PATCH 08/19] [onnx] remove Development component in Windows --- ports/onnx/fix-pybind11.patch | 10 +++++++--- versions/o-/onnx.json | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ports/onnx/fix-pybind11.patch b/ports/onnx/fix-pybind11.patch index be328239b02ec5..46bf3d6b55c99a 100644 --- a/ports/onnx/fix-pybind11.patch +++ b/ports/onnx/fix-pybind11.patch @@ -1,15 +1,19 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6758666..e4f4185 100644 +index 3861def..88265fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -110,9 +110,7 @@ endif() +@@ -110,9 +110,11 @@ 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(PythonLibs ${PY_VERSION}) -+find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) ++if(WIN32) ++ find_package(Python ${PY_VERSION} COMPONENTS Interpreter REQUIRED) ++else() ++ find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) ++endif() if(CMAKE_SYSTEM_NAME STREQUAL "AIX") set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index 4a0fd5018d3e61..91c1112fac6f31 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "5fb69819aaabf315d7d2eb72297ca854e0500a08", + "git-tree": "0ca1117788c80e931ae854ae17487daaecf3f4a8", "version": "1.9.0", "port-version": 0 } From cd6939a3222785114ddae4f19e086eea18bc5375 Mon Sep 17 00:00:00 2001 From: luncliff Date: Sat, 31 Jul 2021 01:48:15 +0900 Subject: [PATCH 09/19] [onnx] finalize port works --- ports/onnx/portfile.cmake | 7 +------ ports/onnx/vcpkg.json | 5 ++++- versions/o-/onnx.json | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index c544fb8000fbdc..83f94ab5bba5f7 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -34,18 +34,13 @@ vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS ${FEATURE_OPTIONS} - -DPython_EXECUTABLE=${PYTHON3} -DPYTHON_EXECUTABLE=${PYTHON3} -DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_USE_LITE_PROTO=OFF -DONNX_BUILD_TESTS=OFF -DONNX_BUILD_BENCHMARKS=OFF ) -# These are custom targets for codegen -# Sadly there are no add_dependency controls in the project's CMakeLists.txt -vcpkg_cmake_build(TARGET gen_onnx_proto) -vcpkg_cmake_build(TARGET gen_onnx_operators_proto) -vcpkg_cmake_build(TARGET gen_onnx_data_proto) + if("pybind11" IN_LIST FEATURES) # This target is not in install/export vcpkg_cmake_build(TARGET onnx_cpp2py_export) diff --git a/ports/onnx/vcpkg.json b/ports/onnx/vcpkg.json index d3460d0412ac6d..707c9745ccc83d 100644 --- a/ports/onnx/vcpkg.json +++ b/ports/onnx/vcpkg.json @@ -17,7 +17,10 @@ ], "features": { "pybind11": { - "description": "Build Python binaries" + "description": "Build Python binaries", + "dependencies": [ + "pybind11" + ] } } } diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index 91c1112fac6f31..2b461df43eb42e 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "0ca1117788c80e931ae854ae17487daaecf3f4a8", + "git-tree": "963f7594dc1ae22d37e2d256ff154f813d73cf95", "version": "1.9.0", "port-version": 0 } From aa9547d0796d2957ee46776a46c38a342ccd2f66 Mon Sep 17 00:00:00 2001 From: luncliff Date: Sat, 31 Jul 2021 02:13:59 +0900 Subject: [PATCH 10/19] [onnx] resurrect 47a8e8e * fix version SHA --- ports/onnx/portfile.cmake | 3 ++- versions/o-/onnx.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index 83f94ab5bba5f7..2b5a0433969c99 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -34,7 +34,8 @@ vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS ${FEATURE_OPTIONS} - -DPYTHON_EXECUTABLE=${PYTHON3} + -DPython_EXECUTABLE=${PYTHON3} # for Windows + -DPYTHON_EXECUTABLE=${PYTHON3} # for configure_file of protoc-gen-mypy.py -DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_USE_LITE_PROTO=OFF -DONNX_BUILD_TESTS=OFF diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index 2b461df43eb42e..05db93d1c647b9 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "963f7594dc1ae22d37e2d256ff154f813d73cf95", + "git-tree": "5a0d95a1cf6502998635c8bdb58b1a5fbd416328", "version": "1.9.0", "port-version": 0 } From 7a1e2b7aec1ee36d6116952376836eb7ba9db859 Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Tue, 3 Aug 2021 16:01:11 +0900 Subject: [PATCH 11/19] Update ports/onnx/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/onnx/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index 2b5a0433969c99..c86a70220e918a 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -31,7 +31,7 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_find_acquire_program(PYTHON3) vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} -DPython_EXECUTABLE=${PYTHON3} # for Windows From fbb39b77a2741cbf241723937dbe2fc4e006e1dc Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Tue, 3 Aug 2021 16:01:19 +0900 Subject: [PATCH 12/19] Update ports/onnx/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/onnx/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index c86a70220e918a..6b3573642bff7a 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -50,7 +50,7 @@ vcpkg_cmake_install() vcpkg_copy_pdbs() vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ONNX) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) # install protobuf files together get_filename_component(CODEGEN_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/onnx ABSOLUTE) file(INSTALL ${CODEGEN_DIR}/onnx-data.proto From b0a41850672b8e6f53e2cb7c291b3f53927a50d3 Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Tue, 3 Aug 2021 16:01:27 +0900 Subject: [PATCH 13/19] Update ports/onnx/vcpkg.json Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/onnx/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/onnx/vcpkg.json b/ports/onnx/vcpkg.json index 707c9745ccc83d..03c35f75779bc2 100644 --- a/ports/onnx/vcpkg.json +++ b/ports/onnx/vcpkg.json @@ -1,6 +1,6 @@ { "name": "onnx", - "version": "1.9.0", + "version-semver": "1.9.0", "description": "Open standard for machine learning interoperability", "homepage": "https://onnx.ai", "supports": "!uwp", From d1d8dcdc0367ba84063d6d3956d886234eccee0d Mon Sep 17 00:00:00 2001 From: luncliff Date: Sat, 7 Aug 2021 03:02:03 +0900 Subject: [PATCH 14/19] [onnx] rewrite portfile, patch * add host dependencies for protoc/python3 * rewrite patch files to work with FindPython3 --- ports/onnx/fix-cmakelists.patch | 90 +++++++++++++++++++-------------- ports/onnx/fix-pybind11.patch | 32 ------------ ports/onnx/portfile.cmake | 88 +++++++++++++------------------- ports/onnx/vcpkg.json | 8 +++ versions/o-/onnx.json | 2 +- 5 files changed, 95 insertions(+), 125 deletions(-) delete mode 100644 ports/onnx/fix-pybind11.patch diff --git a/ports/onnx/fix-cmakelists.patch b/ports/onnx/fix-cmakelists.patch index faafe9dd633f75..65f118eeb937dc 100644 --- a/ports/onnx/fix-cmakelists.patch +++ b/ports/onnx/fix-cmakelists.patch @@ -1,38 +1,52 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 628dcaa..6758666 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -635,7 +635,7 @@ endif() - - if (NOT ANDROID AND NOT IOS) - # ---[ ONNXIFI wrapper -- add_library(onnxifi_wrapper MODULE onnx/onnxifi_wrapper.c) -+ add_library(onnxifi_wrapper onnx/onnxifi_wrapper.c) - if(MSVC) - add_msvc_runtime_flag(onnxifi_wrapper) - endif() -@@ -658,10 +658,6 @@ if (NOT ANDROID AND NOT IOS) - target_compile_definitions(onnxifi_wrapper PRIVATE "ONNXIFI_PUBLIC=__attribute__((__dllexport__))") - endif() - endif() -- if(APPLE) -- # By default CMake would use .so suffix on Mac -- set_target_properties(onnxifi_wrapper PROPERTIES SUFFIX ".dylib") -- endif() - endif() - - # ---[ ONNXIFI dummy backend -@@ -712,8 +708,11 @@ install(FILES - install(EXPORT ONNXTargets DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ONNX") - install(TARGETS - onnx onnx_proto -- onnxifi onnxifi_dummy onnxifi_loader -- EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ onnxifi onnxifi_loader # onnxifi_dummy -+ EXPORT ONNXTargets -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - if(NOT ANDROID AND NOT IOS) - install(TARGETS onnxifi_wrapper +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 628dcaa..7ca07fb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -111,8 +111,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(PythonLibs ${PY_VERSION}) ++find_package(Python3 COMPONENTS Interpreter Development REQUIRED) ++set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) + + if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) +@@ -444,7 +444,7 @@ if(BUILD_ONNX_PYTHON) + ${PYTHON_INCLUDE_DIR}) + + # pybind11 is a header only lib +- find_package(pybind11 2.2) ++ find_package(pybind11 2.2 CONFIG REQUIRED) + if(pybind11_FOUND) + target_include_directories(onnx_cpp2py_export PUBLIC + ${pybind11_INCLUDE_DIRS}) +@@ -687,6 +687,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() ++ + install(DIRECTORY ${ONNX_ROOT}/onnx + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING diff --git a/ports/onnx/fix-pybind11.patch b/ports/onnx/fix-pybind11.patch deleted file mode 100644 index 46bf3d6b55c99a..00000000000000 --- a/ports/onnx/fix-pybind11.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3861def..88265fb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -110,9 +110,11 @@ 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(PythonLibs ${PY_VERSION}) -+if(WIN32) -+ find_package(Python ${PY_VERSION} COMPONENTS Interpreter REQUIRED) -+else() -+ find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) -+endif() - - if(CMAKE_SYSTEM_NAME STREQUAL "AIX") - set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) -@@ -441,10 +439,10 @@ if(BUILD_ONNX_PYTHON) - $ - $ - $ -- ${PYTHON_INCLUDE_DIR}) -+ ${Python_INCLUDE_DIRS}) - - # pybind11 is a header only lib -- find_package(pybind11 2.2) -+ find_package(pybind11 2.2 CONFIG REQUIRED) - if(pybind11_FOUND) - target_include_directories(onnx_cpp2py_export PUBLIC - ${pybind11_INCLUDE_DIRS}) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index 6b3573642bff7a..728c1c6eb73d9e 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -1,5 +1,6 @@ # uwp: LOAD_LIBRARY_SEARCH_DEFAULT_DIRS undefined identifier vcpkg_fail_port_install(ON_TARGET "uwp") +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -8,7 +9,6 @@ vcpkg_from_github( SHA512 a3eecc74ce4f22524603fb86367d21c87a143ba27eef93ef4bd2e2868c2cadeb724b84df58a429286e7824adebdeba7fa059095b7ab29df8dcea8777bd7f4101 PATCHES fix-cmakelists.patch - fix-pybind11.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -16,27 +16,27 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS pybind11 BUILD_ONNX_PYTHON ) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" USE_PROTOBUF_SHARED) -list(APPEND FEATURE_OPTIONS - -DONNX_USE_PROTOBUF_SHARED_LIBS=${USE_PROTOBUF_SHARED} -) if(VCPKG_TARGET_IS_WINDOWS) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" USE_STATIC_RUNTIME) - list(APPEND FEATURE_OPTIONS + list(APPEND PLATFORM_OPTIONS -DONNX_USE_MSVC_STATIC_RUNTIME=${USE_STATIC_RUNTIME} ) endif() -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_find_acquire_program(PYTHON3) +# ONNX_USE_PROTOBUF_SHARED_LIBS: find the library and check its suffix +find_library(PROTOBUF_LIBPATH NAMES protobuf PATHS ${CURRENT_INSTALLED_DIR}/bin ${CURRENT_INSTALLED_DIR}/lib REQUIRED) +get_filename_component(PROTOBUF_LIBPATH ${PROTOBUF_LIBPATH} NAME) +string(COMPARE EQUAL "${PROTOBUF_LIBPATH}" "${CMAKE_SHARED_LIBRARY_SUFFIX}" USE_PROTOBUF_SHARED) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} - -DPython_EXECUTABLE=${PYTHON3} # for Windows - -DPYTHON_EXECUTABLE=${PYTHON3} # for configure_file of protoc-gen-mypy.py + -DPython3_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DPY_VERSION=3.9 # see version of the 'python3' package + -DONNX_ML=ON -DONNX_GEN_PB_TYPE_STUBS=ON + -DONNX_USE_PROTOBUF_SHARED_LIBS=${USE_PROTOBUF_SHARED} -DONNX_USE_LITE_PROTO=OFF -DONNX_BUILD_TESTS=OFF -DONNX_BUILD_BENCHMARKS=OFF @@ -51,50 +51,30 @@ vcpkg_copy_pdbs() vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ONNX) file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -# install protobuf files together -get_filename_component(CODEGEN_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/onnx ABSOLUTE) -file(INSTALL ${CODEGEN_DIR}/onnx-data.proto - ${CODEGEN_DIR}/onnx-data.proto3 - ${CODEGEN_DIR}/onnx-ml.proto - ${CODEGEN_DIR}/onnx-ml.proto3 - ${CODEGEN_DIR}/onnx-operators-ml.proto - ${CODEGEN_DIR}/onnx-operators-ml.proto3 - DESTINATION ${CURRENT_PACKAGES_DIR}/include/onnx -) -if("pybind11" IN_LIST FEATURES) - file(INSTALL ${CODEGEN_DIR}/onnx_data_pb.py - ${CODEGEN_DIR}/onnx_data_pb2.py - ${CODEGEN_DIR}/onnx_ml_pb2.py - ${CODEGEN_DIR}/onnx_operators_ml_pb2.py - ${CODEGEN_DIR}/onnx_operators_pb.py - ${CODEGEN_DIR}/onnx_pb.py - DESTINATION ${CURRENT_PACKAGES_DIR}/include/onnx - ) -endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/debug/share - ${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/onnx_cpp2py_export +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/tools - ${CURRENT_PACKAGES_DIR}/include/onnx/test - ${CURRENT_PACKAGES_DIR}/include/onnx/bin - ${CURRENT_PACKAGES_DIR}/include/onnx/examples - ${CURRENT_PACKAGES_DIR}/include/onnx/frontend - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/training - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/math - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/quantization - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/generator - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/reduction - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/logical - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/object_detection - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/traditionalml - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/sequence - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/controlflow - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/rnn - ${CURRENT_PACKAGES_DIR}/include/onnx/defs/nn + "${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/onnx_cpp2py_export" + "${CURRENT_PACKAGES_DIR}/include/onnx/backend" + "${CURRENT_PACKAGES_DIR}/include/onnx/tools" + "${CURRENT_PACKAGES_DIR}/include/onnx/test" + "${CURRENT_PACKAGES_DIR}/include/onnx/bin" + "${CURRENT_PACKAGES_DIR}/include/onnx/examples" + "${CURRENT_PACKAGES_DIR}/include/onnx/frontend" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/controlflow" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/generator" + "${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/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/traditionalml" + "${CURRENT_PACKAGES_DIR}/include/onnx/defs/training" ) diff --git a/ports/onnx/vcpkg.json b/ports/onnx/vcpkg.json index 03c35f75779bc2..6f9ee73238067e 100644 --- a/ports/onnx/vcpkg.json +++ b/ports/onnx/vcpkg.json @@ -6,6 +6,14 @@ "supports": "!uwp", "dependencies": [ "protobuf", + { + "name": "protobuf", + "host": true + }, + { + "name": "python3", + "host": true + }, { "name": "vcpkg-cmake", "host": true diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index 05db93d1c647b9..667c4a048be807 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "5a0d95a1cf6502998635c8bdb58b1a5fbd416328", + "git-tree": "14358dd3831ca29171e3f165e1ab1bc1e8e23c7c", "version": "1.9.0", "port-version": 0 } From 47c0d2a1a0f558177feebea94aa6e884d16ccd7f Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Sat, 7 Aug 2021 04:28:11 +0900 Subject: [PATCH 15/19] [onnx] exclude onnxifi targets * use more correct detection of protobuf shared libs --- ports/onnx/fix-cmakelists.patch | 121 +++++++++++++++----------- ports/onnx/portfile.cmake | 15 +++- ports/onnx/wrap-onnxifi-targets.patch | 46 ++++++++++ versions/o-/onnx.json | 2 +- 4 files changed, 127 insertions(+), 57 deletions(-) create mode 100644 ports/onnx/wrap-onnxifi-targets.patch diff --git a/ports/onnx/fix-cmakelists.patch b/ports/onnx/fix-cmakelists.patch index 65f118eeb937dc..a6be6f590ad92c 100644 --- a/ports/onnx/fix-cmakelists.patch +++ b/ports/onnx/fix-cmakelists.patch @@ -1,52 +1,69 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 628dcaa..7ca07fb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -111,8 +111,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(PythonLibs ${PY_VERSION}) -+find_package(Python3 COMPONENTS Interpreter Development REQUIRED) -+set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) - - if(CMAKE_SYSTEM_NAME STREQUAL "AIX") - set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) -@@ -444,7 +444,7 @@ if(BUILD_ONNX_PYTHON) - ${PYTHON_INCLUDE_DIR}) - - # pybind11 is a header only lib -- find_package(pybind11 2.2) -+ find_package(pybind11 2.2 CONFIG REQUIRED) - if(pybind11_FOUND) - target_include_directories(onnx_cpp2py_export PUBLIC - ${pybind11_INCLUDE_DIRS}) -@@ -687,6 +687,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() -+ - install(DIRECTORY ${ONNX_ROOT}/onnx - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 628dcaa..2e30404 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -111,8 +111,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(PythonLibs ${PY_VERSION}) ++find_package(Python3 ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) ++set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) + + if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) +@@ -441,10 +441,13 @@ if(BUILD_ONNX_PYTHON) + $ + $ + $ +- ${PYTHON_INCLUDE_DIR}) +- ++ ${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) ++ find_package(pybind11 2.2 CONFIG REQUIRED) + if(pybind11_FOUND) + target_include_directories(onnx_cpp2py_export PUBLIC + ${pybind11_INCLUDE_DIRS}) +@@ -687,6 +690,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() ++ + install(DIRECTORY ${ONNX_ROOT}/onnx + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING +@@ -714,7 +738,7 @@ install(TARGETS + onnx onnx_proto + onnxifi onnxifi_dummy onnxifi_loader + EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- ++ + if(NOT ANDROID AND NOT IOS) + install(TARGETS onnxifi_wrapper + EXPORT ONNXTargets DESTINATION lib) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index 728c1c6eb73d9e..155842d537d495 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( SHA512 a3eecc74ce4f22524603fb86367d21c87a143ba27eef93ef4bd2e2868c2cadeb724b84df58a429286e7824adebdeba7fa059095b7ab29df8dcea8777bd7f4101 PATCHES fix-cmakelists.patch + wrap-onnxifi-targets.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -23,10 +24,16 @@ if(VCPKG_TARGET_IS_WINDOWS) ) endif() -# ONNX_USE_PROTOBUF_SHARED_LIBS: find the library and check its suffix +# 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_LIBPATH ${PROTOBUF_LIBPATH} NAME) -string(COMPARE EQUAL "${PROTOBUF_LIBPATH}" "${CMAKE_SHARED_LIBRARY_SUFFIX}" USE_PROTOBUF_SHARED) +get_filename_component(PROTOBUF_LIBNAME ${PROTOBUF_LIBPATH} NAME) +if(PROTOBUF_LIBNAME MATCHES ${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(USE_PROTOBUF_SHARED ON) +else() + set(USE_PROTOBUF_SHARED OFF) +endif() + +vcpkg_add_to_path(PREPEND ${CURRENT_INSTALLED_DIR}/tools/python3) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" @@ -38,6 +45,7 @@ vcpkg_cmake_configure( -DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_USE_PROTOBUF_SHARED_LIBS=${USE_PROTOBUF_SHARED} -DONNX_USE_LITE_PROTO=OFF + -DONNXIFI_ENABLE_EXT=OFF -DONNX_BUILD_TESTS=OFF -DONNX_BUILD_BENCHMARKS=OFF ) @@ -47,7 +55,6 @@ if("pybind11" IN_LIST FEATURES) vcpkg_cmake_build(TARGET onnx_cpp2py_export) endif() vcpkg_cmake_install() -vcpkg_copy_pdbs() vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ONNX) file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/onnx/wrap-onnxifi-targets.patch b/ports/onnx/wrap-onnxifi-targets.patch new file mode 100644 index 00000000000000..d7549d6603dabe --- /dev/null +++ b/ports/onnx/wrap-onnxifi-targets.patch @@ -0,0 +1,46 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2e30404..1cecbe4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -613,6 +613,7 @@ if(APPLE) + set_target_properties(onnx PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") + endif() + ++if(ONNXIFI_ENABLE_EXT) + # ---[ ONNX Interface for Framework Integratin (ONNXIFI) + add_library(onnxifi INTERFACE) + target_include_directories(onnxifi INTERFACE +@@ -687,6 +688,7 @@ if(MSVC) + # lists from 'identifier2' + ) + endif() ++endif() # ONNXIFI_ENABLE_EXT + + include(GNUInstallDirs) + +@@ -736,9 +738,15 @@ install(FILES + install(EXPORT ONNXTargets DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ONNX") + install(TARGETS + onnx onnx_proto +- onnxifi onnxifi_dummy onnxifi_loader + EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- ++if(ONNXIFI_ENABLE_EXT) ++ install(TARGETS ++ onnxifi onnxifi_dummy onnxifi_loader ++ EXPORT ONNXTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ + if(NOT ANDROID AND NOT IOS) + install(TARGETS onnxifi_wrapper + EXPORT ONNXTargets DESTINATION lib) +@@ -747,6 +755,7 @@ endif() + if(ONNXIFI_DUMMY_BACKEND) + add_definitions(-DONNXIFI_DUMMY_BACKEND=1) + endif() ++endif() # ONNXIFI_ENABLE_EXT + + if(ONNX_BUILD_TESTS) + include(${ONNX_ROOT}/cmake/unittest.cmake) diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index 667c4a048be807..d191b6a27c9fad 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "14358dd3831ca29171e3f165e1ab1bc1e8e23c7c", + "git-tree": "4cb086e3a03dd42d9cb575b127e5ccda7d28c0a2", "version": "1.9.0", "port-version": 0 } From c9dacb1c7971a7aed89e78720017991db5554f86 Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Sat, 7 Aug 2021 04:58:46 +0900 Subject: [PATCH 16/19] [onnx] use HOST_INSTALLED_DIR for python3 --- ports/onnx/portfile.cmake | 4 ++-- versions/o-/onnx.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index 155842d537d495..8f238067db7cc9 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -33,13 +33,13 @@ else() set(USE_PROTOBUF_SHARED OFF) endif() -vcpkg_add_to_path(PREPEND ${CURRENT_INSTALLED_DIR}/tools/python3) +vcpkg_add_to_path(PREPEND ${CURRENT_HOST_INSTALLED_DIR}/tools/python3) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} - -DPython3_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DPython3_ROOT_DIR=${CURRENT_HOST_INSTALLED_DIR} -DPY_VERSION=3.9 # see version of the 'python3' package -DONNX_ML=ON -DONNX_GEN_PB_TYPE_STUBS=ON diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index d191b6a27c9fad..11527812aadae2 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "4cb086e3a03dd42d9cb575b127e5ccda7d28c0a2", - "version": "1.9.0", + "git-tree": "dedcc28eeb27b1bbab0ddac0d16875067a63318a", + "version-semver": "1.9.0", "port-version": 0 } ] From 6c9d4ad26590d7afa5fc1d038178d48b220c3c05 Mon Sep 17 00:00:00 2001 From: luncliff Date: Sun, 8 Aug 2021 23:55:35 +0900 Subject: [PATCH 17/19] [onnx] handle Development component of Python3 * split the use of find_package(Python3) update patch files * More comment in portfile.cmake --- ports/onnx/fix-cmakelists.patch | 137 +++++++++++++------------- ports/onnx/portfile.cmake | 29 ++++-- ports/onnx/wrap-onnxifi-targets.patch | 90 +++++++++-------- versions/o-/onnx.json | 2 +- 4 files changed, 133 insertions(+), 125 deletions(-) diff --git a/ports/onnx/fix-cmakelists.patch b/ports/onnx/fix-cmakelists.patch index a6be6f590ad92c..e6c68370b27992 100644 --- a/ports/onnx/fix-cmakelists.patch +++ b/ports/onnx/fix-cmakelists.patch @@ -1,69 +1,68 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 628dcaa..2e30404 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -111,8 +111,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(PythonLibs ${PY_VERSION}) -+find_package(Python3 ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) -+set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) - - if(CMAKE_SYSTEM_NAME STREQUAL "AIX") - set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) -@@ -441,10 +441,13 @@ if(BUILD_ONNX_PYTHON) - $ - $ - $ -- ${PYTHON_INCLUDE_DIR}) -- -+ ${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) -+ find_package(pybind11 2.2 CONFIG REQUIRED) - if(pybind11_FOUND) - target_include_directories(onnx_cpp2py_export PUBLIC - ${pybind11_INCLUDE_DIRS}) -@@ -687,6 +690,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() -+ - install(DIRECTORY ${ONNX_ROOT}/onnx - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING -@@ -714,7 +738,7 @@ install(TARGETS - onnx onnx_proto - onnxifi onnxifi_dummy onnxifi_loader - EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- -+ - if(NOT ANDROID AND NOT IOS) - install(TARGETS onnxifi_wrapper - EXPORT ONNXTargets DESTINATION lib) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 628dcaa..300e4ea 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -111,8 +111,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(PythonLibs ${PY_VERSION}) ++find_package(Python3 ${PY_VERSION} COMPONENTS Interpreter REQUIRED) ++set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) + + if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) +@@ -422,6 +422,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") +@@ -441,10 +442,13 @@ if(BUILD_ONNX_PYTHON) + $ + $ + $ +- ${PYTHON_INCLUDE_DIR}) +- ++ ${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) ++ find_package(pybind11 2.2 CONFIG REQUIRED) + if(pybind11_FOUND) + target_include_directories(onnx_cpp2py_export PUBLIC + ${pybind11_INCLUDE_DIRS}) +@@ -687,6 +691,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() ++ + install(DIRECTORY ${ONNX_ROOT}/onnx + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index 8f238067db7cc9..240ec1e1f753fb 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -12,11 +12,6 @@ vcpkg_from_github( wrap-onnxifi-targets.patch ) -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - pybind11 BUILD_ONNX_PYTHON -) - if(VCPKG_TARGET_IS_WINDOWS) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" USE_STATIC_RUNTIME) list(APPEND PLATFORM_OPTIONS @@ -33,14 +28,30 @@ else() set(USE_PROTOBUF_SHARED OFF) endif() -vcpkg_add_to_path(PREPEND ${CURRENT_HOST_INSTALLED_DIR}/tools/python3) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + pybind11 BUILD_ONNX_PYTHON +) + +# Like protoc, python is required for codegen. Hijack the Python3_EXECUTABLE +vcpkg_find_acquire_program(PYTHON3) + +# PATH for .bat scripts can find 'python' +get_filename_component(PYTHON_DIR ${PYTHON3} PATH) +vcpkg_add_to_path(PREPEND ${PYTHON_DIR}) + +if("pybind11" IN_LIST FEATURES) + # When BUILD_ONNX_PYTHON, we need Development component. Give a hint for FindPython3 + list(APPEND FEATURE_OPTIONS + -DPython3_ROOT_DIR=${CURRENT_INSTALLED_DIR} + ) +endif() vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS - ${FEATURE_OPTIONS} - -DPython3_ROOT_DIR=${CURRENT_HOST_INSTALLED_DIR} - -DPY_VERSION=3.9 # see version of the 'python3' package + ${FEATURE_OPTIONS} ${PLATFORM_OPTIONS} + -DPython3_EXECUTABLE=${PYTHON3} -DONNX_ML=ON -DONNX_GEN_PB_TYPE_STUBS=ON -DONNX_USE_PROTOBUF_SHARED_LIBS=${USE_PROTOBUF_SHARED} diff --git a/ports/onnx/wrap-onnxifi-targets.patch b/ports/onnx/wrap-onnxifi-targets.patch index d7549d6603dabe..598edf6030b079 100644 --- a/ports/onnx/wrap-onnxifi-targets.patch +++ b/ports/onnx/wrap-onnxifi-targets.patch @@ -1,46 +1,44 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2e30404..1cecbe4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -613,6 +613,7 @@ if(APPLE) - set_target_properties(onnx PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") - endif() - -+if(ONNXIFI_ENABLE_EXT) - # ---[ ONNX Interface for Framework Integratin (ONNXIFI) - add_library(onnxifi INTERFACE) - target_include_directories(onnxifi INTERFACE -@@ -687,6 +688,7 @@ if(MSVC) - # lists from 'identifier2' - ) - endif() -+endif() # ONNXIFI_ENABLE_EXT - - include(GNUInstallDirs) - -@@ -736,9 +738,15 @@ install(FILES - install(EXPORT ONNXTargets DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ONNX") - install(TARGETS - onnx onnx_proto -- onnxifi onnxifi_dummy onnxifi_loader - EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- -+if(ONNXIFI_ENABLE_EXT) -+ install(TARGETS -+ onnxifi onnxifi_dummy onnxifi_loader -+ EXPORT ONNXTargets -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ - if(NOT ANDROID AND NOT IOS) - install(TARGETS onnxifi_wrapper - EXPORT ONNXTargets DESTINATION lib) -@@ -747,6 +755,7 @@ endif() - if(ONNXIFI_DUMMY_BACKEND) - add_definitions(-DONNXIFI_DUMMY_BACKEND=1) - endif() -+endif() # ONNXIFI_ENABLE_EXT - - if(ONNX_BUILD_TESTS) - include(${ONNX_ROOT}/cmake/unittest.cmake) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 300e4ea..155dd0d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -614,6 +614,7 @@ if(APPLE) + set_target_properties(onnx PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") + endif() + ++if(ONNXIFI_ENABLE_EXT) + # ---[ ONNX Interface for Framework Integratin (ONNXIFI) + add_library(onnxifi INTERFACE) + target_include_directories(onnxifi INTERFACE +@@ -688,6 +689,7 @@ if(MSVC) + # lists from 'identifier2' + ) + endif() ++endif() # ONNXIFI_ENABLE_EXT + + include(GNUInstallDirs) + +@@ -737,8 +739,14 @@ install(FILES + install(EXPORT ONNXTargets DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ONNX") + install(TARGETS + onnx onnx_proto +- onnxifi onnxifi_dummy onnxifi_loader + EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++if(ONNXIFI_ENABLE_EXT) ++ install(TARGETS ++ onnxifi onnxifi_dummy onnxifi_loader ++ EXPORT ONNXTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if(NOT ANDROID AND NOT IOS) + install(TARGETS onnxifi_wrapper +@@ -748,6 +756,7 @@ endif() + if(ONNXIFI_DUMMY_BACKEND) + add_definitions(-DONNXIFI_DUMMY_BACKEND=1) + endif() ++endif() # ONNXIFI_ENABLE_EXT + + if(ONNX_BUILD_TESTS) + include(${ONNX_ROOT}/cmake/unittest.cmake) diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index 11527812aadae2..c9e0cc6bf5111b 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "dedcc28eeb27b1bbab0ddac0d16875067a63318a", + "git-tree": "e7a99d3e87c6f3645cbacf29745393e3c0c0b925", "version-semver": "1.9.0", "port-version": 0 } From 8860d9ffa62f5e420ec0f5a54ab0eea78e510f11 Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Mon, 16 Aug 2021 15:35:56 +0900 Subject: [PATCH 18/19] Update ports/onnx/portfile.cmake Co-authored-by: Billy O'Neal --- ports/onnx/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/onnx/portfile.cmake b/ports/onnx/portfile.cmake index 240ec1e1f753fb..1c565ab0d5f302 100644 --- a/ports/onnx/portfile.cmake +++ b/ports/onnx/portfile.cmake @@ -33,7 +33,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS pybind11 BUILD_ONNX_PYTHON ) -# Like protoc, python is required for codegen. Hijack the Python3_EXECUTABLE +# Like protoc, python is required for codegen. vcpkg_find_acquire_program(PYTHON3) # PATH for .bat scripts can find 'python' From fb77615bc991276af10a3da177d49ba1ab1c54a1 Mon Sep 17 00:00:00 2001 From: luncliff Date: Mon, 16 Aug 2021 16:41:32 +0900 Subject: [PATCH 19/19] [onnx] update version SHA --- versions/o-/onnx.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/onnx.json b/versions/o-/onnx.json index c9e0cc6bf5111b..5f4fc6e16a5846 100644 --- a/versions/o-/onnx.json +++ b/versions/o-/onnx.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "e7a99d3e87c6f3645cbacf29745393e3c0c0b925", + "git-tree": "b53c9c9e969928def925c57ea5ddcdfb09293693", "version-semver": "1.9.0", "port-version": 0 }