From 4ef97c2c33275d7b763e3f5b3308f4bead0a0b08 Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Thu, 6 May 2021 05:37:53 +0900 Subject: [PATCH] [cpuinfo,fbgemm,nnpack] update to latest source version and rename targets (#17063) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [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 Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> --- ports/cpuinfo/CONTROL | 7 --- ports/cpuinfo/fix-install.patch | 81 +++++++++++++++++++++++++++++++ ports/cpuinfo/portfile.cmake | 28 ++++------- ports/cpuinfo/vcpkg.json | 11 +++++ ports/fbgemm/fix-cmakelists.patch | 10 ++-- ports/fbgemm/vcpkg.json | 1 + ports/nnpack/fix-cmakelists.patch | 4 +- ports/nnpack/vcpkg.json | 1 + versions/baseline.json | 6 +-- versions/c-/cpuinfo.json | 5 ++ versions/f-/fbgemm.json | 5 ++ versions/n-/nnpack.json | 5 ++ 12 files changed, 129 insertions(+), 35 deletions(-) delete mode 100644 ports/cpuinfo/CONTROL create mode 100644 ports/cpuinfo/fix-install.patch create mode 100644 ports/cpuinfo/vcpkg.json diff --git a/ports/cpuinfo/CONTROL b/ports/cpuinfo/CONTROL deleted file mode 100644 index 0c349078ed0..00000000000 --- a/ports/cpuinfo/CONTROL +++ /dev/null @@ -1,7 +0,0 @@ -Source: cpuinfo -Version: 2019-07-28-1 -Description: CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS) -Homepage: https://github.com/pytorch/cpuinfo - -Feature: tools -Description: Build cpuinfo command-line tools diff --git a/ports/cpuinfo/fix-install.patch b/ports/cpuinfo/fix-install.patch new file mode 100644 index 00000000000..86080f52290 --- /dev/null +++ b/ports/cpuinfo/fix-install.patch @@ -0,0 +1,81 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e2d7d53..6d380e9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,6 +15,28 @@ OPTION(CPUINFO_BUILD_UNIT_TESTS "Build cpuinfo unit tests" ON) + OPTION(CPUINFO_BUILD_MOCK_TESTS "Build cpuinfo mock tests" ON) + OPTION(CPUINFO_BUILD_BENCHMARKS "Build cpuinfo micro-benchmarks" ON) + ++# Configuration ++set(config_install_dir "lib/cmake/unofficial-${PROJECT_NAME}") ++set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") ++set(project_config "${generated_dir}/unofficial-${PROJECT_NAME}Config.cmake") ++set(targets_export_name "unofficial-${PROJECT_NAME}Targets") ++set(namespace "unofficial::${PROJECT_NAME}::") ++ ++# Include module with fuction 'write_basic_package_version_file' ++include(CMakePackageConfigHelpers) ++configure_package_config_file( ++ "cmake/Config.cmake.in" ++ "${project_config}" ++ INSTALL_DESTINATION "${config_install_dir}" ++) ++install(FILES "${project_config}" ++ DESTINATION "${config_install_dir}" ++) ++install(EXPORT "${targets_export_name}" ++ NAMESPACE "${namespace}" ++ DESTINATION "${config_install_dir}" ++) ++ + # ---[ CMake options + INCLUDE(GNUInstallDirs) + +@@ -210,7 +232,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS)$") + TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE _WIN32_WINNT=0x0601) + ENDIF() + SET_TARGET_PROPERTIES(cpuinfo PROPERTIES PUBLIC_HEADER include/cpuinfo.h) +-TARGET_INCLUDE_DIRECTORIES(cpuinfo BEFORE PUBLIC include) ++TARGET_INCLUDE_DIRECTORIES(cpuinfo BEFORE PUBLIC $ $) + TARGET_INCLUDE_DIRECTORIES(cpuinfo BEFORE PRIVATE src) + TARGET_INCLUDE_DIRECTORIES(cpuinfo_internals BEFORE PUBLIC include src) + IF(CPUINFO_LOG_LEVEL STREQUAL "default") +@@ -261,6 +283,7 @@ TARGET_LINK_LIBRARIES(cpuinfo PRIVATE clog) + TARGET_LINK_LIBRARIES(cpuinfo_internals PRIVATE clog) + + INSTALL(TARGETS cpuinfo ++ EXPORT "${targets_export_name}" + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in +new file mode 100644 +index 0000000..9b4c9ee +--- /dev/null ++++ b/cmake/Config.cmake.in +@@ -0,0 +1,4 @@ ++@PACKAGE_INIT@ ++ ++include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") ++check_required_components("@PROJECT_NAME@") +diff --git a/deps/clog/CMakeLists.txt b/deps/clog/CMakeLists.txt +index 083f519..43b5c78 100644 +--- a/deps/clog/CMakeLists.txt ++++ b/deps/clog/CMakeLists.txt +@@ -57,7 +57,7 @@ SET_TARGET_PROPERTIES(clog PROPERTIES + C_EXTENSIONS NO) + CLOG_TARGET_RUNTIME_LIBRARY(clog) + SET_TARGET_PROPERTIES(clog PROPERTIES PUBLIC_HEADER include/clog.h) +-TARGET_INCLUDE_DIRECTORIES(clog BEFORE PUBLIC include) ++TARGET_INCLUDE_DIRECTORIES(clog PUBLIC $ $) + IF(CLOG_LOG_TO_STDIO) + TARGET_COMPILE_DEFINITIONS(clog PRIVATE CLOG_LOG_TO_STDIO=1) + ELSE() +@@ -68,6 +68,7 @@ IF(ANDROID AND NOT CLOG_LOG_TO_STDIO) + ENDIF() + + INSTALL(TARGETS clog ++ EXPORT ${targets_export_name} + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/ports/cpuinfo/portfile.cmake b/ports/cpuinfo/portfile.cmake index e41508f14bd..c670c0459b0 100644 --- a/ports/cpuinfo/portfile.cmake +++ b/ports/cpuinfo/portfile.cmake @@ -1,26 +1,19 @@ # On Windows, we can get a cpuinfo.dll, but it exports no symbols. vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_download_distfile( - pull_22_patch_file - URLS "https://github.com/pytorch/cpuinfo/compare/d5e37adf1406cf899d7d9ec1d317c47506ccb970...868bd113ed496a01cd030ab4d5b8853561f919a3.diff" - FILENAME "cpuinfo-pull-22-868bd11.patch" - SHA512 6971707e71613ca07fe0d18cb9c36cd5161177fc9ad3eb9e66f17a694559f3a95ccdad8f50e9342507a7978bd454f66e47c8a94db9077267ca302535b7cc3b59 -) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO pytorch/cpuinfo - REF d5e37adf1406cf899d7d9ec1d317c47506ccb970 - SHA512 ecd2115340fa82a67db7889ce286c3070d5ab9c30b02372b08aac893e90ccebc65c6b3e66aa02a9ae9c57892d2d8c3b77cb836e5fc3b88df2c75d33e574d90d2 + REF 5916273f79a21551890fd3d56fc5375a78d1598d + SHA512 50e537b61d991e8579577fb1ecf8d9ceb2171dbad96dfe159a062eadfdc0b2372b94988fc6f223c20e327453c7f55042ee06779f5b5fe0922f4470f746c9686b HEAD_REF master PATCHES - ${pull_22_patch_file} + fix-install.patch ) -vcpkg_check_features( - OUT_FEATURE_OPTIONS FEATURE_OPTIONS - tools CPUINFO_BUILD_TOOLS +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools CPUINFO_BUILD_TOOLS ) vcpkg_configure_cmake( @@ -28,23 +21,22 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS_DEBUG -DCPUINFO_BUILD_TOOLS=OFF + -DCPUINFO_LOG_LEVEL=debug OPTIONS_RELEASE ${FEATURE_OPTIONS} + -DCPUINFO_LOG_LEVEL=default OPTIONS -DCPUINFO_BUILD_UNIT_TESTS=OFF -DCPUINFO_BUILD_MOCK_TESTS=OFF -DCPUINFO_BUILD_BENCHMARKS=OFF ) - vcpkg_install_cmake() - vcpkg_copy_pdbs() - -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -if(tools IN_LIST FEATURES) +if("tools" IN_LIST FEATURES) vcpkg_copy_tools( TOOL_NAMES cache-info cpuid-dump cpu-info isa-info AUTO_CLEAN diff --git a/ports/cpuinfo/vcpkg.json b/ports/cpuinfo/vcpkg.json new file mode 100644 index 00000000000..a67a77bae07 --- /dev/null +++ b/ports/cpuinfo/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "cpuinfo", + "version-date": "2021-04-04", + "description": "CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)", + "homepage": "https://github.com/pytorch/cpuinfo", + "features": { + "tools": { + "description": "Build cpuinfo command-line tools" + } + } +} diff --git a/ports/fbgemm/fix-cmakelists.patch b/ports/fbgemm/fix-cmakelists.patch index 3f0b9015c71..1d26e80a962 100644 --- a/ports/fbgemm/fix-cmakelists.patch +++ b/ports/fbgemm/fix-cmakelists.patch @@ -56,7 +56,7 @@ index 6f19a16..3c758d2 100644 endif() -if(NOT TARGET cpuinfo) -+find_package(cpuinfo CONFIG REQUIRED) # target 'cpuinfo::cpuinfo' ++find_package(unofficial-cpuinfo CONFIG REQUIRED) # target 'unofficial::cpuinfo::cpuinfo' +if(FALSE) #Download cpuinfo from github if CPUINFO_SOURCE_DIR is not specified. if(NOT DEFINED CPUINFO_SOURCE_DIR) @@ -68,7 +68,7 @@ index 6f19a16..3c758d2 100644 - PRIVATE "${ASMJIT_SRC_DIR}/src" - PRIVATE "${CPUINFO_SOURCE_DIR}/include") +) -+target_link_libraries(fbgemm_generic PUBLIC asmjit::asmjit cpuinfo::cpuinfo) ++target_link_libraries(fbgemm_generic PUBLIC asmjit::asmjit unofficial::cpuinfo::cpuinfo) target_include_directories(fbgemm_avx2 BEFORE PUBLIC $ @@ -76,7 +76,7 @@ index 6f19a16..3c758d2 100644 - PRIVATE "${ASMJIT_SRC_DIR}/src" - PRIVATE "${CPUINFO_SOURCE_DIR}/include") +) -+target_link_libraries(fbgemm_avx2 PUBLIC asmjit::asmjit cpuinfo::cpuinfo) ++target_link_libraries(fbgemm_avx2 PUBLIC asmjit::asmjit unofficial::cpuinfo::cpuinfo) target_include_directories(fbgemm_avx512 BEFORE PUBLIC $ @@ -95,7 +95,7 @@ index 6f19a16..3c758d2 100644 - $ - $) +) -+target_link_libraries(fbgemm_avx512 PUBLIC asmjit::asmjit cpuinfo::cpuinfo) ++target_link_libraries(fbgemm_avx512 PUBLIC asmjit::asmjit unofficial::cpuinfo::cpuinfo) + +add_library(fbgemm + $ @@ -131,7 +131,7 @@ index 6f19a16..3c758d2 100644 -target_link_libraries(fbgemm $ - $) -add_dependencies(fbgemm asmjit cpuinfo) -+target_link_libraries(fbgemm PUBLIC asmjit::asmjit cpuinfo::cpuinfo) ++target_link_libraries(fbgemm PUBLIC asmjit::asmjit unofficial::cpuinfo::cpuinfo) install(TARGETS fbgemm EXPORT fbgemmLibraryConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/ports/fbgemm/vcpkg.json b/ports/fbgemm/vcpkg.json index 85ffc1af0fb..3d1de8260ae 100644 --- a/ports/fbgemm/vcpkg.json +++ b/ports/fbgemm/vcpkg.json @@ -1,6 +1,7 @@ { "name": "fbgemm", "version-date": "2021-03-18", + "port-version": 1, "description": "FB (Facebook) + GEMM (General Matrix-Matrix Multiplication)", "homepage": "https://code.fb.com/ml-applications/fbgemm/", "supports": "!(x86 | uwp)", diff --git a/ports/nnpack/fix-cmakelists.patch b/ports/nnpack/fix-cmakelists.patch index bd80f1000db..046443d8027 100644 --- a/ports/nnpack/fix-cmakelists.patch +++ b/ports/nnpack/fix-cmakelists.patch @@ -42,8 +42,8 @@ index 5ecd2df..8565044 100644 "${CONFU_DEPENDENCIES_BINARY_DIR}/cpuinfo") ENDIF() -TARGET_LINK_LIBRARIES(nnpack PRIVATE cpuinfo) -+find_package(cpuinfo CONFIG REQUIRED) -+target_link_libraries(nnpack PUBLIC cpuinfo::cpuinfo) ++find_package(unofficial-cpuinfo CONFIG REQUIRED) ++target_link_libraries(nnpack PUBLIC unofficial::cpuinfo::cpuinfo) # ---[ Configure pthreadpool -IF(NOT TARGET pthreadpool) diff --git a/ports/nnpack/vcpkg.json b/ports/nnpack/vcpkg.json index 774e5ee778e..a0e0a4ea211 100644 --- a/ports/nnpack/vcpkg.json +++ b/ports/nnpack/vcpkg.json @@ -1,6 +1,7 @@ { "name": "nnpack", "version-date": "2021-02-21", + "port-version": 1, "description": "Acceleration package for neural networks on multi-core CPUs", "homepage": "https://github.com/Maratyszcza/NNPACK", "supports": "linux & osx", diff --git a/versions/baseline.json b/versions/baseline.json index 0308dde2c83..729cc1c7efa 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1457,7 +1457,7 @@ "port-version": 0 }, "cpuinfo": { - "baseline": "2019-07-28-1", + "baseline": "2021-04-04", "port-version": 0 }, "cr": { @@ -1934,7 +1934,7 @@ }, "fbgemm": { "baseline": "2021-03-18", - "port-version": 0 + "port-version": 1 }, "fbthrift": { "baseline": "2020.10.19.00", @@ -4286,7 +4286,7 @@ }, "nnpack": { "baseline": "2021-02-21", - "port-version": 0 + "port-version": 1 }, "nonius": { "baseline": "2019-04-20-1", diff --git a/versions/c-/cpuinfo.json b/versions/c-/cpuinfo.json index 3935c0e78a9..7c3abd38ecb 100644 --- a/versions/c-/cpuinfo.json +++ b/versions/c-/cpuinfo.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "28dbefcc9131ff8ce6fa939f7fcdb5cf0d4ee7fd", + "version-date": "2021-04-04", + "port-version": 0 + }, { "git-tree": "4e4c0561ce8cb5f57c0a63ce070598dc1544acde", "version-string": "2019-07-28-1", diff --git a/versions/f-/fbgemm.json b/versions/f-/fbgemm.json index e3675f3cd6f..ae67aa19008 100644 --- a/versions/f-/fbgemm.json +++ b/versions/f-/fbgemm.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6f3e815d3e806243cddff7b0e262d130ef702e98", + "version-date": "2021-03-18", + "port-version": 1 + }, { "git-tree": "7a439c159752233f767113ecf1a484065e223458", "version-date": "2021-03-18", diff --git a/versions/n-/nnpack.json b/versions/n-/nnpack.json index 69bbc2196a1..00fe3761110 100644 --- a/versions/n-/nnpack.json +++ b/versions/n-/nnpack.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "42cc5d6dad2376e9322d715341bb0c8e2d1297b8", + "version-date": "2021-02-21", + "port-version": 1 + }, { "git-tree": "bea4835350da5cce1c030ee7d9590fdae88860ae", "version-date": "2021-02-21",