File pytorch-rocm-caffe2-cmakefile.patch of Package python-torch-oldstable
--- a/caffe2/CMakeLists.txt 2024-08-29 06:11:24.360227686 +0200
+++ b/caffe2/CMakeLists.txt 2024-08-29 23:08:34.959958736 +0200
@@ -939,10 +939,9 @@
endif()
if(USE_LLVM AND LLVM_FOUND)
- llvm_map_components_to_libnames(LLVM_LINK_LIBS
+ llvm_config(torch_cpu USE_SHARED
support core analysis executionengine instcombine
- scalaropts transformutils ${LLVM_TARGETS_TO_BUILD} orcjit)
- target_link_libraries(torch_cpu PRIVATE ${LLVM_LINK_LIBS})
+ scalaropts transformutils ${LLVM_TARGETS_TO_BUILD} orcjit)
if(APPLE)
set(LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/unexported_symbols.lds")
set_target_properties(torch_cpu PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT})
@@ -1710,6 +1709,7 @@
# Since PyTorch files contain HIP headers, these flags are required for the necessary definitions to be added.
target_compile_options(torch_hip PUBLIC ${HIP_CXX_FLAGS}) # experiment
+ set_target_properties(torch_hip PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF)
target_link_libraries(torch_hip PUBLIC c10_hip)
if(NOT INTERN_BUILD_MOBILE)