From 8cbc1d7ab8fad003ca237c06c849596d30d7ee12 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Tue, 17 Dec 2024 20:59:52 +0100 Subject: [PATCH] [Libtorch] remove abs compiler path (#42729) --- ports/libtorch/no-abs-path.patch | 25 +++++++++++++++++++++++++ ports/libtorch/portfile.cmake | 1 + ports/libtorch/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/l-/libtorch.json | 5 +++++ 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 ports/libtorch/no-abs-path.patch diff --git a/ports/libtorch/no-abs-path.patch b/ports/libtorch/no-abs-path.patch new file mode 100644 index 0000000000..7468556e8a --- /dev/null +++ b/ports/libtorch/no-abs-path.patch @@ -0,0 +1,25 @@ +diff --git a/caffe2/core/macros.h.in b/caffe2/core/macros.h.in +index 997752ede3..7209b9a63e 100644 +--- a/caffe2/core/macros.h.in ++++ b/caffe2/core/macros.h.in +@@ -35,7 +35,7 @@ + // Useful build settings that are recorded in the compiled binary + #define CAFFE2_BUILD_STRINGS { \ + {"TORCH_VERSION", "${TORCH_VERSION}"}, \ +- {"CXX_COMPILER", "${CMAKE_CXX_COMPILER}"}, \ ++ {"CXX_COMPILER", "${cxx_compiler}"}, \ + {"CXX_FLAGS", "${CMAKE_CXX_FLAGS}"}, \ + {"BUILD_TYPE", "${CMAKE_BUILD_TYPE}"}, \ + {"BLAS_INFO", "${BLAS_INFO}"}, \ +diff --git a/cmake/Codegen.cmake b/cmake/Codegen.cmake +index 6fa2ab6ea1..07c449c02b 100644 +--- a/cmake/Codegen.cmake ++++ b/cmake/Codegen.cmake +@@ -36,6 +36,7 @@ endfunction() + ################################################################################ + + # ---[ Write the macros file ++cmake_path(GET CMAKE_CXX_COMPILER FILENAME cxx_compiler) + configure_file( + ${CMAKE_CURRENT_LIST_DIR}/../caffe2/core/macros.h.in + ${CMAKE_BINARY_DIR}/caffe2/core/macros.h) diff --git a/ports/libtorch/portfile.cmake b/ports/libtorch/portfile.cmake index 785ce85c1a..4dc05e8dc4 100644 --- a/ports/libtorch/portfile.cmake +++ b/ports/libtorch/portfile.cmake @@ -38,6 +38,7 @@ vcpkg_from_github( force-cuda-include.patch fix-aten-cutlass.patch fix-build-error-with-fmt11.patch + no-abs-path.patch ) file(REMOVE_RECURSE "${SOURCE_PATH}/caffe2/core/macros.h") # We must use generated header files diff --git a/ports/libtorch/vcpkg.json b/ports/libtorch/vcpkg.json index c8c639f2ad..6a8b78ed8c 100644 --- a/ports/libtorch/vcpkg.json +++ b/ports/libtorch/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libtorch", "version": "2.1.2", - "port-version": 7, + "port-version": 8, "description": "Tensors and Dynamic neural networks in Python with strong GPU acceleration", "homepage": "https://pytorch.org/", "license": null, diff --git a/versions/baseline.json b/versions/baseline.json index 93c9384a51..1b4d6400b2 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5238,7 +5238,7 @@ }, "libtorch": { "baseline": "2.1.2", - "port-version": 7 + "port-version": 8 }, "libtorrent": { "baseline": "2.0.10", diff --git a/versions/l-/libtorch.json b/versions/l-/libtorch.json index a2385e25f3..33ceff6b66 100644 --- a/versions/l-/libtorch.json +++ b/versions/l-/libtorch.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d6c80d406232a0bfd3360a40132a69d9f70b972c", + "version": "2.1.2", + "port-version": 8 + }, { "git-tree": "e738e2da09a82affc4bf4090d8c672579364231b", "version": "2.1.2",