Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cpuinfo,fbgemm,xnnpack] update cpuinfo to latest #23944

Merged
merged 14 commits into from
Apr 12, 2022
81 changes: 0 additions & 81 deletions ports/cpuinfo/fix-install.patch

This file was deleted.

47 changes: 29 additions & 18 deletions ports/cpuinfo/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
# On Windows, we can get a cpuinfo.dll, but it exports no symbols.
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO pytorch/cpuinfo
REF 5916273f79a21551890fd3d56fc5375a78d1598d
SHA512 50e537b61d991e8579577fb1ecf8d9ceb2171dbad96dfe159a062eadfdc0b2372b94988fc6f223c20e327453c7f55042ee06779f5b5fe0922f4470f746c9686b
REF b40bae27785787b6dd70788986fd96434cf90ae2
SHA512 dbbe4f3e1d5ae74ffc8ba2cba0ab745a23f4993788f4947825ef5125dd1cbed3e13e0c98e020e6fcfa9879f54f06d7cba4de73ec29f77649b6a27b4ab82c8f1c
HEAD_REF master
PATCHES
fix-install.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools CPUINFO_BUILD_TOOLS
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG
-DCPUINFO_BUILD_TOOLS=OFF
-DCPUINFO_LOG_LEVEL=debug
OPTIONS_RELEASE
${FEATURE_OPTIONS}
-DCPUINFO_LOG_LEVEL=default
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
list(APPEND LINK_OPTIONS -DCPUINFO_LIBRARY_TYPE=shared)
else()
list(APPEND LINK_OPTIONS -DCPUINFO_LIBRARY_TYPE=static)
endif()

if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
list(APPEND LINK_OPTIONS -DCPUINFO_RUNTIME_TYPE=shared)
else()
list(APPEND LINK_OPTIONS -DCPUINFO_RUNTIME_TYPE=static)
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
${LINK_OPTIONS}
-DCPUINFO_BUILD_UNIT_TESTS=OFF
-DCPUINFO_BUILD_MOCK_TESTS=OFF
-DCPUINFO_BUILD_BENCHMARKS=OFF
OPTIONS_DEBUG
-DCPUINFO_LOG_LEVEL=debug
OPTIONS_RELEASE
-DCPUINFO_LOG_LEVEL=default
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT})
vcpkg_fixup_pkgconfig() # pkg_check_modules(libcpuinfo)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

Expand All @@ -43,5 +55,4 @@ if("tools" IN_LIST FEATURES)
)
endif()

# Handle copyright
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
13 changes: 12 additions & 1 deletion ports/cpuinfo/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
{
"name": "cpuinfo",
"version-date": "2021-04-04",
"version-date": "2022-04-02",
"description": "CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)",
"homepage": "https://github.com/pytorch/cpuinfo",
"supports": "!(arm & windows) | (arm & uwp)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cpuinfo:arm64-windows also fails to build in master branch.

Copy link
Contributor

@strega-nil-ms strega-nil-ms Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, I can build it on my machine as both arm64-windows and arm-windows, so I think this supports is wrong.

"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"tools": {
"description": "Build cpuinfo command-line tools"
Expand Down
10 changes: 5 additions & 5 deletions ports/fbgemm/fix-cmakelists.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ index 6f19a16..3c758d2 100644
endif()

-if(NOT TARGET cpuinfo)
+find_package(unofficial-cpuinfo CONFIG REQUIRED) # target 'unofficial::cpuinfo::cpuinfo'
+find_package(cpuinfo CONFIG REQUIRED) # target 'cpuinfo::cpuinfo'
+if(FALSE)
#Download cpuinfo from github if CPUINFO_SOURCE_DIR is not specified.
if(NOT DEFINED CPUINFO_SOURCE_DIR)
Expand All @@ -68,15 +68,15 @@ index 6f19a16..3c758d2 100644
- PRIVATE "${ASMJIT_SRC_DIR}/src"
- PRIVATE "${CPUINFO_SOURCE_DIR}/include")
+)
+target_link_libraries(fbgemm_generic PUBLIC asmjit::asmjit unofficial::cpuinfo::cpuinfo)
+target_link_libraries(fbgemm_generic PUBLIC asmjit::asmjit cpuinfo::cpuinfo)

