diff options
Diffstat (limited to 'sci-libs/caffe2/files')
16 files changed, 67 insertions, 606 deletions
diff --git a/sci-libs/caffe2/files/caffe2-1.12.0-glog-0.6.0.patch b/sci-libs/caffe2/files/caffe2-1.12.0-glog-0.6.0.patch deleted file mode 100644 index 6c06d2cca654..000000000000 --- a/sci-libs/caffe2/files/caffe2-1.12.0-glog-0.6.0.patch +++ /dev/null @@ -1,29 +0,0 @@ -https://github.com/pytorch/pytorch/issues/58054 - ---- a/c10/util/Logging.cpp -+++ b/c10/util/Logging.cpp -@@ -192,23 +192,13 @@ - google::GLOG_WARNING, - "The minimum log level that caffe2 will output."); - --// Google glog's api does not have an external function that allows one to check --// if glog is initialized or not. It does have an internal function - so we are --// declaring it here. This is a hack but has been used by a bunch of others too --// (e.g. Torch). --namespace google { --namespace glog_internal_namespace_ { --bool IsGoogleLoggingInitialized(); --} // namespace glog_internal_namespace_ --} // namespace google -- - namespace c10 { - namespace { - - void initGoogleLogging(char const* name) { - #if !defined(_MSC_VER) - // This trick can only be used on UNIX platforms -- if (!::google::glog_internal_namespace_::IsGoogleLoggingInitialized()) -+ if (!::google::IsGoogleLoggingInitialized()) - #endif - { - ::google::InitGoogleLogging(name); diff --git a/sci-libs/caffe2/files/caffe2-1.13.0-install-dirs.patch b/sci-libs/caffe2/files/caffe2-1.13.0-install-dirs.patch deleted file mode 100644 index 299c9f88a173..000000000000 --- a/sci-libs/caffe2/files/caffe2-1.13.0-install-dirs.patch +++ /dev/null @@ -1,121 +0,0 @@ ---- a/c10/CMakeLists.txt -+++ b/c10/CMakeLists.txt -@@ -112,7 +112,7 @@ - # Note: for now, we will put all export path into one single Caffe2Targets group - # to deal with the cmake deployment need. Inside the Caffe2Targets set, the - # individual libraries like libc10.so and libcaffe2.so are still self-contained. --install(TARGETS c10 EXPORT Caffe2Targets DESTINATION lib) -+install(TARGETS c10 EXPORT Caffe2Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}) - install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - DESTINATION include - FILES_MATCHING PATTERN "*.h") ---- a/c10/cuda/CMakeLists.txt -+++ b/c10/cuda/CMakeLists.txt -@@ -64,7 +64,7 @@ add_subdirectory(test) - # Note: for now, we will put all export path into one single Caffe2Targets group - # to deal with the cmake deployment need. Inside the Caffe2Targets set, the - # individual libraries like libc10.so and libcaffe2.so are still self-contained. --install(TARGETS c10_cuda EXPORT Caffe2Targets DESTINATION lib) -+install(TARGETS c10_cuda EXPORT Caffe2Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}) - foreach(file ${C10_CUDA_HEADERS}) - get_filename_component( dir ${file} DIRECTORY ) - install( FILES ${file} DESTINATION include/c10/cuda/${dir} ) ---- a/c10/hip/CMakeLists.txt -+++ b/c10/hip/CMakeLists.txt -@@ -55,7 +55,7 @@ target_include_directories( - add_subdirectory(test) - - # ---[ Installation --install(TARGETS c10_hip EXPORT Caffe2Targets DESTINATION lib) -+install(TARGETS c10_hip EXPORT Caffe2Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}) - install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - DESTINATION include - FILES_MATCHING PATTERN "*.h") ---- a/modules/detectron/CMakeLists.txt -+++ b/modules/detectron/CMakeLists.txt -@@ -20,7 +20,7 @@ - if(USE_MKLDNN) - target_link_libraries(caffe2_detectron_ops_gpu PRIVATE caffe2::mkldnn) - endif() -- install(TARGETS caffe2_detectron_ops_gpu DESTINATION lib) -+ install(TARGETS caffe2_detectron_ops_gpu DESTINATION ${CMAKE_INSTALL_LIBDIR}) - if(MSVC) - install(FILES $<TARGET_PDB_FILE:caffe2_detectron_ops_gpu> DESTINATION lib OPTIONAL) - endif() -@@ -37,7 +37,7 @@ - target_link_libraries(caffe2_detectron_ops_hip PRIVATE caffe2::mkldnn) - endif() - target_link_libraries(caffe2_detectron_ops_hip PRIVATE torch) -- install(TARGETS caffe2_detectron_ops_hip DESTINATION lib) -+ install(TARGETS caffe2_detectron_ops_hip DESTINATION ${CMAKE_INSTALL_LIBDIR}) - elseif(NOT IOS_PLATFORM) - add_library(caffe2_detectron_ops SHARED ${Detectron_CPU_SRCS}) - if(HAVE_SOVERSION) -@@ -49,7 +49,7 @@ - if(USE_MKLDNN) - target_link_libraries(caffe2_detectron_ops PRIVATE caffe2::mkldnn) - endif() -- install(TARGETS caffe2_detectron_ops DESTINATION lib) -+ install(TARGETS caffe2_detectron_ops DESTINATION ${CMAKE_INSTALL_LIBDIR}) - if(MSVC) - install(FILES $<TARGET_PDB_FILE:caffe2_detectron_ops> DESTINATION lib OPTIONAL) - endif() ---- a/modules/module_test/CMakeLists.txt -+++ b/modules/module_test/CMakeLists.txt -@@ -16,7 +16,7 @@ if(BUILD_TEST AND NOT BUILD_LITE_INTERPRETER) - VERSION ${TORCH_VERSION} SOVERSION ${TORCH_SOVERSION}) - endif() - target_link_libraries(caffe2_module_test_dynamic torch_library) -- install(TARGETS caffe2_module_test_dynamic DESTINATION lib) -+ install(TARGETS caffe2_module_test_dynamic DESTINATION ${CMAKE_INSTALL_LIBDIR}) - if(MSVC AND BUILD_SHARED_LIBS) - install(FILES $<TARGET_PDB_FILE:caffe2_module_test_dynamic> DESTINATION lib OPTIONAL) - endif() ---- a/modules/observers/CMakeLists.txt -+++ b/modules/observers/CMakeLists.txt -@@ -21,7 +21,7 @@ endif() - target_link_libraries(caffe2_observers PUBLIC torch_library) - target_include_directories(caffe2_observers PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..) - target_compile_options(caffe2_observers PRIVATE "-DCAFFE2_BUILD_OBSERVER_LIB") --install(TARGETS caffe2_observers DESTINATION lib) -+install(TARGETS caffe2_observers DESTINATION ${CMAKE_INSTALL_LIBDIR}) - caffe2_interface_library(caffe2_observers caffe2_observers_library) - if(MSVC AND BUILD_SHARED_LIBS) - install(FILES $<TARGET_PDB_FILE:caffe2_observers> DESTINATION lib OPTIONAL) ---- a/modules/rocksdb/CMakeLists.txt -+++ b/modules/rocksdb/CMakeLists.txt -@@ -63,7 +63,7 @@ add_library(caffe2_rocksdb ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb.cc) - target_link_libraries(caffe2_rocksdb PUBLIC torch_library) - target_link_libraries(caffe2_rocksdb PRIVATE ${RocksDB_LIBRARIES}) - target_include_directories(caffe2_rocksdb PRIVATE ${RocksDB_INCLUDE_DIR}) --install(TARGETS caffe2_rocksdb DESTINATION lib) -+install(TARGETS caffe2_rocksdb DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - # ---[ Last, Append the library to Caffe2_MODULES, if we are building with - # the main repo. ---- a/test/cpp/c10d/CMakeLists.txt -+++ b/test/cpp/c10d/CMakeLists.txt -@@ -51,7 +51,7 @@ if(USE_CUDA) - if(INSTALL_TEST) - install(TARGETS ProcessGroupNCCLTest DESTINATION bin) - install(TARGETS ProcessGroupNCCLErrorsTest DESTINATION bin) -- install(TARGETS c10d_cuda_test DESTINATION lib) -+ install(TARGETS c10d_cuda_test DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() - endif() - if(USE_UCC AND USE_C10D_UCC) ---- a/test/cpp/jit/CMakeLists.txt -+++ b/test/cpp/jit/CMakeLists.txt -@@ -32,9 +32,9 @@ endif() - target_link_libraries(backend_with_compiler torch) - - if(INSTALL_TEST) -- install(TARGETS torchbind_test DESTINATION lib) -- install(TARGETS jitbackend_test DESTINATION lib) -- install(TARGETS backend_with_compiler DESTINATION lib) -+ install(TARGETS torchbind_test DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(TARGETS jitbackend_test DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(TARGETS backend_with_compiler DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() - - # Build the cpp gtest binary containing the cpp-only tests. diff --git a/sci-libs/caffe2/files/caffe2-1.13.1-tensorpipe.patch b/sci-libs/caffe2/files/caffe2-1.13.1-tensorpipe.patch deleted file mode 100644 index ae0cac9fb947..000000000000 --- a/sci-libs/caffe2/files/caffe2-1.13.1-tensorpipe.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/cmake/Dependencies.cmake 2023-02-28 14:14:49.099057348 +0100 -+++ b/cmake/Dependencies.cmake 2023-02-28 14:15:05.326790806 +0100 -@@ -1404,7 +1404,6 @@ - - # Tensorpipe uses cuda_add_library - torch_update_find_cuda_flags() -- add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe) - - list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe) - if(USE_CUDA) diff --git a/sci-libs/caffe2/files/caffe2-2.0.0-cudnn_include_fix.patch b/sci-libs/caffe2/files/caffe2-2.0.0-cudnn_include_fix.patch deleted file mode 100644 index ff64e4108087..000000000000 --- a/sci-libs/caffe2/files/caffe2-2.0.0-cudnn_include_fix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uar pytorch-2.0.0/cmake/Dependencies.cmake pytorch-2.0.0orig/cmake/Dependencies.cmake ---- a/cmake/Dependencies.cmake 2023-04-23 09:43:20.767566047 -0400 -+++ b/cmake/Dependencies.cmake 2023-03-09 17:42:00.000000000 -0500 -@@ -1235,7 +1235,7 @@ - - # ---[ cuDNN - if(USE_CUDNN) -- set(CUDNN_FRONTEND_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../third_party/cudnn_frontend/include) -+ set(CUDNN_FRONTEND_INCLUDE_DIR /opt/cuda/include) - target_include_directories(torch::cudnn INTERFACE ${CUDNN_FRONTEND_INCLUDE_DIR}) - endif() - diff --git a/sci-libs/caffe2/files/caffe2-2.0.0-gcc13.patch b/sci-libs/caffe2/files/caffe2-2.0.0-gcc13.patch deleted file mode 100644 index acbcebad0a5d..000000000000 --- a/sci-libs/caffe2/files/caffe2-2.0.0-gcc13.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/c10/util/Registry.h 2023-03-09 17:42:00.000000000 -0500 -+++ b/c10/util/Registry.h 2023-04-09 20:38:33.108135511 -0400 -@@ -16,6 +16,7 @@ - #include <memory> - #include <mutex> - #include <string> -+#include <stdexcept> - #include <unordered_map> - #include <vector> - ---- a/torch/csrc/jit/passes/quantization/quantization_type.h 2023-03-09 17:42:00.000000000 -0500 -+++ b/torch/csrc/jit/passes/quantization/quantization_type.h 2023-04-09 20:43:43.124806308 -0400 -@@ -1,5 +1,6 @@ - #pragma once - #include <ostream> -+#include <cstdint> - - namespace torch { - namespace jit { - ---- a/torch/csrc/jit/runtime/logging.cpp 2023-03-09 17:42:00.000000000 -0500 -+++ b/torch/csrc/jit/runtime/logging.cpp 2023-04-09 20:47:49.758142941 -0400 -@@ -1,6 +1,7 @@ - #include <torch/csrc/jit/runtime/logging.h> - - #include <atomic> -+#include <stdexcept> - #include <mutex> - #include <unordered_map> - - ---- a/torch/csrc/lazy/core/multi_wait.cpp 2023-03-09 17:42:00.000000000 -0500 -+++ b/torch/csrc/lazy/core/multi_wait.cpp 2023-04-09 20:50:36.608145172 -0400 -@@ -1,6 +1,7 @@ - #include <torch/csrc/lazy/core/multi_wait.h> - - #include <chrono> -+#include <stdexcept> - #include <exception> - - namespace torch { diff --git a/sci-libs/caffe2/files/caffe2-2.1.2-fix-openmp-link.patch b/sci-libs/caffe2/files/caffe2-2.1.2-fix-openmp-link.patch deleted file mode 100644 index 3f2d0ae3c30a..000000000000 --- a/sci-libs/caffe2/files/caffe2-2.1.2-fix-openmp-link.patch +++ /dev/null @@ -1,15 +0,0 @@ -Fix "undefined symbol: omp_get_max_active_levels" in mkl + <nothing else> builds -https://github.com/pytorch/pytorch/issues/116576 ---- a/caffe2/CMakeLists.txt -+++ b/caffe2/CMakeLists.txt -@@ -1575,6 +1575,10 @@ if(BUILD_SHARED_LIBS) - target_link_libraries(torch_global_deps TBB::tbb) - endif() - -+ if(USE_OPENMP) -+ target_link_libraries(torch_global_deps OpenMP::OpenMP_CXX) -+ endif() -+ - install(TARGETS torch_global_deps DESTINATION "${TORCH_INSTALL_LIB_DIR}") - endif() - diff --git a/sci-libs/caffe2/files/caffe2-2.1.2-fix-rpath.patch b/sci-libs/caffe2/files/caffe2-2.1.2-fix-rpath.patch deleted file mode 100644 index 731227fa25ee..000000000000 --- a/sci-libs/caffe2/files/caffe2-2.1.2-fix-rpath.patch +++ /dev/null @@ -1,12 +0,0 @@ -Unset rpath to support blas-lapack-switch -Bug: https://bugs.gentoo.org/921129 ---- a/cmake/Dependencies.cmake -+++ b/cmake/Dependencies.cmake -@@ -10,7 +10,6 @@ endif(APPLE) - set(CMAKE_SKIP_BUILD_RPATH FALSE) - # Don't use the install-rpath during the build phase - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) --set(CMAKE_INSTALL_RPATH "${_rpath_portable_origin}") - # Automatically add all linked folders that are NOT in the build directory to - # the rpath (per library?) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) diff --git a/sci-libs/caffe2/files/caffe2-2.1.2-rocm-fix-std-cpp17.patch b/sci-libs/caffe2/files/caffe2-2.1.2-rocm-fix-std-cpp17.patch deleted file mode 100644 index cb0fa0c48e80..000000000000 --- a/sci-libs/caffe2/files/caffe2-2.1.2-rocm-fix-std-cpp17.patch +++ /dev/null @@ -1,68 +0,0 @@ -Fix for error: invalid argument '-std=c++17' not allowed with 'C' -https://github.com/pytorch/pytorch/issues/103222 ---- a/c10/hip/CMakeLists.txt -+++ b/c10/hip/CMakeLists.txt -@@ -30,6 +30,7 @@ hip_add_library(c10_hip ${C10_HIP_SRCS} ${C10_HIP_HEADERS}) - - # Propagate HIP_CXX_FLAGS that were set from Dependencies.cmake - target_compile_options(c10_hip PRIVATE ${HIP_CXX_FLAGS}) -+set_target_properties(c10_hip PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) - - # caffe2_hip adds a bunch of dependencies like rocsparse, but c10/hip is supposed to be - # minimal. I'm not sure if we need hip_hcc or not; for now leave it out ---- a/caffe2/CMakeLists.txt -+++ b/caffe2/CMakeLists.txt -@@ -1598,6 +1598,7 @@ if(USE_ROCM) - - # 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) -@@ -1774,6 +1775,7 @@ if(BUILD_TEST) - target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>) - target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE}) - target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS}) -+ set_target_properties(${test_name} PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) - add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>) - if(INSTALL_TEST) - install(TARGETS ${test_name} DESTINATION test) -@@ -1955,6 +1957,7 @@ if(BUILD_PYTHON) - endif() - if(NOT MSVC) - target_compile_options(caffe2_pybind11_state_hip PRIVATE ${HIP_CXX_FLAGS} -fvisibility=hidden) -+ set_target_properties(caffe2_pybind11_state_hip PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) - endif() - set_target_properties(caffe2_pybind11_state_hip PROPERTIES PREFIX "") - set_target_properties(caffe2_pybind11_state_hip PROPERTIES SUFFIX ${PY_EXT_SUFFIX}) ---- a/cmake/Dependencies.cmake -+++ b/cmake/Dependencies.cmake -@@ -1287,7 +1287,6 @@ if(USE_ROCM) - list(APPEND HIP_CXX_FLAGS -Wno-duplicate-decl-specifier) - list(APPEND HIP_CXX_FLAGS -DCAFFE2_USE_MIOPEN) - list(APPEND HIP_CXX_FLAGS -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_HIP) -- list(APPEND HIP_CXX_FLAGS -std=c++17) - add_definitions(-DROCM_VERSION=${ROCM_VERSION_DEV_INT}) - add_definitions(-DTORCH_HIP_VERSION=${TORCH_HIP_VERSION}) - message("TORCH_HIP_VERSION=${TORCH_HIP_VERSION} is added as a compiler defines") ---- a/cmake/public/utils.cmake -+++ b/cmake/public/utils.cmake -@@ -335,6 +335,7 @@ function(caffe2_hip_binary_target target_name_or_src) - caffe2_binary_target(${target_name_or_src}) - - target_compile_options(${__target} PRIVATE ${HIP_CXX_FLAGS}) -+ set_target_properties(${__target} PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) - target_include_directories(${__target} PRIVATE ${Caffe2_HIP_INCLUDE}) - endfunction() - ---- a/modules/detectron/CMakeLists.txt -+++ b/modules/detectron/CMakeLists.txt -@@ -31,6 +31,7 @@ if(BUILD_CAFFE2_OPS) - ${Detectron_CPU_SRCS} - ${Detectron_HIP_SRCS}) - target_compile_options(caffe2_detectron_ops_hip PRIVATE ${HIP_CXX_FLAGS}) -+ set_target_properties(caffe2_detectron_ops_hip PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) - if(USE_MKLDNN) - target_link_libraries(caffe2_detectron_ops_hip PRIVATE caffe2::mkldnn) - endif() diff --git a/sci-libs/caffe2/files/caffe2-2.2.1-gentoo.patch b/sci-libs/caffe2/files/caffe2-2.2.1-gentoo.patch deleted file mode 100644 index 5472a2c41836..000000000000 --- a/sci-libs/caffe2/files/caffe2-2.2.1-gentoo.patch +++ /dev/null @@ -1,195 +0,0 @@ ---- a/cmake/Dependencies.cmake -+++ b/cmake/Dependencies.cmake -@@ -474,7 +474,7 @@ - endif() - - # ---[ QNNPACK --if(USE_QNNPACK) -+if(FALSE) - set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party") - - if(NOT DEFINED QNNPACK_SOURCE_DIR) -@@ -530,7 +530,7 @@ - endif() - - # ---[ Caffe2 Int8 operators (enabled by USE_QNNPACK) depend on gemmlowp and neon2sse headers --if(USE_QNNPACK) -+if(FALSE) - set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party") - include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/gemmlowp") - include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/neon2sse") -@@ -780,7 +780,7 @@ - endif() - - # ---[ FBGEMM --if(USE_FBGEMM) -+if(FALSE) - set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party") - if(NOT DEFINED FBGEMM_SOURCE_DIR) - set(FBGEMM_SOURCE_DIR "${CAFFE2_THIRD_PARTY_ROOT}/fbgemm" CACHE STRING "FBGEMM source directory") -@@ -828,6 +828,7 @@ - endif() - - if(USE_FBGEMM) -+ list(APPEND Caffe2_DEPENDENCY_LIBS fbgemm) - caffe2_update_option(USE_FBGEMM ON) - else() - caffe2_update_option(USE_FBGEMM OFF) -@@ -1529,7 +1530,6 @@ - set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17) - endif() - endif() -- add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL) - - add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE}) - if(NOT USE_SYSTEM_ONNX) -@@ -1796,7 +1796,6 @@ - # - set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) - set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE) --add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt) - - # Disable compiler feature checks for `fmt`. - # -@@ -1805,9 +1804,7 @@ - # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know - # `fmt` is compatible with a superset of the compilers that PyTorch is, it - # shouldn't be too bad to just disable the checks. --set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "") - --list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only) - set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE) - - # ---[ Kineto ---- a/c10/CMakeLists.txt -+++ b/c10/CMakeLists.txt -@@ -89,7 +89,7 @@ - if(C10_USE_GLOG) - target_link_libraries(c10 PUBLIC glog::glog) - endif() --target_link_libraries(c10 PRIVATE fmt::fmt-header-only) -+target_link_libraries(c10 PRIVATE fmt) - - if(C10_USE_NUMA) - target_include_directories(c10 PRIVATE ${Numa_INCLUDE_DIR}) ---- a/torch/CMakeLists.txt -+++ b/torch/CMakeLists.txt -@@ -59,15 +59,9 @@ - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}/aten/src - ${CMAKE_BINARY_DIR}/caffe2/aten/src -- ${CMAKE_BINARY_DIR}/third_party -- ${CMAKE_BINARY_DIR}/third_party/onnx - -- ${TORCH_ROOT}/third_party/valgrind-headers - -- ${TORCH_ROOT}/third_party/gloo -- ${TORCH_ROOT}/third_party/onnx -- ${TORCH_ROOT}/third_party/flatbuffers/include -- ${TORCH_ROOT}/third_party/kineto/libkineto/include -+ /usr/include/kineto - - ${TORCH_SRC_DIR}/csrc - ${TORCH_SRC_DIR}/csrc/api/include -@@ -80,7 +74,6 @@ - python::python - pybind::pybind11 - shm -- fmt::fmt-header-only - ATEN_CPU_FILES_GEN_LIB) - - if(USE_ASAN AND TARGET Sanitizer::address) ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -835,12 +835,11 @@ - # Re-include to override append_cxx_flag_if_supported from third_party/FBGEMM - include(cmake/public/utils.cmake) - if(NOT MSVC) -- string(APPEND CMAKE_CXX_FLAGS " -O2 -fPIC") -+ string(APPEND CMAKE_CXX_FLAGS " -O2") - # Eigen fails to build with some versions, so convert this to a warning - # Details at http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1459 - string(APPEND CMAKE_CXX_FLAGS " -Wall") - string(APPEND CMAKE_CXX_FLAGS " -Wextra") -- append_cxx_flag_if_supported("-Werror=return-type" CMAKE_CXX_FLAGS) - append_cxx_flag_if_supported("-Werror=non-virtual-dtor" CMAKE_CXX_FLAGS) - append_cxx_flag_if_supported("-Werror=braced-scalar-init" CMAKE_CXX_FLAGS) - append_cxx_flag_if_supported("-Werror=range-loop-construct" CMAKE_CXX_FLAGS) -@@ -930,7 +930,6 @@ - string(APPEND CMAKE_LINKER_FLAGS_DEBUG " -fno-omit-frame-pointer -O0") - append_cxx_flag_if_supported("-fno-math-errno" CMAKE_CXX_FLAGS) - append_cxx_flag_if_supported("-fno-trapping-math" CMAKE_CXX_FLAGS) -- append_cxx_flag_if_supported("-Werror=format" CMAKE_CXX_FLAGS) - else() - # skip unwanted includes from windows.h - add_compile_definitions(WIN32_LEAN_AND_MEAN) ---- a/cmake/public/utils.cmake -+++ b/cmake/public/utils.cmake -@@ -486,8 +486,6 @@ - endif() - - # Use -O2 for release builds (-O3 doesn't improve perf, and -Os results in perf regression) -- target_compile_options(${libname} PRIVATE -- $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>>:-O2>) - - endfunction() - ---- a/cmake/Codegen.cmake -+++ b/cmake/Codegen.cmake -@@ -57,7 +57,7 @@ - if(MSVC) - set(OPT_FLAG "/fp:strict ") - else(MSVC) -- set(OPT_FLAG "-O3 ") -+ set(OPT_FLAG " ") - if("${CMAKE_BUILD_TYPE}" MATCHES "Debug") - set(OPT_FLAG " ") - endif() ---- a/caffe2/CMakeLists.txt -+++ b/caffe2/CMakeLists.txt -@@ -107,7 +107,7 @@ - # Note: the folders that are being commented out have not been properly - # addressed yet. - --if(NOT MSVC AND USE_XNNPACK) -+if(FALSE) - if(NOT TARGET fxdiv) - set(FXDIV_BUILD_TESTS OFF CACHE BOOL "") - set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "") -@@ -1055,7 +1055,6 @@ - endif() - - if(NOT MSVC AND USE_XNNPACK) -- TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv) - endif() - - # ========================================================== -@@ -1175,8 +1174,7 @@ - target_include_directories(torch_cpu PRIVATE - ${TORCH_ROOT}/third_party/miniz-2.1.0) - --target_include_directories(torch_cpu PRIVATE -- ${TORCH_ROOT}/third_party/kineto/libkineto/include) -+target_include_directories(torch_cpu PRIVATE /usr/include/kineto) - - if(USE_KINETO) - target_include_directories(torch_cpu PRIVATE ---- a/cmake/External/nnpack.cmake -+++ b/cmake/External/nnpack.cmake -@@ -56,7 +56,7 @@ - set(PTHREADPOOL_SOURCE_DIR "${CAFFE2_THIRD_PARTY_ROOT}/pthreadpool" CACHE STRING "pthreadpool source directory") - set(GOOGLETEST_SOURCE_DIR "${CAFFE2_THIRD_PARTY_ROOT}/googletest" CACHE STRING "Google Test source directory") - -- if(NOT TARGET nnpack) -+ if(FALSE) - if(NOT USE_SYSTEM_PTHREADPOOL AND USE_INTERNAL_PTHREADPOOL_IMPL) - set(NNPACK_CUSTOM_THREADPOOL ON CACHE BOOL "") - endif() ---- a/functorch/CMakeLists.txt 2023-11-30 20:30:45.805209036 +0100 -+++ b/functorch/CMakeLists.txt 2023-11-30 20:31:13.284766157 +0100 -@@ -35,4 +35,4 @@ - if(NOT ${TORCH_PYTHON_LINK_FLAGS} STREQUAL "") - set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS ${TORCH_PYTHON_LINK_FLAGS}) - endif() --install(TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}") -+install(TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_INSTALL_LIBDIR}") diff --git a/sci-libs/caffe2/files/caffe2-2.2.2-musl.patch b/sci-libs/caffe2/files/caffe2-2.2.2-musl.patch deleted file mode 100644 index f63e9f1df332..000000000000 --- a/sci-libs/caffe2/files/caffe2-2.2.2-musl.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/torch/csrc/profiler/unwind/unwind.cpp 2024-04-29 12:05:40.895667482 +0200 -+++ b/torch/csrc/profiler/unwind/unwind.cpp 2024-04-29 12:05:53.099524760 +0200 -@@ -112,8 +112,8 @@ - } - - struct Version { -- uint64_t adds_ = LONG_LONG_MAX; -- uint64_t subs_ = LONG_LONG_MAX; -+ uint64_t adds_ = LLONG_MAX; -+ uint64_t subs_ = LLONG_MAX; - }; - - struct UnwindCache { diff --git a/sci-libs/caffe2/files/caffe2-2.3.0-CMakeFix.patch b/sci-libs/caffe2/files/caffe2-2.3.0-CMakeFix.patch deleted file mode 100644 index eba37d933cac..000000000000 --- a/sci-libs/caffe2/files/caffe2-2.3.0-CMakeFix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt 2024-04-29 20:32:26.259716769 +0200 -+++ b/CMakeLists.txt 2024-04-29 20:32:35.886384618 +0200 -@@ -50,7 +50,7 @@ - - # This define is needed to preserve behavior given anticpated changes to cccl/thrust - # https://nvidia.github.io/libcudacxx/standard_api/numerics_library/complex.html --string(APPEND CMAKE_CUDA_FLAGS "-DLIBCUDACXX_ENABLE_SIMPLIFIED_COMPLEX_OPERATIONS") -+string(APPEND CMAKE_CUDA_FLAGS " -DLIBCUDACXX_ENABLE_SIMPLIFIED_COMPLEX_OPERATIONS") - - if(LINUX) - include(cmake/CheckAbi.cmake) diff --git a/sci-libs/caffe2/files/caffe2-2.3.0-cudnn_include_fix.patch b/sci-libs/caffe2/files/caffe2-2.3.0-cudnn_include_fix.patch deleted file mode 100644 index 77905dbd1ac8..000000000000 --- a/sci-libs/caffe2/files/caffe2-2.3.0-cudnn_include_fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/cmake/Dependencies.cmake 2024-04-29 18:37:34.005639858 +0200 -+++ b/cmake/Dependencies.cmake 2024-04-29 18:39:29.126587738 +0200 -@@ -1235,7 +1235,7 @@ - if(CUDNN_VERSION VERSION_LESS 8.5) - message(FATAL_ERROR "PyTorch needs CuDNN-8.5 or above, but found ${CUDNN_VERSION}. Builds are still possible with `USE_CUDNN=0`") - endif() -- set(CUDNN_FRONTEND_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../third_party/cudnn_frontend/include) -+ set(CUDNN_FRONTEND_INCLUDE_DIR /opt/cuda/include) - target_include_directories(torch::cudnn INTERFACE ${CUDNN_FRONTEND_INCLUDE_DIR}) - endif() - diff --git a/sci-libs/caffe2/files/caffe2-2.3.0-rocm-fix-std-cpp17.patch b/sci-libs/caffe2/files/caffe2-2.3.0-rocm-fix-std-cpp17.patch deleted file mode 100644 index 127a31e4b225..000000000000 --- a/sci-libs/caffe2/files/caffe2-2.3.0-rocm-fix-std-cpp17.patch +++ /dev/null @@ -1,68 +0,0 @@ -Fix for error: invalid argument '-std=c++17' not allowed with 'C' -https://github.com/pytorch/pytorch/issues/103222 ---- a/c10/hip/CMakeLists.txt -+++ b/c10/hip/CMakeLists.txt -@@ -30,6 +30,7 @@ hip_add_library(c10_hip ${C10_HIP_SRCS} ${C10_HIP_HEADERS}) - - # Propagate HIP_CXX_FLAGS that were set from Dependencies.cmake - target_compile_options(c10_hip PRIVATE ${HIP_CXX_FLAGS}) -+set_target_properties(c10_hip PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) - - # caffe2_hip adds a bunch of dependencies like rocsparse, but c10/hip is supposed to be - # minimal. I'm not sure if we need hip_hcc or not; for now leave it out ---- a/caffe2/CMakeLists.txt -+++ b/caffe2/CMakeLists.txt -@@ -1712,6 +1712,7 @@ if(USE_ROCM) - - # 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) -@@ -1908,6 +1909,7 @@ if(BUILD_TEST) - target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>) - target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE}) - target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS}) -+ set_target_properties(${test_name} PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) - add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>) - if(INSTALL_TEST) - install(TARGETS ${test_name} DESTINATION test) -@@ -2092,6 +2094,7 @@ if(BUILD_PYTHON) - endif() - if(NOT MSVC) - target_compile_options(caffe2_pybind11_state_hip PRIVATE ${HIP_CXX_FLAGS} -fvisibility=hidden) -+ set_target_properties(caffe2_pybind11_state_hip PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) - endif() - set_target_properties(caffe2_pybind11_state_hip PROPERTIES PREFIX "") - set_target_properties(caffe2_pybind11_state_hip PROPERTIES SUFFIX ${PY_EXT_SUFFIX}) ---- a/cmake/Dependencies.cmake -+++ b/cmake/Dependencies.cmake -@@ -1278,7 +1278,6 @@ - list(APPEND HIP_CXX_FLAGS -Wno-duplicate-decl-specifier) - list(APPEND HIP_CXX_FLAGS -DCAFFE2_USE_MIOPEN) - list(APPEND HIP_CXX_FLAGS -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_HIP) -- list(APPEND HIP_CXX_FLAGS -std=c++17) - if(ROCM_VERSION_DEV VERSION_GREATER_EQUAL "6.0.0") - list(APPEND HIP_CXX_FLAGS -DHIPBLAS_V2) - endif() ---- a/cmake/public/utils.cmake -+++ b/cmake/public/utils.cmake -@@ -335,6 +335,7 @@ function(caffe2_hip_binary_target target_name_or_src) - caffe2_binary_target(${target_name_or_src}) - - target_compile_options(${__target} PRIVATE ${HIP_CXX_FLAGS}) -+ set_target_properties(${__target} PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) - target_include_directories(${__target} PRIVATE ${Caffe2_HIP_INCLUDE}) - endfunction() - ---- a/modules/detectron/CMakeLists.txt -+++ b/modules/detectron/CMakeLists.txt -@@ -31,6 +31,7 @@ if(BUILD_CAFFE2_OPS) - ${Detectron_CPU_SRCS} - ${Detectron_HIP_SRCS}) - target_compile_options(caffe2_detectron_ops_hip PRIVATE ${HIP_CXX_FLAGS}) -+ set_target_properties(caffe2_detectron_ops_hip PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) - if(USE_MKLDNN) - target_link_libraries(caffe2_detectron_ops_hip PRIVATE caffe2::mkldnn) - endif() diff --git a/sci-libs/caffe2/files/caffe2-2.4.0-cpp-httplib.patch b/sci-libs/caffe2/files/caffe2-2.4.0-cpp-httplib.patch new file mode 100644 index 000000000000..5d684a4a4738 --- /dev/null +++ b/sci-libs/caffe2/files/caffe2-2.4.0-cpp-httplib.patch @@ -0,0 +1,13 @@ +--- a/torch/lib/libshm/CMakeLists.txt 2024-09-04 06:09:51.943752841 +0200 ++++ b/torch/lib/libshm/CMakeLists.txt 2024-09-04 06:10:52.243821438 +0200 +@@ -24,6 +24,10 @@ + CXX_STANDARD 17) + target_link_libraries(shm PRIVATE ${TORCH_CPU_LIB}) + ++if (USE_DISTRIBUTED) ++ target_link_libraries(shm PRIVATE cpp-httplib) ++endif() ++ + if(UNIX AND NOT APPLE) + include(CheckLibraryExists) + find_package(Threads REQUIRED) diff --git a/sci-libs/caffe2/files/caffe2-2.4.0-cstdint.patch b/sci-libs/caffe2/files/caffe2-2.4.0-cstdint.patch new file mode 100644 index 000000000000..f248ab031eb0 --- /dev/null +++ b/sci-libs/caffe2/files/caffe2-2.4.0-cstdint.patch @@ -0,0 +1,10 @@ +--- a/caffe2/utils/string_utils.cc 2024-09-05 08:29:06.930438069 +0200 ++++ b/caffe2/utils/string_utils.cc 2024-09-05 08:29:28.398137596 +0200 +@@ -3,6 +3,7 @@ + #include <algorithm> + #include <sstream> + #include <vector> ++#include <cstdint> + + namespace caffe2 { + diff --git a/sci-libs/caffe2/files/caffe2-2.4.0-libfmt-11.patch b/sci-libs/caffe2/files/caffe2-2.4.0-libfmt-11.patch new file mode 100644 index 000000000000..9f6740a07f1f --- /dev/null +++ b/sci-libs/caffe2/files/caffe2-2.4.0-libfmt-11.patch @@ -0,0 +1,44 @@ +Fix build against libfmt-11 + +https://github.com/pytorch/pytorch/commit/83eedf66b9e7f52323d9f45c5dfaa64472452595 +https://github.com/pytorch/pytorch/pull/130628 + +From 83eedf66b9e7f52323d9f45c5dfaa64472452595 Mon Sep 17 00:00:00 2001 +From: Aaron Gokaslan <aaronGokaslan@gmail.com> +Date: Tue, 16 Jul 2024 06:12:08 +0000 +Subject: [PATCH] Update libfmt submodule to 11.0.1 (#130628) + +Update libfmt to 11.0.1 reopen of https://github.com/pytorch/pytorch/pull/129962. Requires a kineto update and moves fmt::join into a separate include so added it where necessary. + +Pull Request resolved: https://github.com/pytorch/pytorch/pull/130628 +Approved by: https://github.com/aaronenyeshi +--- a/torch/csrc/distributed/c10d/socket.cpp ++++ b/torch/csrc/distributed/c10d/socket.cpp +@@ -32,6 +32,7 @@ C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wdeprecated") + #include <fmt/chrono.h> + C10_DIAGNOSTIC_POP() + #include <fmt/format.h> ++#include <fmt/ranges.h> + + #include <torch/csrc/distributed/c10d/error.h> + #include <torch/csrc/distributed/c10d/exception.h> +--- a/torch/csrc/profiler/standalone/execution_trace_observer.cpp ++++ b/torch/csrc/profiler/standalone/execution_trace_observer.cpp +@@ -10,6 +10,7 @@ + #endif // _WIN32 + + #include <fmt/format.h> ++#include <fmt/ranges.h> + #include <chrono> + #include <cmath> + #include <fstream> +--- a/torch/csrc/profiler/util.cpp ++++ b/torch/csrc/profiler/util.cpp +@@ -5,6 +5,7 @@ + #include <c10/util/ArrayRef.h> + #include <c10/util/irange.h> + #include <fmt/format.h> ++#include <fmt/ranges.h> + + #ifdef USE_KINETO + #include <libkineto.h> |