mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 04:43:02 +08:00
[xnnpack] create a new port (#17064)
* [xnnpack] create a new port * [xnnpack] create a patch * [cpuinfo] update to latest * [cpuinfo] update baseline and port SHA * Update ports/cpuinfo/fix-install.patch Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/cpuinfo/fix-install.patch Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/cpuinfo/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/cpuinfo/fix-install.patch Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [cpuinfo] update port SHA * [cpuinfo] recover find_package * fixup target path to `share/unofficial-cpuinfo` * change IMPORTED target name to `unofficial::cpuinfo::cpuinfo` * [fbgemm] resolve failure after cpuinfo rename * change cpuinfo::cpuinfo to unofficial * [fbgemm] update port version * [nnpack] use changes target name * [nnpack] update port-version * [pthreadpool] support find_package * update to latest source code * [pthreadpool] update port version * [pthreadpool] support uwp * use WindowStore in platform check * [xnnpack] support find_package * windows: static build * export with namespace `unofficial::` * [xnnpack] update code to latest * change snapshot to resolve linux compile errors * [xnnpack] "supports" in manifest * update baseline & port SHA * [xnnpack] use 'vcpkg-cmake' ports * update port git-tree SHA * [xnnpack] remove unused configure options * [xnnpack] update code version * snapshot: 21/04/10 -> 21/05/17 Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> Co-authored-by: Billy Robert ONeal III <bion@microsoft.com>
This commit is contained in:
parent
44e8841e06
commit
968c5eba7b
33
ports/xnnpack/portfile.cmake
Normal file
33
ports/xnnpack/portfile.cmake
Normal file
@ -0,0 +1,33 @@
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO google/XNNPACK
|
||||
REF 5223fd1922d9d965ddb07865d1d13293069fab65 # 2021-05-17
|
||||
SHA512 5c1eb9171a046c683d5a96ae70b6dab36c415c981e8f29857d16ad67afa22681f0fe6f7623527200fd954403d50b036bb2892ba44e397d639860b9ec4873e7c6
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
use-packages.patch
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS
|
||||
-DXNNPACK_USE_SYSTEM_LIBS=ON
|
||||
-DXNNPACK_ENABLE_ASSEMBLY=ON
|
||||
-DXNNPACK_ENABLE_MEMOPT=ON
|
||||
-DXNNPACK_ENABLE_SPARSE=ON
|
||||
-DXNNPACK_BUILD_TESTS=OFF
|
||||
-DXNNPACK_BUILD_BENCHMARKS=OFF
|
||||
)
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_cmake_config_fixup()
|
||||
|
||||
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
|
||||
)
|
90
ports/xnnpack/use-packages.patch
Normal file
90
ports/xnnpack/use-packages.patch
Normal file
@ -0,0 +1,90 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b69ce50c..1e8938b7 100755
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -3042,7 +3032,7 @@ ELSE()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
-TARGET_INCLUDE_DIRECTORIES(XNNPACK PUBLIC include)
|
||||
+TARGET_INCLUDE_DIRECTORIES(XNNPACK PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
TARGET_INCLUDE_DIRECTORIES(XNNPACK PRIVATE src)
|
||||
IF(WIN32)
|
||||
# Target Windows 7+ API
|
||||
@@ -3057,7 +3047,7 @@ IF(LIBM)
|
||||
ENDIF()
|
||||
|
||||
# ---[ Configure clog
|
||||
-IF(NOT TARGET clog)
|
||||
+IF(FALSE)
|
||||
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
||||
SET(CLOG_BUILD_TESTS OFF CACHE BOOL "")
|
||||
SET(CLOG_RUNTIME_TYPE "${CPUINFO_RUNTIME_TYPE}" CACHE STRING "")
|
||||
@@ -3075,10 +3065,9 @@ IF(NOT TARGET clog)
|
||||
SET_PROPERTY(TARGET clog PROPERTY IMPORTED_LOCATION "${CLOG_LIBRARY}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
-TARGET_LINK_LIBRARIES(XNNPACK PRIVATE clog)
|
||||
|
||||
# ---[ Configure cpuinfo
|
||||
-IF(NOT TARGET cpuinfo)
|
||||
+IF(FALSE)
|
||||
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
||||
SET(CPUINFO_BUILD_TOOLS OFF CACHE BOOL "")
|
||||
SET(CPUINFO_BUILD_UNIT_TESTS OFF CACHE BOOL "")
|
||||
@@ -3096,10 +3085,11 @@ IF(NOT TARGET cpuinfo)
|
||||
SET_PROPERTY(TARGET cpuinfo PROPERTY IMPORTED_LOCATION "${CPUINFO_LIBRARY}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
-TARGET_LINK_LIBRARIES(XNNPACK PRIVATE cpuinfo)
|
||||
+find_package(unofficial-cpuinfo CONFIG REQUIRED)
|
||||
+target_link_libraries(XNNPACK PUBLIC unofficial::cpuinfo::clog unofficial::cpuinfo::cpuinfo)
|
||||
|
||||
# ---[ Configure pthreadpool
|
||||
-IF(NOT TARGET pthreadpool)
|
||||
+IF(FALSE)
|
||||
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
||||
SET(PTHREADPOOL_BUILD_TESTS OFF CACHE BOOL "")
|
||||
SET(PTHREADPOOL_BUILD_BENCHMARKS OFF CACHE BOOL "")
|
||||
@@ -3119,7 +3109,7 @@ ENDIF()
|
||||
TARGET_LINK_LIBRARIES(XNNPACK PUBLIC pthreadpool)
|
||||
|
||||
# ---[ Configure FXdiv
|
||||
-IF(NOT TARGET fxdiv)
|
||||
+IF(FALSE)
|
||||
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
||||
SET(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
|
||||
SET(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
|
||||
@@ -3135,10 +3125,11 @@ IF(NOT TARGET fxdiv)
|
||||
SET_PROPERTY(TARGET fxdiv PROPERTY LINKER_LANGUAGE C)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
-TARGET_LINK_LIBRARIES(XNNPACK PRIVATE fxdiv)
|
||||
+find_path(FXDIV_INCLUDE_DIRS "fxdiv.h")
|
||||
+target_include_directories(XNNPACK PRIVATE ${FXDIV_INCLUDE_DIRS})
|
||||
|
||||
# ---[ Configure FP16
|
||||
-IF(NOT TARGET fp16)
|
||||
+IF(FALSE)
|
||||
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
||||
SET(FP16_BUILD_TESTS OFF CACHE BOOL "")
|
||||
SET(FP16_BUILD_BENCHMARKS OFF CACHE BOOL "")
|
||||
@@ -3154,12 +3145,17 @@ IF(NOT TARGET fp16)
|
||||
SET_PROPERTY(TARGET fp16 PROPERTY LINKER_LANGUAGE C)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
-TARGET_LINK_LIBRARIES(XNNPACK PRIVATE fp16)
|
||||
+find_path(FP16_INCLUDE_DIRS "fp16.h")
|
||||
+target_include_directories(XNNPACK PRIVATE ${FP16_INCLUDE_DIRS})
|
||||
|
||||
INSTALL(TARGETS XNNPACK
|
||||
+ EXPORT xnnpack-config
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
+install(EXPORT xnnpack-config NAMESPACE unofficial::
|
||||
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xnnpack)
|
||||
|
||||
# ---[ XNNPACK unit tests
|
||||
IF(XNNPACK_BUILD_TESTS)
|
21
ports/xnnpack/vcpkg.json
Normal file
21
ports/xnnpack/vcpkg.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "xnnpack",
|
||||
"version-date": "2021-05-17",
|
||||
"description": "High-efficiency floating-point neural network inference operators for mobile, server, and Web",
|
||||
"homepage": "https://github.com/google/XNNPACK",
|
||||
"supports": "!arm & !uwp",
|
||||
"dependencies": [
|
||||
"cpuinfo",
|
||||
"fp16",
|
||||
"fxdiv",
|
||||
"pthreadpool",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
@ -6552,6 +6552,10 @@
|
||||
"baseline": "0.5.2-1",
|
||||
"port-version": 0
|
||||
},
|
||||
"xnnpack": {
|
||||
"baseline": "2021-05-17",
|
||||
"port-version": 0
|
||||
},
|
||||
"xorstr": {
|
||||
"baseline": "2020-11-29",
|
||||
"port-version": 0
|
||||
|
9
versions/x-/xnnpack.json
Normal file
9
versions/x-/xnnpack.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "a35b56ac05249424cfcc4ad4727e34d7e1216f25",
|
||||
"version-date": "2021-05-17",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user