Skip to content

Commit

Permalink
Use libtorch 2.2.2 for x86_64 macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
faressc committed Sep 23, 2024
1 parent 2696a3d commit 349e33a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion cmake/SetupLibTorch.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
set(LIBTORCH_VERSION 2.4.1)
if(APPLE)
if (CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
set(LIBTORCH_VERSION 2.2.2)
# torch stopped uploading the binaries for x86_64, so we use an older version
elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
set(LIBTORCH_VERSION 2.4.1)
else()
if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(LIBTORCH_VERSION 2.2.2)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
set(LIBTORCH_VERSION 2.4.1)
else()
message(FATAL_ERROR "CMAKE_OSX_ARCHITECTURES and CMAKE_HOST_SYSTEM_PROCESSOR not defined.")
endif()
endif()
else()
set(LIBTORCH_VERSION 2.4.1)
endif()

if (NOT WIN32)
set(TORCH_BUILD_TYPE "")
Expand Down

0 comments on commit 349e33a

Please sign in to comment.