-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from luncliff/port/tensorflow-lite
Support ports for TensorFlow Lite
- Loading branch information
Showing
27 changed files
with
7,472 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Author: github.com/luncliff (luncliff@gmail.com) | ||
# | ||
# References | ||
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#job-reuse | ||
# | ||
|
||
parameters: | ||
- name: job_name | ||
type: string | ||
- name: port_name | ||
type: string | ||
|
||
jobs: | ||
- job: "arm_windows_${{ parameters.job_name }}" | ||
pool: | ||
vmImage: windows-2019 | ||
# vmImage: windows-2022 # (2021-10-04) VS 2022 Preview is not ready for arm64-windows | ||
timeoutInMinutes: 300 | ||
steps: | ||
- task: UsePythonVersion@0 | ||
displayName: "Setup: Python 3.9" | ||
inputs: | ||
versionSpec: "3.9" | ||
addToPath: true | ||
architecture: "x64" | ||
- powershell: env | ||
- template: run-vcpkg-with-overlay.yml | ||
parameters: | ||
port_name: "${{ parameters.port_name }}" | ||
target_triplet: "arm64-windows" | ||
- template: steps-publish-logs.yml | ||
parameters: | ||
port_name: "${{ parameters.port_name }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# On Windows, we can get a cpuinfo.dll, but it exports no symbols. | ||
if(VCPKG_TARGET_IS_WINDOWS) | ||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) | ||
endif() | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO luncliff/cpuinfo | ||
REF b23b0d3bbc441ac1172458827ef309e9f6c47fd4 | ||
SHA512 ea31b46a0375f67de00241aeec48678a476e8979f6ad0943bebee3c46c848f62ae8d282c9ac8625014f77af5a6dbbb9adf9e98d78111dad0cdc95b40f36520ce | ||
HEAD_REF master | ||
) | ||
|
||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
tools CPUINFO_BUILD_TOOLS | ||
) | ||
|
||
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_cmake_install() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH "share/${PORT}") | ||
vcpkg_fixup_pkgconfig() # pkg_check_modules(libcpuinfo) | ||
|
||
if("tools" IN_LIST FEATURES) | ||
vcpkg_copy_tools( | ||
TOOL_NAMES cache-info cpuid-dump cpu-info isa-info | ||
AUTO_CLEAN | ||
) | ||
endif() | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
||
file(INSTALL "${SOURCE_PATH}/LICENSE" | ||
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "cpuinfo", | ||
"version-date": "2021-10-10", | ||
"description": "CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)", | ||
"homepage": "https://github.com/pytorch/cpuinfo", | ||
"supports": "!(arm & windows)", | ||
"dependencies":[ | ||
{ | ||
"name":"vcpkg-cmake", | ||
"host":true | ||
}, | ||
{ | ||
"name":"vcpkg-cmake-config", | ||
"host":true | ||
} | ||
], | ||
"features": { | ||
"tools": { | ||
"description": "Build cpuinfo command-line tools" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
vcpkg_buildpath_length_warning(37) | ||
|
||
vcpkg_from_gitlab( | ||
GITLAB_URL https://gitlab.com | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO libeigen/eigen | ||
REF 3.4.0 | ||
SHA512 ba75ecb760e32acf4ceaf27115468e65d4f77c44f8d519b5a13e7940af2c03a304ad433368cb6d55431f307c5c39e2666ab41d34442db3cf441638e51f5c3b6a | ||
) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
OPTIONS | ||
-DBUILD_TESTING=OFF | ||
-DEIGEN_BUILD_PKGCONFIG=ON | ||
OPTIONS_RELEASE | ||
-DCMAKEPACKAGE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/share/eigen3 | ||
-DPKGCONFIG_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/lib/pkgconfig | ||
OPTIONS_DEBUG | ||
-DCMAKEPACKAGE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/share/eigen3 | ||
-DPKGCONFIG_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig | ||
) | ||
vcpkg_cmake_install() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH share/${PORT}) | ||
vcpkg_fixup_pkgconfig() | ||
|
||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) | ||
|
||
file(INSTALL ${SOURCE_PATH}/COPYING.README DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "eigen3", | ||
"version-string": "3.4.0", | ||
"description": "C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.", | ||
"homepage": "http://eigen.tuxfamily.org", | ||
"dependencies":[ | ||
{ | ||
"name":"vcpkg-cmake", | ||
"host":true | ||
}, | ||
{ | ||
"name":"vcpkg-cmake-config", | ||
"host":true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function(set_library_target NAMESPACE LIB_NAME DEBUG_LIB_FILE_NAME RELEASE_LIB_FILE_NAME INCLUDE_DIR) | ||
add_library(${NAMESPACE}::${LIB_NAME} STATIC IMPORTED) | ||
set_target_properties(${NAMESPACE}::${LIB_NAME} PROPERTIES | ||
IMPORTED_CONFIGURATIONS "RELEASE;DEBUG" | ||
IMPORTED_LOCATION_RELEASE "${RELEASE_LIB_FILE_NAME}" | ||
IMPORTED_LOCATION_DEBUG "${DEBUG_LIB_FILE_NAME}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${INCLUDE_DIR}" | ||
) | ||
set(${NAMESPACE}_${LIB_NAME}_FOUND 1) | ||
endfunction() | ||
|
||
get_filename_component(ROOT "${CMAKE_CURRENT_LIST_FILE}" PATH) | ||
get_filename_component(ROOT "${ROOT}" PATH) | ||
get_filename_component(ROOT "${ROOT}" PATH) | ||
|
||
set_library_target("GOOGLE" "farmhash" | ||
"${ROOT}/debug/lib/${CMAKE_STATIC_LIBRARY_PREFIX}farmhash${CMAKE_STATIC_LIBRARY_SUFFIX}" | ||
"${ROOT}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}farmhash${CMAKE_STATIC_LIBRARY_SUFFIX}" | ||
"${ROOT}/include/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#Requires a compiler which understands '__builtin_unreachable': | ||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) | ||
|
||
vcpkg_download_distfile(WIN_PR_PATCH | ||
URLS "https://github.com/google/farmhash/pull/40.diff" | ||
FILENAME farmhash-pr-40.patch | ||
SHA512 265f5c15c17da2b88c82e6016a181abe73d2d94492cdb0cba892acf67a9d40815d54fa81e07351254fe2a39aea143b125924db0e7df14aac84a7469a78612cbd | ||
) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO google/farmhash | ||
REF 0d859a811870d10f53a594927d0d0b97573ad06d | ||
SHA512 7bc14931e488464c1cedbc17551fb90a8cec494d0e0860db9df8efff09000fd8d91e01060dd5c5149b1104ac4ac8bf7eb57e5b156b05ef42636938edad1518f1 | ||
HEAD_REF master | ||
PATCHES ${WIN_PR_PATCH} | ||
) | ||
|
||
if((VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) AND NOT ENV{CXX_FLAGS}) # This should be a compiler check | ||
set(ENV{CXXFLAGS} "-maes -msse4.2") | ||
endif() | ||
file(REMOVE_RECURSE "${SOURCE_PATH}/configure") | ||
vcpkg_configure_make( | ||
AUTOCONFIG | ||
SOURCE_PATH ${SOURCE_PATH} | ||
) | ||
vcpkg_install_make() | ||
vcpkg_copy_pdbs() | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" | ||
"${CURRENT_PACKAGES_DIR}/debug/share" | ||
"${CURRENT_PACKAGES_DIR}/share" # eliminate unused files | ||
) | ||
file(INSTALL "${SOURCE_PATH}/COPYING" | ||
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) | ||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/farmhashConfig.cmake" | ||
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The package farmhash is compatible with built-in CMake targets: | ||
|
||
FIND_PACKAGE(farmhash REQUIRED) | ||
TARGET_LINK_LIBRARIES(main PRIVATE GOOGLE::farmhash) for linkage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "farmhash", | ||
"version-string": "1.1", | ||
"port-version": 4, | ||
"description": "FarmHash, a family of hash functions.", | ||
"homepage": "https://github.com/google/farmhash", | ||
"supports": "!arm" | ||
} |
Oops, something went wrong.