1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

gnu: fbgemm: Update to 1.5.0.

* gnu/packages/machine-learning.scm (fbgemm): Update to 1.5.0.
* gnu/packages/patches/fbgemm-use-system-libraries.patch: Refresh for 1.5.0,
enable C language checks in CMake, and adapt to upstream test CMake changes.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Ayan Das
2026-02-10 02:44:59 +05:30
committed by Ludovic Courtès
parent 8957ef1acd
commit b373a5ccff
2 changed files with 41 additions and 43 deletions

View File

@@ -4508,7 +4508,7 @@ TensorFlow.js, PyTorch, and MediaPipe.")
(define-public fbgemm
(package
(name "fbgemm")
(version "1.2.0")
(version "1.5.0")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -4517,7 +4517,7 @@ TensorFlow.js, PyTorch, and MediaPipe.")
(file-name (git-file-name name version))
(sha256
(base32
"0fjs7179iq5hy6nl4nyswnmk90fz87zsg14p7i5bk2vbd2vrq8a3"))
"1n96qjir24pmn2wml42d9l1z265bvdrkrvvh14ymm0bylh10fgaj"))
(patches (search-patches "fbgemm-use-system-libraries.patch"))))
(build-system cmake-build-system)
(arguments

View File

@@ -1,62 +1,60 @@
Use the asmjit and cpuinfo packages.
diff --git i/CMakeLists.txt w/CMakeLists.txt
index 73b043ac..703204dd 100644
index e645fc81..9fc95a17 100644
--- i/CMakeLists.txt
+++ w/CMakeLists.txt
@@ -258,7 +258,7 @@ message(STATUS "CMAKE_CXX_FLAGS_DEBUG is ${CMAKE_CXX_FLAGS_DEBUG}")
message(STATUS "CMAKE_CXX_FLAGS_RELEASE is ${CMAKE_CXX_FLAGS_RELEASE}")
message(STATUS "==========")
@@ -53,7 +53,7 @@ endfunction()
project(
fbgemm
VERSION 1.4.0
- LANGUAGES CXX)
+ LANGUAGES C CXX)
-if(NOT TARGET asmjit)
# Add C++ compiler flag detection
include(CheckCXXCompilerFlag)
@@ -447,7 +447,22 @@ install(
# Asmjit Target
################################################################################
+find_package(asmjit REQUIRED)
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(libcpuinfo REQUIRED IMPORTED_TARGET libcpuinfo)
+
+# Keep the upstream target names expected by DEPS throughout this file,
+# while wiring them to system-installed packages.
if(NOT TARGET asmjit)
+ add_library(asmjit INTERFACE IMPORTED)
+ target_link_libraries(asmjit INTERFACE asmjit::asmjit)
+endif()
+if(NOT TARGET cpuinfo)
+ add_library(cpuinfo INTERFACE IMPORTED)
+ target_link_libraries(cpuinfo INTERFACE PkgConfig::libcpuinfo)
+endif()
+
+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}/external/asmjit"
@@ -291,7 +291,7 @@ if(NOT TARGET asmjit)
endif()
endif()
@@ -469,7 +484,7 @@ endif()
# Cpuinfo Target
################################################################################
-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}/external/cpuinfo"
@@ -378,9 +378,12 @@ target_include_directories(fbgemm BEFORE
target_link_libraries(fbgemm
$<BUILD_INTERFACE:asmjit>
$<BUILD_INTERFACE:cpuinfo>)
-add_dependencies(fbgemm
- asmjit
- cpuinfo)
+
+find_package(asmjit)
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(libcpuinfo REQUIRED IMPORTED_TARGET libcpuinfo)
+
+target_link_libraries(fbgemm asmjit::asmjit PkgConfig::libcpuinfo)
if(OpenMP_FOUND)
target_link_libraries(fbgemm OpenMP::OpenMP_CXX)
diff --git i/test/CMakeLists.txt w/test/CMakeLists.txt
index 1ddb2882..6e81c902 100644
index d687e8dc..546540dd 100644
--- i/test/CMakeLists.txt
+++ w/test/CMakeLists.txt
@@ -14,7 +14,7 @@ set(CMAKE_C_STANDARD 17)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_C_STANDARD_REQUIRED ON)
@@ -10,7 +10,7 @@
-if(FBGEMM_BUILD_TESTS AND NOT TARGET gtest)
find_package(GTest)
-if(NOT GTest_FOUND)
+if(FALSE)
#Download Googletest framework from github if
#GOOGLETEST_SOURCE_DIR is not specified.
if(NOT DEFINED GOOGLETEST_SOURCE_DIR)
@@ -78,7 +78,7 @@ macro(add_gtest TESTNAME)
target_link_libraries(${TESTNAME} ${OpenMP_CXX_LIBRARIES})
endif()
- add_dependencies(${TESTNAME} gtest fbgemm)
+ add_dependencies(${TESTNAME} fbgemm)
add_test(${TESTNAME} ${TESTNAME})
set_target_properties(${TESTNAME} PROPERTIES FOLDER test)
endmacro()
# Download Googletest framework from github if
# GOOGLETEST_SOURCE_DIR is not specified.
set(INSTALL_GTEST OFF)