summaryrefslogtreecommitdiff
path: root/sci-libs/caffe2/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
commit0f558761aa2dee1017b4751e4017205e015a9560 (patch)
tree037df795519468a25d9362b4e95cdaeb84eb1cf9 /sci-libs/caffe2/files
parent752d6256e5204b958b0ef7905675a940b5e9172f (diff)
gentoo resync : 29.12.2022
Diffstat (limited to 'sci-libs/caffe2/files')
-rw-r--r--sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch93
1 files changed, 93 insertions, 0 deletions
diff --git a/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch b/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch
new file mode 100644
index 000000000000..ac74edadab35
--- /dev/null
+++ b/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch
@@ -0,0 +1,93 @@
+--- a/cmake/Dependencies.cmake 2022-06-17 22:12:34.451841710 +0200
++++ b/cmake/Dependencies.cmake 2022-06-17 22:12:48.302786501 +0200
+@@ -1512,7 +1512,6 @@
+ if(NOT USE_SYSTEM_ONNX)
+ add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/onnx EXCLUDE_FROM_ALL)
+ endif()
+- add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
+
+ add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
+ if(NOT USE_SYSTEM_ONNX)
+@@ -1810,7 +1809,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`.
+ #
+@@ -1819,9 +1817,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)
+
+ if(USE_BREAKPAD)
+--- a/c10/CMakeLists.txt 2022-06-17 22:40:53.573306905 +0200
++++ b/c10/CMakeLists.txt 2022-06-17 22:41:16.920219686 +0200
+@@ -59,7 +59,7 @@
+ if(${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)
+
+ find_package(Backtrace)
+ if(Backtrace_FOUND)
+--- a/torch/CMakeLists.txt 2022-06-17 22:42:20.396982644 +0200
++++ b/torch/CMakeLists.txt 2022-06-17 22:43:20.214759326 +0200
+@@ -82,7 +82,6 @@
+
+ set(TORCH_PYTHON_LINK_LIBRARIES
+ shm
+- fmt::fmt-header-only
+ ATEN_CPU_FILES_GEN_LIB)
+
+ set(TORCH_PYTHON_COMPILE_DEFINITIONS)
+--- a/CMakeLists.txt 2022-06-18 20:35:01.451116185 +0200
++++ b/CMakeLists.txt 2022-06-18 20:35:08.219023569 +0200
+@@ -750,7 +750,7 @@
+
+ # ---[ Build flags
+ if(NOT MSVC)
+- string(APPEND CMAKE_CXX_FLAGS " -O2 -fPIC")
++ string(APPEND CMAKE_CXX_FLAGS " -fPIC")
+ string(APPEND CMAKE_CXX_FLAGS " -Wno-narrowing")
+ # 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
+--- a/cmake/public/utils.cmake 2022-06-18 20:50:39.314263395 +0200
++++ b/cmake/public/utils.cmake 2022-06-18 20:51:49.611291709 +0200
+@@ -512,8 +512,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 2022-06-18 21:33:13.366381817 +0200
++++ b/cmake/Codegen.cmake 2022-06-18 21:33:30.249157610 +0200
+@@ -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/c10/CMakeLists.txt 2022-06-19 09:57:16.776536871 +0200
++++ b/c10/CMakeLists.txt 2022-06-19 09:58:51.663356075 +0200
+@@ -107,7 +107,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")