mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-13 11:01:06 +08:00
166 lines
6.2 KiB
CMake
166 lines
6.2 KiB
CMake
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO openvinotoolkit/openvino
|
|
REF "${VERSION}"
|
|
SHA512 25ec2bb4c087f58033681920b027d43b1778b60042e3bee358b54c83b0296ac0b754880db6bd4fce94fefe8b53d129ff3ec51f17bcb42f4b7adcdc532701f801
|
|
PATCHES
|
|
# vcpkg specific patch, because OV creates a file in source tree, which is prohibited
|
|
001-disable-tools.patch
|
|
# https://github.com/openvinotoolkit/openvino/pull/25937
|
|
# onnx codegen cmake script taints source directory
|
|
002-fix-onnx-codegen.patch
|
|
HEAD_REF master)
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
FEATURES
|
|
cpu ENABLE_INTEL_CPU
|
|
gpu ENABLE_INTEL_GPU
|
|
npu ENABLE_INTEL_NPU
|
|
auto ENABLE_AUTO
|
|
hetero ENABLE_HETERO
|
|
auto-batch ENABLE_AUTO_BATCH
|
|
ir ENABLE_OV_IR_FRONTEND
|
|
onnx ENABLE_OV_ONNX_FRONTEND
|
|
paddle ENABLE_OV_PADDLE_FRONTEND
|
|
pytorch ENABLE_OV_PYTORCH_FRONTEND
|
|
tensorflow ENABLE_OV_TF_FRONTEND
|
|
tensorflow-lite ENABLE_OV_TF_LITE_FRONTEND
|
|
)
|
|
|
|
if(ENABLE_INTEL_GPU)
|
|
# python is required for conversion of OpenCL source files into .cpp.
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
# remove 'rapidjson' directory and use vcpkg's one to comply with ODR
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/src/plugins/intel_gpu/thirdparty/rapidjson)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND ENABLE_INTEL_CPU)
|
|
message(WARNING
|
|
"OneDNN for GPU is not available for static build, which is required for dGPU. "
|
|
"Please, consider using VCPKG_LIBRARY_LINKAGE=\"dynamic\" or disable CPU plugin, "
|
|
"which uses another flavor of oneDNN.")
|
|
else()
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH DEP_SOURCE_PATH
|
|
REPO oneapi-src/oneDNN
|
|
REF 7ab8ee9adda866d675edeee7a3a6a29b2d0a1572
|
|
SHA512 03d0adab0cbb8b2841bd5de73a21911d63314f0a6299590e2396f42ca66673743c32ef1ec72e856cdac863802632b1e9a065bfffd75659e2007db581e1052e89
|
|
)
|
|
file(COPY "${DEP_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/src/plugins/intel_gpu/thirdparty/onednn_gpu")
|
|
endif()
|
|
|
|
list(APPEND FEATURE_OPTIONS
|
|
"-DENABLE_SYSTEM_OPENCL=ON"
|
|
"-DPython3_EXECUTABLE=${PYTHON3}")
|
|
endif()
|
|
|
|
if(ENABLE_INTEL_CPU)
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH DEP_SOURCE_PATH
|
|
REPO openvinotoolkit/oneDNN
|
|
REF f0f8defe2dff5058391f2a66e775e20b5de33b08
|
|
SHA512 d52d1ea504bc3ae7cdd01f7fce80f28231827b3778acda232201ec90c119cb845c4b406ac639d63a8f05ccc91063fbf5f405ba36332c5f539531c01ce9443b5f
|
|
)
|
|
file(COPY "${DEP_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/src/plugins/intel_cpu/thirdparty/onednn")
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH DEP_SOURCE_PATH
|
|
REPO openvinotoolkit/mlas
|
|
REF d1bc25ec4660cddd87804fcf03b2411b5dfb2e94
|
|
SHA512 8d6dd319924135b7b22940d623305bf200b812ae64cde79000709de4fad429fbd43794301ef16e6f10ed7132777b7a73e9f30ecae7c030aea80d57d7c0ce4500
|
|
)
|
|
file(COPY "${DEP_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/src/plugins/intel_cpu/thirdparty/mlas")
|
|
|
|
if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm")
|
|
# scons (python tool) is required for ARM Compute Library building
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
x_vcpkg_get_python_packages(
|
|
PYTHON_VERSION 3
|
|
PYTHON_EXECUTABLE ${PYTHON3}
|
|
PACKAGES scons
|
|
OUT_PYTHON_VAR OV_PYTHON_WITH_SCONS
|
|
)
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH DEP_SOURCE_PATH
|
|
REPO ARM-software/ComputeLibrary
|
|
REF v24.06
|
|
SHA512 d020e4bb710534bb5789355f7396729a9230ce3ce8e0194df7e66750efe0667e38334e1e3696fa07496cf34de38ffcecd1ff6de266fb0e8d85f4f1c60ed9f782
|
|
)
|
|
file(COPY "${DEP_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/src/plugins/intel_cpu/thirdparty/ComputeLibrary")
|
|
endif()
|
|
endif()
|
|
|
|
if(ENABLE_INTEL_NPU)
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH DEP_SOURCE_PATH
|
|
REPO oneapi-src/level-zero
|
|
REF 4ed13f327d3389285592edcf7598ec3cb2bc712e
|
|
SHA512 1159b2dc59ffe201821aa6c4c65c1803f8be26654a5f7e09d4e2cea70afdaf6a49508acbc74279d2d5c8fc7b632ad29b70ea506c442cd599d7db47323de9e62d
|
|
)
|
|
file(COPY "${DEP_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/src/plugins/intel_npu/thirdparty/level-zero")
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH DEP_SOURCE_PATH
|
|
REPO intel/level-zero-npu-extensions
|
|
REF 16c85231a82ee1a0b06ed7ab7da3f411a0878ed7
|
|
SHA512 983468c7706dc44cfc248c491cf51d2f69181c16ae1e400ca689df39c51112e03227c2f311173b1665115cdd33fa7d51d48e75adaf8353564a980b37c16aaa66
|
|
)
|
|
file(COPY "${DEP_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/src/plugins/intel_npu/thirdparty/level-zero-ext")
|
|
endif()
|
|
|
|
if(ENABLE_OV_TF_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_PADDLE_FRONTEND)
|
|
list(APPEND FEATURE_OPTIONS "-DENABLE_SYSTEM_PROTOBUF=ON")
|
|
endif()
|
|
|
|
if(ENABLE_OV_TF_FRONTEND)
|
|
list(APPEND FEATURE_OPTIONS "-DENABLE_SYSTEM_SNAPPY=ON")
|
|
endif()
|
|
|
|
if(ENABLE_OV_TF_LITE_FRONTEND)
|
|
list(APPEND FEATURE_OPTIONS "-DENABLE_SYSTEM_FLATBUFFERS=ON")
|
|
endif()
|
|
|
|
if(CMAKE_HOST_WIN32)
|
|
list(APPEND FEATURE_OPTIONS "-DENABLE_API_VALIDATOR=OFF")
|
|
endif()
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS
|
|
${FEATURE_OPTIONS}
|
|
"-DENABLE_SYSTEM_TBB=ON"
|
|
"-DENABLE_SYSTEM_PUGIXML=ON"
|
|
"-DENABLE_TBBBIND_2_5=OFF"
|
|
"-DENABLE_CLANG_FORMAT=OFF"
|
|
"-DENABLE_NCC_STYLE=OFF"
|
|
"-DENABLE_CPPLINT=OFF"
|
|
"-DENABLE_SAMPLES=OFF"
|
|
"-DENABLE_TEMPLATE=OFF"
|
|
"-DENABLE_PYTHON=OFF"
|
|
"-DCPACK_GENERATOR=VCPKG"
|
|
"-DENABLE_JS=OFF"
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
|
|
vcpkg_install_copyright(
|
|
FILE_LIST
|
|
"${SOURCE_PATH}/LICENSE"
|
|
"${SOURCE_PATH}/licensing/third-party-programs.txt"
|
|
"${SOURCE_PATH}/licensing/onednn_third-party-programs.txt"
|
|
"${SOURCE_PATH}/licensing/runtime-third-party-programs.txt"
|
|
COMMENT
|
|
"OpenVINO License")
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|