target_include_directories(fbgemm_avx2 BEFORE
PUBLIC $<BUILD_INTERFACE:${FBGEMM_SOURCE_DIR}>
PUBLIC $<BUILD_INTERFACE:${FBGEMM_SOURCE_DIR}/include>
- PRIVATE "${ASMJIT_SRC_DIR}/src"
- PRIVATE "${CPUINFO_SOURCE_DIR}/include")
+)
+target_link_libraries(fbgemm_avx2 PUBLIC asmjit::asmjit unofficial::cpuinfo::cpuinfo)
+target_link_libraries(fbgemm_avx2 PUBLIC asmjit::asmjit cpuinfo::cpuinfo)

target_include_directories(fbgemm_avx512 BEFORE
PUBLIC $<BUILD_INTERFACE:${FBGEMM_SOURCE_DIR}>
Expand All @@ -95,7 +95,7 @@ index 6f19a16..3c758d2 100644
- $<TARGET_OBJECTS:fbgemm_avx2>
- $<TARGET_OBJECTS:fbgemm_avx512>)
+)
+target_link_libraries(fbgemm_avx512 PUBLIC asmjit::asmjit unofficial::cpuinfo::cpuinfo)
+target_link_libraries(fbgemm_avx512 PUBLIC asmjit::asmjit cpuinfo::cpuinfo)
+
+add_library(fbgemm
+ $<TARGET_OBJECTS:fbgemm_generic>
Expand Down Expand Up @@ -131,7 +131,7 @@ index 6f19a16..3c758d2 100644
-target_link_libraries(fbgemm $<BUILD_INTERFACE:asmjit>
- $<BUILD_INTERFACE:cpuinfo>)
-add_dependencies(fbgemm asmjit cpuinfo)
+target_link_libraries(fbgemm PUBLIC asmjit::asmjit unofficial::cpuinfo::cpuinfo)
+target_link_libraries(fbgemm PUBLIC asmjit::asmjit cpuinfo::cpuinfo)

install(TARGETS fbgemm EXPORT fbgemmLibraryConfig
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
2 changes: 1 addition & 1 deletion ports/fbgemm/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fbgemm",
"version-date": "2021-03-18",
"port-version": 3,
"port-version": 4,
"description": "FB (Facebook) + GEMM (General Matrix-Matrix Multiplication)",
"homepage": "https://code.fb.com/ml-applications/fbgemm/",
"supports": "!(x86 | uwp)",
Expand Down
4 changes: 2 additions & 2 deletions ports/nnpack/fix-cmakelists.patch
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ index 5ecd2df..8565044 100644
"${CONFU_DEPENDENCIES_BINARY_DIR}/cpuinfo")
ENDIF()
-TARGET_LINK_LIBRARIES(nnpack PRIVATE cpuinfo)
+find_package(unofficial-cpuinfo CONFIG REQUIRED)
+target_link_libraries(nnpack PUBLIC unofficial::cpuinfo::cpuinfo)
+find_package(cpuinfo CONFIG REQUIRED)
+target_link_libraries(nnpack PUBLIC cpuinfo::cpuinfo)

# ---[ Configure pthreadpool
-IF(NOT TARGET pthreadpool)
Expand Down
4 changes: 2 additions & 2 deletions ports/nnpack/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "nnpack",
"version-date": "2021-02-21",
"port-version": 2,
"port-version": 3,
"description": "Acceleration package for neural networks on multi-core CPUs",
"homepage": "https://github.com/Maratyszcza/NNPACK",
"supports": "linux & osx",
"supports": "linux | osx",
"dependencies": [
"cpuinfo",
"fp16",
Expand Down
4 changes: 2 additions & 2 deletions ports/qnnpack/use-packages.patch
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ index a5ddc49..05e1279 100644
ENDIF()
-TARGET_LINK_LIBRARIES(qnnpack PRIVATE cpuinfo)
+
+find_package(unofficial-cpuinfo CONFIG REQUIRED)
+target_link_libraries(qnnpack PUBLIC unofficial::cpuinfo::clog unofficial::cpuinfo::cpuinfo)
+find_package(cpuinfo CONFIG REQUIRED)
+target_link_libraries(qnnpack PUBLIC cpuinfo::clog cpuinfo::cpuinfo)

# ---[ Configure pthreadpool
-IF(NOT TARGET pthreadpool)
Expand Down
2 changes: 1 addition & 1 deletion ports/qnnpack/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "qnnpack",
"version-date": "2021-02-26",
"port-version": 1,
"port-version": 2,
"description": "Quantized Neural Network PACKage - mobile-optimized implementation of quantized neural network operators",
"homepage": "https://github.com/pytorch/QNNPACK",
"supports": "linux | osx",
Expand Down
4 changes: 2 additions & 2 deletions ports/xnnpack/use-packages.patch
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ index b69ce50c..1e8938b7 100755
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)
+find_package(cpuinfo CONFIG REQUIRED)
+target_link_libraries(XNNPACK PUBLIC cpuinfo::clog cpuinfo::cpuinfo)

# ---[ Configure pthreadpool
-IF(NOT TARGET pthreadpool)
Expand Down
2 changes: 1 addition & 1 deletion ports/xnnpack/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "xnnpack",
"version-date": "2021-05-17",
"port-version": 1,
"port-version": 2,
"description": "High-efficiency floating-point neural network inference operators for mobile, server, and Web",
"homepage": "https://github.com/google/XNNPACK",
"supports": "!(arm & windows) & !uwp",
Expand Down
10 changes: 5 additions & 5 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,7 @@
"port-version": 3
},
"cpuinfo": {
"baseline": "2021-04-04",
"baseline": "2022-04-02",
"port-version": 0
},
"cr": {
Expand Down Expand Up @@ -2158,7 +2158,7 @@
},
"fbgemm": {
"baseline": "2021-03-18",
"port-version": 3
"port-version": 4
},
"fbthrift": {
"baseline": "2022.03.21.00",
Expand Down Expand Up @@ -4838,7 +4838,7 @@
},
"nnpack": {
"baseline": "2021-02-21",
"port-version": 2
"port-version": 3
},
"nonius": {
"baseline": "2019-04-20",
Expand Down Expand Up @@ -5618,7 +5618,7 @@
},
"qnnpack": {
"baseline": "2021-02-26",
"port-version": 1
"port-version": 2
},
"qpid-proton": {
"baseline": "0.32.0",
Expand Down Expand Up @@ -7522,7 +7522,7 @@
},
"xnnpack": {
"baseline": "2021-05-17",
"port-version": 1
"port-version": 2
},
"xorstr": {
"baseline": "2021-10-23",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/cpuinfo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "306a7105587720326b1eecff185f5683d05ca746",
"version-date": "2022-04-02",
"port-version": 0
},
{
"git-tree": "28dbefcc9131ff8ce6fa939f7fcdb5cf0d4ee7fd",
"version-date": "2021-04-04",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/fbgemm.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "80485c113a4cf859fda0e566822527c399c279fd",
"version-date": "2021-03-18",
"port-version": 4
},
{
"git-tree": "89489c3afc56789dd2a8344dc89455723ec0eec3",
"version-date": "2021-03-18",
Expand Down
5 changes: 5 additions & 0 deletions versions/n-/nnpack.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4ec5e175a2608e3e0ff021309dded3c0a7812bb1",
"version-date": "2021-02-21",
"port-version": 3
},
{
"git-tree": "2479c1088fd75df5e9f06e85086c748aefae9e11",
"version-date": "2021-02-21",
Expand Down
5 changes: 5 additions & 0 deletions versions/q-/qnnpack.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "dbc05e72e67af54d2ee51e63ee3bf3da02658edb",
"version-date": "2021-02-26",
"port-version": 2
},
{
"git-tree": "8dbc0dd7bdcf36b48124351fbc2ecc44d0b2e961",
"version-date": "2021-02-26",
Expand Down
5 changes: 5 additions & 0 deletions versions/x-/xnnpack.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "24b8fdd62a2ee491dd579f624c7f60f95a9cf576",
"version-date": "2021-05-17",
"port-version": 2
},
{
"git-tree": "d998602ed266e9cf140fb6740fea8625276a48f5",
"version-date": "2021-05-17",
Expand Down