From 18d04fef0fea2c604b42c465782f3be647c2b947 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 29 Jul 2021 14:25:17 +0200 Subject: gnu: Add pthreadpool. * gnu/packages/parallel.scm (pthreadpool): New variable. * gnu/packages/patches/pthreadpool-system-libraries.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/packages/parallel.scm | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'gnu/packages/parallel.scm') diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm index 42826f49d6..79387e5552 100644 --- a/gnu/packages/parallel.scm +++ b/gnu/packages/parallel.scm @@ -9,7 +9,7 @@ ;;; Copyright © 2017, 2018 Rutger Helling ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice ;;; Copyright © 2018 Clément Lassieur -;;; Copyright © 2019, 2020 Ludovic Courtès +;;; Copyright © 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2020 Roel Janssen ;;; Copyright © 2021 Stefan Reichör ;;; @@ -44,6 +44,7 @@ #:use-module (gnu packages flex) #:use-module (gnu packages freeipmi) #:use-module (gnu packages linux) + #:use-module (gnu packages maths) #:use-module (gnu packages mpi) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) @@ -378,3 +379,35 @@ and output captured in the notebook. Whatever arguments are accepted by a SLURM command line executable are also accepted by the corresponding magic command---e.g., @code{%salloc}, @code{%sbatch}, etc.") (license license:bsd-3)))) + +(define-public pthreadpool + ;; This repository has only one tag, 0.1, which is older than what users + ;; such as XNNPACK expect. + (let ((commit "1787867f6183f056420e532eec640cba25efafea") + (version "0.1") + (revision "1")) + (package + (name "pthreadpool") + (version (git-version version revision commit)) + (home-page "https://github.com/Maratyszcza/pthreadpool") + (source (origin + (method git-fetch) + (uri (git-reference (url home-page) (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "02hdvxfn5krw8zivkgjx3b4rk9p02yr4mpdjlp75lsv6z1xf5yrx")) + (patches (search-patches "pthreadpool-system-libraries.patch")))) + (build-system cmake-build-system) + (arguments '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"))) + (inputs + `(("googletest" ,googletest) + ("googlebenchmark" ,googlebenchmark) + ("fxdiv" ,fxdiv))) + (synopsis "Efficient thread pool implementation") + (description + "The pthreadpool library implements an efficient and portable thread +pool, similar to those implemented by OpenMP run-time support libraries for +constructs such as @code{#pragma omp parallel for}, with additional +features.") + (license license:bsd-2)))) -- cgit v1.2.3 From 4c5ad827808f6c9964c05c9777d02b200fa619bb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 29 Jul 2021 14:41:46 +0200 Subject: gnu: Add cpuinfo. * gnu/packages/parallel.scm (cpuinfo): New variable. * gnu/packages/patches/cpuinfo-system-libraries.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/parallel.scm | 31 ++++++++++++++ .../patches/cpuinfo-system-libraries.patch | 50 ++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 gnu/packages/patches/cpuinfo-system-libraries.patch (limited to 'gnu/packages/parallel.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 488ef3716d..3d07bc2700 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -929,6 +929,7 @@ dist_patch_DATA = \ %D%/packages/patches/combinatorial-blas-io-fix.patch \ %D%/packages/patches/coreutils-ls.patch \ %D%/packages/patches/cpufrequtils-fix-aclocal.patch \ + %D%/packages/patches/cpuinfo-system-libraries.patch \ %D%/packages/patches/crawl-upgrade-saves.patch \ %D%/packages/patches/crda-optional-gcrypt.patch \ %D%/packages/patches/clucene-contribs-lib.patch \ diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm index 79387e5552..b5914fdffa 100644 --- a/gnu/packages/parallel.scm +++ b/gnu/packages/parallel.scm @@ -31,6 +31,7 @@ (define-module (gnu packages parallel) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system python) #:use-module ((guix licenses) #:prefix license:) @@ -41,6 +42,7 @@ #:use-module (gnu packages admin) #:use-module (gnu packages autotools) #:use-module (gnu packages base) + #:use-module (gnu packages check) #:use-module (gnu packages flex) #:use-module (gnu packages freeipmi) #:use-module (gnu packages linux) @@ -411,3 +413,32 @@ pool, similar to those implemented by OpenMP run-time support libraries for constructs such as @code{#pragma omp parallel for}, with additional features.") (license license:bsd-2)))) + +(define-public cpuinfo + ;; There's currently no tag on this repo. + (let ((version "0.0") + (revision "1") + (commit "866ae6e5ffe93a1f63be738078da94cf3005cce2")) + (package + (name "cpuinfo") + (version (git-version version revision commit)) + (home-page "https://github.com/pytorch/cpuinfo") + (source (origin + (method git-fetch) + (uri (git-reference (url home-page) (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1lmsf4bpkm19a31i40qwcjn46qf7prggziv4pbsi695bkx5as71p")) + (patches (search-patches "cpuinfo-system-libraries.patch")))) + (build-system cmake-build-system) + (arguments '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"))) + (inputs + `(("googletest" ,googletest) + ("googlebenchmark" ,googlebenchmark))) + (synopsis "C/C++ library to obtain information about the CPU") + (description + "The cpuinfo library provides a C/C++ and a command-line interface to +obtain information about the CPU being used: supported instruction set, +processor name, cache information, and topology information.") + (license license:bsd-2)))) diff --git a/gnu/packages/patches/cpuinfo-system-libraries.patch b/gnu/packages/patches/cpuinfo-system-libraries.patch new file mode 100644 index 0000000000..e25446e9da --- /dev/null +++ b/gnu/packages/patches/cpuinfo-system-libraries.patch @@ -0,0 +1,50 @@ +This patch allows the build process to use the provided dependencies instead +of adding their source as CMake sub-directories (in which case "make install" +would install googletest's and googlebenchmark's libraries and headers). + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 57abc26..761c612 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -93,7 +93,7 @@ SET(CONFU_DEPENDENCIES_BINARY_DIR ${CMAKE_BINARY_DIR}/deps + CACHE PATH "Confu-style dependencies binary directory") + + IF(CPUINFO_BUILD_MOCK_TESTS OR CPUINFO_BUILD_UNIT_TESTS) +- IF(CPUINFO_SUPPORTED_PLATFORM AND NOT DEFINED GOOGLETEST_SOURCE_DIR) ++ IF(FALSE) + MESSAGE(STATUS "Downloading Google Test to ${CONFU_DEPENDENCIES_SOURCE_DIR}/googletest (define GOOGLETEST_SOURCE_DIR to avoid it)") + CONFIGURE_FILE(cmake/DownloadGoogleTest.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest-download/CMakeLists.txt") + EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . +@@ -105,7 +105,7 @@ IF(CPUINFO_BUILD_MOCK_TESTS OR CPUINFO_BUILD_UNIT_TESTS) + ENDIF() + + IF(CPUINFO_BUILD_BENCHMARKS) +- IF(CPUINFO_SUPPORTED_PLATFORM AND NOT DEFINED GOOGLEBENCHMARK_SOURCE_DIR) ++ IF(FALSE) + MESSAGE(STATUS "Downloading Google Benchmark to ${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark (define GOOGLEBENCHMARK_SOURCE_DIR to avoid it)") + CONFIGURE_FILE(cmake/DownloadGoogleBenchmark.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark-download/CMakeLists.txt") + EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . +@@ -271,14 +271,6 @@ INSTALL(TARGETS cpuinfo + + # ---[ cpuinfo micro-benchmarks + IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_BENCHMARKS) +- # ---[ Build google benchmark +- IF(NOT TARGET benchmark) +- SET(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "") +- ADD_SUBDIRECTORY( +- "${GOOGLEBENCHMARK_SOURCE_DIR}" +- "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark") +- ENDIF() +- + IF(CMAKE_SYSTEM_NAME MATCHES "^(Linux|Android)$") + ADD_EXECUTABLE(get-current-bench bench/get-current.cc) + TARGET_LINK_LIBRARIES(get-current-bench cpuinfo benchmark) +@@ -289,7 +281,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_BENCHMARKS) + ENDIF() + + IF(CPUINFO_SUPPORTED_PLATFORM) +- IF(CPUINFO_BUILD_MOCK_TESTS OR CPUINFO_BUILD_UNIT_TESTS) ++ IF(FALSE) + # ---[ Build google test + IF(NOT TARGET gtest) + IF(MSVC AND NOT CPUINFO_RUNTIME_TYPE STREQUAL "static") -- cgit v1.2.3 From 065d45e8a1c3af31889df53d6feb49973814009c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 29 Jul 2021 16:11:26 +0200 Subject: gnu: Add Psimd. * gnu/packages/parallel.scm (psimd): New variable. --- gnu/packages/parallel.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'gnu/packages/parallel.scm') diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm index b5914fdffa..ca8be00cea 100644 --- a/gnu/packages/parallel.scm +++ b/gnu/packages/parallel.scm @@ -442,3 +442,27 @@ features.") obtain information about the CPU being used: supported instruction set, processor name, cache information, and topology information.") (license license:bsd-2)))) + +(define-public psimd + ;; There is currently no tag in this repo. + (let ((commit "072586a71b55b7f8c584153d223e95687148a900") + (version "0.0") + (revision "1")) + (package + (name "psimd") + (version (git-version version revision commit)) + (home-page "https://github.com/Maratyszcza/Psimd") + (source (origin + (method git-fetch) + (uri (git-reference (url home-page) (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "16mslhvqs0gpqbg7kkq566a8gkn58cgjpqca8ljj9qcv5mk9apwm")))) + (build-system cmake-build-system) + (arguments '(#:tests? #f)) ;there are no tests + (synopsis "Portable 128-bit SIMD intrinsics") + (description + "This header-only C++ library provides a portable interface to +single-instruction multiple-data (SIMD) intrinsics.") + (license license:expat)))) -- cgit v1.2.3 From 7041abe38aed6b438bbd975fe5d68f23bd6d16e5 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Fri, 30 Jul 2021 19:17:52 +0300 Subject: gnu: parallel: Update to 20210722. * gnu/packages/parallel.scm (parallel): Update to 20210722. --- gnu/packages/parallel.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/parallel.scm') diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm index ca8be00cea..8f5d0aeb64 100644 --- a/gnu/packages/parallel.scm +++ b/gnu/packages/parallel.scm @@ -61,14 +61,14 @@ (define-public parallel (package (name "parallel") - (version "20210622") + (version "20210722") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/parallel/parallel-" version ".tar.bz2")) (sha256 - (base32 "11pcc5kim104wz25k5q1pqhd6z85d7dx509h74ncaxhyyydjfcvv")))) + (base32 "0jaa5137sjw2szvmnnslkqv1n3gg2rkkgr71j7hpp5a3q15hjf9j")))) (build-system gnu-build-system) (arguments `(#:phases -- cgit v1.2.3