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

[torch-th] fix arm64-osx build #27412

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ports/torch-th/fix-arm64-osx-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/TH/cmake/FindARM.cmake b/lib/TH/cmake/FindARM.cmake
index 2dcb2a2..9d68601 100644
--- a/lib/TH/cmake/FindARM.cmake
+++ b/lib/TH/cmake/FindARM.cmake
@@ -45,7 +45,7 @@ ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
CPUINFO)

#neon instruction can be found on the majority part of modern ARM processor
- STRING(REGEX REPLACE "^.*(neon).*$" "\\1" NEON_THERE ${CPUINFO})
+ STRING(REGEX REPLACE "^.*(neon).*$" "\\1" NEON_THERE "${CPUINFO}")
STRING(COMPARE EQUAL "neon" "${NEON_THERE}" NEON_TRUE)
IF (NEON_TRUE)
set(NEON_FOUND true CACHE BOOL "NEON available on host")
16 changes: 8 additions & 8 deletions ports/torch-th/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
debug.patch
fix-arm64-osx-config.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}/lib/TH
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/lib/TH"
OPTIONS
-DWITH_OPENMP=OFF
)

vcpkg_install_cmake()
vcpkg_cmake_install()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/cmake)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/cmake")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

file(INSTALL ${SOURCE_PATH}/COPYRIGHT.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/torch-th RENAME copyright)
file(INSTALL "${SOURCE_PATH}/COPYRIGHT.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/torch-th" RENAME copyright)
13 changes: 10 additions & 3 deletions ports/torch-th/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"name": "torch-th",
"version-string": "2019-04-19",
"port-version": 3,
"version-date": "2019-04-19",
"port-version": 4,
"description": "Torch's TH library",
"homepage": "https://github.com/torch/torch7"
"homepage": "https://github.com/torch/torch7",
"license": "BSD-3-Clause",
Copy link
Member

Choose a reason for hiding this comment

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

"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7490,7 +7490,7 @@
},
"torch-th": {
"baseline": "2019-04-19",
"port-version": 3
"port-version": 4
},
"tracy": {
"baseline": "0.8.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/t-/torch-th.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e870a035791ae5e1dbb2c86fe94644812852ca2d",
"version-date": "2019-04-19",
"port-version": 4
},
{
"git-tree": "dd64f0dab429a6baf6dbb12119909ebd9caaa43a",
"version-string": "2019-04-19",
Expand Down