commit:     a18e19013d93822a2dffc221dc3d9bf5285db7e8
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  2 20:57:26 2023 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sat Dec  2 20:59:21 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a18e1901

dev-libs/FBGEMM: add 2023.11.02

Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 dev-libs/FBGEMM/FBGEMM-2023.11.02.ebuild           | 79 ++++++++++++++++++++++
 dev-libs/FBGEMM/Manifest                           |  1 +
 .../FBGEMM/files/FBGEMM-2023.11.02-gentoo.patch    | 69 +++++++++++++++++++
 3 files changed, 149 insertions(+)

diff --git a/dev-libs/FBGEMM/FBGEMM-2023.11.02.ebuild 
b/dev-libs/FBGEMM/FBGEMM-2023.11.02.ebuild
new file mode 100644
index 000000000000..e4307e16afe8
--- /dev/null
+++ b/dev-libs/FBGEMM/FBGEMM-2023.11.02.ebuild
@@ -0,0 +1,79 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+inherit python-any-r1 flag-o-matic cmake
+
+CommitId=cdae5d97e3aa9fda4222f31c04dbd80249c918d1
+
+DESCRIPTION="Facebook GEneral Matrix Multiplication"
+HOMEPAGE="https://github.com/pytorch/FBGEMM";
+SRC_URI="https://github.com/pytorch/${PN}/archive/${CommitId}.tar.gz
+       -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc test"
+
+DEPEND="
+       >=dev-libs/asmjit-2022.07.02
+       dev-libs/cpuinfo
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+       test? ( dev-cpp/gtest )
+       doc? (
+               $(python_gen_any_dep '
+                       dev-python/sphinx[${PYTHON_USEDEP}]
+                       dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
+                       dev-python/breathe[${PYTHON_USEDEP}]
+               ')
+       )
+       ${PYTHON_DEPS}
+"
+RESTRICT="!test? ( test )"
+
+S="${WORKDIR}"/${PN}-${CommitId}
+
+python_check_deps() {
+       if use doc; then
+               python_has_version \
+                       "dev-python/sphinx[${PYTHON_USEDEP}]" \
+                       "dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]" \
+                       "dev-python/breathe[${PYTHON_USEDEP}]"
+       fi
+}
+
+PATCHES=(
+       "${FILESDIR}"/${P}-gentoo.patch
+)
+
+src_prepare() {
+       # Bug #855668
+       filter-lto
+
+       rm test/RowWiseSparseAdagradFusedTest.cc || die
+       rm test/SparseAdagradTest.cc || die
+       sed -i \
+               -e "/-Werror/d" \
+               CMakeLists.txt \
+               || die
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DFBGEMM_LIBRARY_TYPE=shared
+               -DFBGEMM_BUILD_BENCHMARKS=OFF
+               -DFBGEMM_BUILD_DOCS=$(usex doc ON OFF)
+               -DFBGEMM_BUILD_TESTS=$(usex test ON OFF)
+       )
+       cmake_src_configure
+}
+
+src_test() {
+       OMP_STACKSIZE=512k cmake_src_test
+}

diff --git a/dev-libs/FBGEMM/Manifest b/dev-libs/FBGEMM/Manifest
index 5ca7cee0d7e4..537d3f459c6a 100644
--- a/dev-libs/FBGEMM/Manifest
+++ b/dev-libs/FBGEMM/Manifest
@@ -1 +1,2 @@
 DIST FBGEMM-2023.02.10.tar.gz 854918 BLAKE2B 
2af11baf95c1f33e1b1dd6f2a51dde2c991ff0f606402a7aaa539b7bc505c3707cafaa96d8f742c91672ec09a1f18a69f0e69c012b6db11d5297d602b8f4860c
 SHA512 
a59d928150d674c56b5d38f73e62b5f4e2b527ea1f7ebb891ea1d3356e4183e0f469d145fca37fcb1c85f8773cf54226a8e41389fe9783474c457a7bd31846d6
+DIST FBGEMM-2023.11.02.tar.gz 895265 BLAKE2B 
0f884147a86881159485680f1cb0c7b7e65bba5a98e62c38534041264f920e08a268e348e3d82ba3d246226a10f592d86dc37bce0cfa42c72dad478041a6c807
 SHA512 
030f27a120586240c5f80026bd033cf6fedbe1ae12a667308d33d6321f2334021d474a3625795d1f34734336b688b19c09134e10d5cc8dec86e84485de298584

diff --git a/dev-libs/FBGEMM/files/FBGEMM-2023.11.02-gentoo.patch 
b/dev-libs/FBGEMM/files/FBGEMM-2023.11.02-gentoo.patch
new file mode 100644
index 000000000000..6ff4950211a2
--- /dev/null
+++ b/dev-libs/FBGEMM/files/FBGEMM-2023.11.02-gentoo.patch
@@ -0,0 +1,69 @@
+--- a/CMakeLists.txt   2022-05-21 13:13:50.806813151 +0200
++++ b/CMakeLists.txt   2022-05-21 13:16:46.448969453 +0200
+@@ -225,7 +225,7 @@
+ message(WARNING "CMAKE_CXX_FLAGS_RELEASE is ${CMAKE_CXX_FLAGS_RELEASE}")
+ message(WARNING "==========")
+ 
+-if(NOT TARGET asmjit)
++if(FALSE)
+   #Download asmjit from github if ASMJIT_SRC_DIR is not specified.
+   if(NOT DEFINED ASMJIT_SRC_DIR)
+     set(ASMJIT_SRC_DIR "${FBGEMM_SOURCE_DIR}/third_party/asmjit"
+@@ -254,7 +254,7 @@
+   endif()
+ endif()
+ 
+-if(NOT TARGET cpuinfo)
++if(FALSE)
+   #Download cpuinfo from github if CPUINFO_SOURCE_DIR is not specified.
+   if(NOT DEFINED CPUINFO_SOURCE_DIR)
+     set(CPUINFO_SOURCE_DIR "${FBGEMM_SOURCE_DIR}/third_party/cpuinfo"
+@@ -330,9 +330,6 @@
+ target_link_libraries(fbgemm
+   $<BUILD_INTERFACE:asmjit>
+   $<BUILD_INTERFACE:cpuinfo>)
+-add_dependencies(fbgemm
+-  asmjit
+-  cpuinfo)
+ 
+ if(OpenMP_FOUND)
+   target_link_libraries(fbgemm OpenMP::OpenMP_CXX)
+@@ -349,6 +346,9 @@
+   FILES ${FBGEMM_PUBLIC_HEADERS}
+   DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/fbgemm")
+ 
++install(FILES src/RefImplementations.h
++  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/fbgemm/src")
++
+ install(
+   EXPORT fbgemmLibraryConfig
+   DESTINATION share/cmake/fbgemm
+--- a/test/CMakeLists.txt      2022-05-21 13:15:34.140135199 +0200
++++ b/test/CMakeLists.txt      2022-05-21 13:17:59.170813431 +0200
+@@ -8,7 +8,7 @@
+ set(CMAKE_C_EXTENSIONS OFF)
+ set(CMAKE_C_STANDARD_REQUIRED ON)
+ 
+-if(FBGEMM_BUILD_TESTS AND NOT TARGET gtest)
++if(FALSE)
+   #Download Googletest framework from github if
+   #GOOGLETEST_SOURCE_DIR is not specified.
+   if(NOT DEFINED GOOGLETEST_SOURCE_DIR)
+@@ -72,7 +72,6 @@
+     target_link_libraries(${TESTNAME} ${OpenMP_CXX_LIBRARIES})
+   endif()
+ 
+-  add_dependencies(${TESTNAME} gtest fbgemm)
+   add_test(${TESTNAME} ${TESTNAME})
+   set_target_properties(${TESTNAME} PROPERTIES FOLDER test)
+ endmacro()
+--- a/src/PackMatrix.cc        2022-05-24 08:19:00.639462626 +0200
++++ b/src/PackMatrix.cc        2022-05-24 08:27:59.127720548 +0200
+@@ -30,6 +30,7 @@
+ }
+ 
+ template <typename PT, typename inpType, typename accType>
++FBGEMM_API
+ int PackMatrix<PT, inpType, accType>::packedBufferSize(
+     int rows,
+     int cols,

Reply via email to