From patchwork Sat Dec 4 20:49:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34959 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1866727BBE9; Sat, 4 Dec 2021 20:50:16 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D483E27BBEB for ; Sat, 4 Dec 2021 20:50:14 +0000 (GMT) Received: from localhost ([::1]:37176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbz3-0005s6-SQ for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 15:50:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbys-0005ra-DF for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43683) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbys-0001jb-5U for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbys-0003bn-3X for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 01/10] Add (guix cpu). References: <20211204203447.15200-1-ludo@gnu.org> In-Reply-To: <20211204203447.15200-1-ludo@gnu.org> Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865098513743 (code B ref 52283); Sat, 04 Dec 2021 20:50:02 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:45 +0000 Received: from localhost ([127.0.0.1]:55197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyb-0003ZV-4L for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyZ-0003Z5-Sb for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:44 -0500 Received: from [2001:470:142:3::e] (port=45326 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyU-0001fg-8a; Sat, 04 Dec 2021 15:49:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=yUdLBOCnF5V5tbnoR9MFzY4wEQvqsCzLcrMJSpSVhh4=; b=SvaxT2PyaDT47g wghT4TLAceqpGpOPvt/wWPL3Pbq0LIpQdBT+frfWNMJrhQtsI/Kzhgsjecd+Qj2/LNAPi5thCxcnM efGDosp5SlA0BGx94gbYxDEGOSGayFAVUocctL17EMLxoDUsEBhXLX06AofonIYaq6EvFWp1RM/pm UNI0xR/Kbg+Pu04Nrkt795CkHuz8vZg0zohRSpHa0WxJFTC8g+SgAIZQW6blxsbqIllE21NtyFT2W dt2ejASrGdPWzmKddm46Q4vgjFDsmOvCM8QmYMh7W3AuzYcPbatncDfdX/u4S8fXSqJJBRtQy+L1C FZeQNTUiYULo6mm612Kg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyU-00059z-20; Sat, 04 Dec 2021 15:49:38 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:15 +0100 Message-Id: <20211204204924.15581-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/cpu.scm: New file. * Makefile.am (MODULES): Add it. --- Makefile.am | 1 + guix/cpu.scm | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 guix/cpu.scm diff --git a/Makefile.am b/Makefile.am index f7e7b5184f..0846818cc2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -81,6 +81,7 @@ MODULES = \ guix/base64.scm \ guix/ci.scm \ guix/cpio.scm \ + guix/cpu.scm \ guix/deprecation.scm \ guix/docker.scm \ guix/records.scm \ diff --git a/guix/cpu.scm b/guix/cpu.scm new file mode 100644 index 0000000000..77efac92a2 --- /dev/null +++ b/guix/cpu.scm @@ -0,0 +1,137 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix cpu) + #:use-module (guix sets) + #:use-module (guix memoization) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (ice-9 match) + #:use-module (ice-9 rdelim) + #:export (current-cpu + cpu? + cpu-architecture + cpu-family + cpu-model + cpu-flags + + cpu->gcc-architecture)) + +;;; Commentary: +;;; +;;; This module provides tools to determine the micro-architecture supported +;;; by the CPU and to map it to a name known to GCC's '-march'. +;;; +;;; Code: + +;; CPU description. +(define-record-type + (cpu architecture family model flags) + cpu? + (architecture cpu-architecture) ;string, from 'uname' + (family cpu-family) ;integer + (model cpu-model) ;integer + (flags cpu-flags)) ;set of strings + +(define current-cpu + (mlambda () + "Return a record representing the host CPU." + (define (prefix? prefix) + (lambda (str) + (string-prefix? prefix str))) + + (call-with-input-file "/proc/cpuinfo" + (lambda (port) + (let loop ((family #f) + (model #f)) + (match (read-line port) + ((? eof-object?) + #f) + ((? (prefix? "cpu family") str) + (match (string-tokenize str) + (("cpu" "family" ":" family) + (loop (string->number family) model)))) + ((? (prefix? "model") str) + (match (string-tokenize str) + (("model" ":" model) + (loop family (string->number model))) + (_ + (loop family model)))) + ((? (prefix? "flags") str) + (match (string-tokenize str) + (("flags" ":" flags ...) + (cpu (utsname:machine (uname)) + family model (list->set flags))))) + (_ + (loop family model)))))))) + +(define (cpu->gcc-architecture cpu) + "Return the architecture name, suitable for GCC's '-march' flag, that +corresponds to CPU, a record as returned by 'current-cpu'." + (match (cpu-architecture cpu) + ("x86_64" + ;; Transcribed from GCC's 'host_detect_local_cpu' in driver-i386.c. + (or (and (= 6 (cpu-family cpu)) ;the "Pentium Pro" family + (letrec-syntax ((model (syntax-rules (=>) + ((_) #f) + ((_ (candidate => integers ...) rest + ...) + (or (and (= (cpu-model cpu) integers) + candidate) + ... + (model rest ...)))))) + (model ("bonnel" => #x1c #x26) + ("silvermont" => #x37 #x4a #x4d #x5a #x5d) + ("core2" => #x0f #x17 #x1d) + ("nehalem" => #x1a #x1e #x1f #x2e) + ("westmere" => #x25 #x2c #x2f) + ("sandybridge" => #x2a #x2d) + ("ivybridge" => #x3a #x3e) + ("haswell" => #x3c #x3f #x45 #x46) + ("broadwell" => #x3d #x47 #x4f #x56) + ("skylake" => #x4e #x5e #x8e #x9e) + ("skylake-avx512" => #x55) ;TODO: cascadelake + ("knl" => #x57) + ("cannonlake" => #x66) + ("knm" => #x85)))) + + ;; Fallback case for non-Intel processors or for Intel processors not + ;; recognized above. + (letrec-syntax ((if-flags (syntax-rules (=>) + ((_) + #f) + ((_ (flags ... => name) rest ...) + (if (every (lambda (flag) + (set-contains? (cpu-flags cpu) + flag)) + '(flags ...)) + name + (if-flags rest ...)))))) + (if-flags ("avx512" => "knl") + ("adx" => "broadwell") + ("avx2" => "haswell") + ;; TODO: tigerlake, cooperlake, etc. + ("avx" => "sandybridge") + ("sse4_2" "movbe" => "silvermont") + ("sse4_2" => "nehalem") + ("ssse3" "movbe" => "bonnell") + ("ssse3" => "core2"))) + "x86_64")) + (architecture + ;; TODO: AArch64. + architecture))) From patchwork Sat Dec 4 20:49:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34961 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A447B27BBEA; Sat, 4 Dec 2021 20:50:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7C70127BBE9 for ; Sat, 4 Dec 2021 20:50:24 +0000 (GMT) Received: from localhost ([::1]:37916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbzD-0006Oi-L6 for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 15:50:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyt-0005rq-8I for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43685) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbys-0001kH-V0 for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbys-0003c2-TV for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 02/10] transformations: Add '--tune'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865098913790 (code B ref 52283); Sat, 04 Dec 2021 20:50:02 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:49 +0000 Received: from localhost ([127.0.0.1]:55211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbye-0003a8-11 for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbya-0003Z8-Ma for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:45 -0500 Received: from [2001:470:142:3::e] (port=45328 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyU-0001fp-PQ; Sat, 04 Dec 2021 15:49:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=U17giIwh3cjH9FKsmqtHZ+X+JKCiNEMVWUdbymhoL4k=; b=XhaA9B6trOtwpwh9zNpi DPxn2CYmrUU5EflprwxrPRrIYPgHcih46kvAoYWrwZnX8evPCF3BqjP4Vovd601PvuIxh+SCesC2Q VQtichHZLDyNy4HVftyu8v5M6OvLlYjcNl5D7O9gezeO3ct2op71jjqvQ0rvGhjYYIbZpOXZ+Wru6 QH+iPoZjO9XULQCMl/HAClMqK8lah7vyNIJXCaC714LnXAeNdEA4wAqcg2pfvjdY4M1f6OYKtIr+L nzqSBVRdbZZ3Ep4tlRkFfCigqyrIUHf8pNyF1E8H48jhWckKTbTlrZLQzO96eUeRPaqovci2kG9TI rPRjClslCQDsLQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyU-00059z-Lc; Sat, 04 Dec 2021 15:49:38 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:16 +0100 Message-Id: <20211204204924.15581-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From: Ludovic Courtès * guix/transformations.scm (tuning-compiler) (tuned-package, tunable-package?, package-tuning) (transform-package-tuning): New procedures. (%transformations): Add 'tune'. (%transformation-options): Add "--tune". * tests/transformations.scm ("options->transformation, tune"): New test. * doc/guix.texi (Package Transformation Options): Document '--tune'. --- doc/guix.texi | 54 +++++++++++++++ guix/transformations.scm | 134 ++++++++++++++++++++++++++++++++++++++ tests/transformations.scm | 20 ++++++ 3 files changed, 208 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index a675631b79..e3aca8fd3b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10906,6 +10906,60 @@ available options and a synopsis (these options are not shown in the @table @code +@cindex performance, tuning code +@cindex optimization, of package code +@cindex tuning, of package code +@cindex SIMD support +@cindex tunable packages +@cindex package multi-versioning +@item --tune[=@var{cpu}] +Use versions of the packages marked as ``tunable'' optimized for +@var{cpu}. When @var{cpu} is @code{native}, or when it is omitted, tune +for the CPU on which the @command{guix} command is running. + +Valid @var{cpu} names are those recognized by GCC, the GNU Compiler +Collection. On x86_64 processors, this includes CPU names such as +@code{nehalem}, @code{haswell}, and @code{skylake} (@pxref{x86 Options, +@code{-march},, gcc, Using the GNU Compiler Collection (GCC)}). + +As new generations of CPUs come out, they augment the standard +instruction set architecture (ISA) with additional instructions, in +particular instructions for single-instruction/multiple-data (SIMD) +parallel processing. For example, while Core2 and Skylake CPUs both +implement the x86_64 ISA, only the latter supports AVX2 SIMD +instructions. + +The primary gain one can expect from @option{--tune} is for programs +that can make use of those SIMD capabilities @emph{and} that do not +already have a mechanism to select the right optimized code at run time. +Packages that have the @code{tunable?} property set are considered +@dfn{tunable packages} by the @option{--tune} option; a package +definition with the property set looks like this: + +@lisp +(package + (name "hello-simd") + ;; ... + + ;; This package may benefit from SIMD extensions so + ;; mark it as "tunable". + (properties '((tunable? . #t)))) +@end lisp + +Other packages are not considered tunable. This allows Guix to use +generic binaries in the cases where tuning for a specific CPU is +unlikely to provide any gain. + +Tuned packages are @emph{grafted} onto packages that depend on them +(@pxref{Security Updates, grafts}). Thus, using @option{--no-grafts} +annihilates the effect of @option{--tune}. + +We call this technique @dfn{package multi-versioning}: several variants +of tunable packages may be built, one for each CPU variant. It is the +coarse-grain counterpart of @dfn{function multi-versioning} as +implemented by the GNU tool chain (@pxref{Function Multiversioning,,, +gcc, Using the GNU Compiler Collection (GCC)}). + @item --with-source=@var{source} @itemx --with-source=@var{package}=@var{source} @itemx --with-source=@var{package}@@@var{version}=@var{source} diff --git a/guix/transformations.scm b/guix/transformations.scm index 5ae1977cb2..3be02179ef 100644 --- a/guix/transformations.scm +++ b/guix/transformations.scm @@ -29,6 +29,7 @@ (define-module (guix transformations) #:autoload (guix upstream) (package-latest-release upstream-source-version upstream-source-signature-urls) + #:autoload (guix cpu) (current-cpu cpu->gcc-architecture) #:use-module (guix utils) #:use-module (guix memoization) #:use-module (guix gexp) @@ -49,6 +50,9 @@ (define-module (guix transformations) #:export (options->transformation manifest-entry-with-transformations + tunable-package? + tuned-package + show-transformation-options-help %transformation-options)) @@ -419,6 +423,120 @@ (define replacements obj) obj))) +(define tuning-compiler + (mlambda (micro-architecture) + "Return a compiler wrapper that passes '-march=MICRO-ARCHITECTURE' to the +actual compiler." + (define wrapper + #~(begin + (use-modules (ice-9 match)) + + (define* (search-next command + #:optional + (path (string-split (getenv "PATH") + #\:))) + ;; Search the next COMMAND on PATH, a list of + ;; directories representing the executable search path. + (define this + (stat (car (command-line)))) + + (let loop ((path path)) + (match path + (() + (match command + ("cc" (search-next "gcc")) + (_ #f))) + ((directory rest ...) + (let* ((file (string-append + directory "/" command)) + (st (stat file #f))) + (if (and st (not (equal? this st))) + file + (loop rest))))))) + + (match (command-line) + ((command arguments ...) + (match (search-next (basename command)) + (#f (exit 127)) + (next + (apply execl next + (append (cons next arguments) + (list (string-append "-march=" + #$micro-architecture)))))))))) + + (define program + (program-file (string-append "tuning-compiler-wrapper-" micro-architecture) + wrapper)) + + (computed-file (string-append "tuning-compiler-" micro-architecture) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (define bin (string-append #$output "/bin")) + (mkdir-p bin) + + (for-each (lambda (program) + (symlink #$program + (string-append bin "/" program))) + '("cc" "gcc" "clang" "g++" "c++" "clang++"))))))) + +(define (tuned-package p micro-architecture) + "Return package P tuned for MICRO-ARCHITECTURE." + (define compiler + (tuning-compiler micro-architecture)) + + (package + (inherit p) + (native-inputs + ;; Arrange so that COMPILER comes first in $PATH. + `(("tuning-compiler" ,compiler) + ,@(package-native-inputs p))) + (arguments + (substitute-keyword-arguments (package-arguments p) + ((#:tests? _ #f) #f))) + (properties + `((cpu-tuning . ,micro-architecture) + ,@(package-properties p))))) + +(define (tunable-package? package) + "Return true if package PACKAGE is \"tunable\"--i.e., if tuning it for the +host CPU is worthwhile." + (assq 'tunable? (package-properties package))) + +(define package-tuning + (mlambda (micro-architecture) + "Return a procedure that maps the given package to its counterpart tuned +for MICRO-ARCHITECTURE, a string suitable for GCC's '-march'." + (define rewriting-property + (gensym " package-tuning")) + + (package-mapping (lambda (p) + (cond ((assq rewriting-property (package-properties p)) + p) + ((assq 'tunable? (package-properties p)) + (package/inherit p + (replacement (tuned-package p micro-architecture)) + (properties `((,rewriting-property . #t) + ,@(package-properties p))))) + (else + p))) + (lambda (p) + (assq rewriting-property (package-properties p))) + #:deep? #t))) + +(define (transform-package-tuning micro-architectures) + "Return a procedure that, when " + (match micro-architectures + ((micro-architecture _ ...) + (info (G_ "tuning for CPU micro-architecture ~a~%") + micro-architecture) + (let ((rewrite (package-tuning micro-architecture))) + (lambda (obj) + (if (package? obj) + (rewrite obj) + obj)))))) + (define (transform-package-with-debug-info specs) "Return a procedure that, when passed a package, set its 'replacement' field to the same package but with #:strip-binaries? #f in its 'arguments' field." @@ -601,6 +719,7 @@ (define %transformations (with-commit . ,transform-package-source-commit) (with-git-url . ,transform-package-source-git-url) (with-c-toolchain . ,transform-package-toolchain) + (tune . ,transform-package-tuning) (with-debug-info . ,transform-package-with-debug-info) (without-tests . ,transform-package-tests) (with-patch . ,transform-package-patches) @@ -640,6 +759,21 @@ (define %transformation-options (parser 'with-git-url)) (option '("with-c-toolchain") #t #f (parser 'with-c-toolchain)) + (option '("tune") #f #t + (lambda (opt name arg result . rest) + (define micro-architecture + (match arg + ((or #f "native") + (cpu->gcc-architecture (current-cpu))) + ("generic" #f) + (_ arg))) + + (apply values + (if micro-architecture + (alist-cons 'tune micro-architecture + result) + (alist-delete 'tune result)) + rest))) (option '("with-debug-info") #t #f (parser 'with-debug-info)) (option '("without-tests") #t #f diff --git a/tests/transformations.scm b/tests/transformations.scm index 09839dc1c5..760b523e6e 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm @@ -465,6 +465,26 @@ (define (package-name* obj) `((with-latest . "foo"))))) (package-version (t p))))) +(test-equal "options->transformation, tune" + '(cpu-tuning . "superfast") + (let* ((p0 (dummy-package "p0")) + (p1 (dummy-package "p1" + (inputs `(("p0" ,p0))) + (properties '((tunable? . #t))))) + (p2 (dummy-package "p2" + (inputs `(("p1" ,p1))))) + (t (options->transformation '((tune . "superfast")))) + (p3 (t p2))) + (and (not (package-replacement p3)) + (match (package-inputs p3) + ((("p1" tuned)) + (match (package-inputs tuned) + ((("p0" p0)) + (and (not (package-replacement p0)) + (assq 'cpu-tuning + (package-properties + (package-replacement tuned))))))))))) + (test-equal "options->transformation + package->manifest-entry" '((transformations . ((without-tests . "foo")))) (let* ((p (dummy-package "foo")) From patchwork Sat Dec 4 20:49:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34958 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9D11E27BBEA; Sat, 4 Dec 2021 20:50:15 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A320E27BBE9 for ; Sat, 4 Dec 2021 20:50:14 +0000 (GMT) Received: from localhost ([::1]:37180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbz3-0005s8-MA for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 15:50:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbys-0005rh-Oe for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbys-0001ji-Gk for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbys-0003bu-GE for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 03/10] ci: Add extra jobs for tunable packages. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865098813775 (code B ref 52283); Sat, 04 Dec 2021 20:50:02 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:48 +0000 Received: from localhost ([127.0.0.1]:55207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyd-0003a6-M4 for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbya-0003Z7-LR for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:44 -0500 Received: from [2001:470:142:3::e] (port=45330 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyV-0001gG-C9; Sat, 04 Dec 2021 15:49:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=GmYZGhsNWuuYJ92529+5w06qr4Nz6NLSf1JI/E3T04g=; b=Klhukl3dQ/nOJKgaXa9k ZBSE3yCI2EWtuIDxqUO1LNZwFuE/DtWUXFmtmq42gV2UMZbz+McKq0OFlSMPF/SQKA4LkUEKafPG4 PnNHfvZZVgReHyX32k22uUQK7GOvPd58ugK7liaO6PvFPsZnG98yzwT8naxYv0ciRTl94ZOm/p0DG lGvj+gYYzUkqmrOR+PfYSmjvk25auic2Xec9VhaO17z+i1wDEtvfo+E1Hcodg2unlsf8/LFlbWsiU XVLD0sSiT2INiET5vRz2QW4kArN6eZtanuQR2OIbDOk75de/pLeH9olPsJk3a7OGj8gm+AcqCbgpX lc/eqfqOZBosEQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyV-00059z-8i; Sat, 04 Dec 2021 15:49:39 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:17 +0100 Message-Id: <20211204204924.15581-3-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This allows us to provide substitutes for tuned package variants. * gnu/ci.scm (package-job): Add #:suffix and honor it. (package->job): Add #:suffix and honor it. (%x86-64-micro-architectures): New variable. (tuned-package-jobs): New procedure. (cuirass-jobs): Add jobs for tunable packages. --- gnu/ci.scm | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/gnu/ci.scm b/gnu/ci.scm index e1011355db..2f56554d93 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -28,6 +28,7 @@ (define-module (gnu ci) #:use-module (guix grafts) #:use-module (guix profiles) #:use-module (guix packages) + #:autoload (guix transformations) (tunable-package? tuned-package) #:use-module (guix channels) #:use-module (guix config) #:use-module (guix derivations) @@ -108,9 +109,9 @@ (define* (derivation->job name drv (#:timeout . ,timeout))) (define* (package-job store job-name package system - #:key cross? target) + #:key cross? target (suffix "")) "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." - (let ((job-name (string-append job-name "." system))) + (let ((job-name (string-append job-name "." system suffix))) (parameterize ((%graft? #f)) (let* ((drv (if cross? (package-cross-derivation store package target system @@ -395,21 +396,39 @@ (define package->job (((_ inputs _ ...) ...) inputs)))) (%final-inputs))))) - (lambda (store package system) + (lambda* (store package system #:key (suffix "")) "Return a job for PACKAGE on SYSTEM, or #f if this combination is not -valid." +valid. Append SUFFIX to the job name." (cond ((member package base-packages) (package-job store (string-append "base." (job-name package)) - package system)) + package system #:suffix suffix)) ((supported-package? package system) (let ((drv (package-derivation store package system #:graft? #f))) (and (substitutable-derivation? drv) (package-job store (job-name package) - package system)))) + package system #:suffix suffix)))) (else #f))))) +(define %x86-64-micro-architectures + ;; Micro-architectures for which we build tuned variants. + '("westmere" "ivybridge" "haswell" "skylake" "skylake-avx512")) + +(define (tuned-package-jobs store package system) + "Return a list of jobs for PACKAGE tuned for SYSTEM's micro-architectures." + (filter-map (lambda (micro-architecture) + (define suffix + (string-append "." micro-architecture)) + + (package->job store + (tuned-package package micro-architecture) + system + #:suffix suffix)) + (match system + ("x86_64-linux" %x86-64-micro-architectures) + (_ '())))) + (define (all-packages) "Return the list of packages to build." (define (adjust package result) @@ -527,10 +546,16 @@ (define source ('all ;; Build everything, including replacements. (let ((all (all-packages)) - (job (lambda (package) - (package->job store package system)))) + (jobs (lambda (package) + (match (package->job store package system) + (#f '()) + (main-job + (cons main-job + (if (tunable-package? package) + (tuned-package-jobs store package system) + '()))))))) (append - (filter-map job all) + (append-map jobs all) (cross-jobs store system)))) ('core ;; Build core packages only. From patchwork Sat Dec 4 20:49:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34960 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 15E3927BBEB; Sat, 4 Dec 2021 20:50:17 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A0FD327BBE9 for ; Sat, 4 Dec 2021 20:50:16 +0000 (GMT) Received: from localhost ([::1]:37256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbz5-0005vx-Oo for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 15:50:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyt-0005rx-JL for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43686) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyt-0001kW-CA for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbyt-0003c9-AU for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 04/10] gnu: Add eigen-benchmarks. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865098913803 (code B ref 52283); Sat, 04 Dec 2021 20:50:03 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:49 +0000 Received: from localhost ([127.0.0.1]:55215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyf-0003aN-8R for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyb-0003ZA-Iz for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:46 -0500 Received: from [2001:470:142:3::e] (port=45332 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyW-0001gX-3w; Sat, 04 Dec 2021 15:49:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=X/ZJYht+4CvFHJtV7V5izuiSVqty+Cp0DFWe/TBVgl4=; b=G7EZ3I+jTYa1mTBOTvzf 7vuVu6h1EM1GqV8R4tpuyYqhjCTxwkkvQMUx3uUePnKbvYKgUIX1krFD5+AKiXeHf8bT0vpBIvlcB 5qhYsbl9XIsG1vg9mp9lDRIaPAXIrmj0LK+ZCC+cHWPbbf/U4eqtDMMaafPZ6h4gHfDoOCNe8O2ek 63IVoTGPBnpfQIMKS4YFhDzPvLO87jj3TaYAAThSvRHik6bOoZ9z2gKlOr5uoVlYYdp3293WEQH84 P7I9cUkm9BULq2l9N5nbeFH0AKwwOBSscWKep81R9DoJyGybDOe1VPooJgHcpYV0ei9yeGxKACWZv ph2jZ6qxAxSYZQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyV-00059z-Ro; Sat, 04 Dec 2021 15:49:40 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:18 +0100 Message-Id: <20211204204924.15581-4-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/algebra.scm (eigen-benchmarks): New variable. --- gnu/packages/algebra.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index b704d98dde..a782f8b1be 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1074,6 +1074,45 @@ (define-public eigen ;; See 'COPYING.README' for details. (license license:mpl2.0))) +(define-public eigen-benchmarks + (package + (inherit eigen) + (name "eigen-benchmarks") + (arguments + '(#:phases (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (define (compile file) + (format #t "compiling '~a'...~%" file) + (let ((target + (string-append bin "/" + (basename file ".cpp")))) + (invoke "g++" "-o" target file + "-I" ".." "-O2" "-g" + "-lopenblas" "-Wl,--as-needed"))) + + (mkdir-p bin) + (with-directory-excursion "bench" + ;; There are more benchmarks, of varying quality. + ;; Here we pick some that appear to be useful. + (for-each compile + '("benchBlasGemm.cpp" + "benchCholesky.cpp" + ;;"benchEigenSolver.cpp" + "benchFFT.cpp" + "benchmark-blocking-sizes.cpp")))))) + (delete 'install)))) + (inputs `(("boost" ,boost) + ("openblas" ,openblas))) + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties '((tunable? . #t))) + + (synopsis "Micro-benchmarks of the Eigen linear algebra library"))) + (define-public eigen-for-tensorflow (let ((changeset "fd6845384b86") (revision "1")) From patchwork Sat Dec 4 20:49:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 36161 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 27D3327BBE9; Sat, 4 Dec 2021 20:50:17 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AEC3527BBEA for ; Sat, 4 Dec 2021 20:50:16 +0000 (GMT) Received: from localhost ([::1]:37272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbz5-0005wX-R3 for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 15:50:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyu-0005sA-0G for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43687) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyt-0001kf-PA for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbyt-0003cH-Oe for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 05/10] gnu: Add xsimd-benchmark. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099013816 (code B ref 52283); Sat, 04 Dec 2021 20:50:03 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:50 +0000 Received: from localhost ([127.0.0.1]:55219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyf-0003aW-LT for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyc-0003ZB-1c for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:46 -0500 Received: from [2001:470:142:3::e] (port=45336 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyW-0001go-Oe; Sat, 04 Dec 2021 15:49:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=L3Q7XV2ow/EDdYqJDS5VDoUsXc0iA/5raHatmkAb2V8=; b=OA3J19Vtp2PBFAQ3nFiI w+aF5/msGKkuFD7FcI0MKxSfxVbwvWHPoDCe/KOHZZGuqQRHQgkqtRS/S73EcQVypi+JVQMBm+EB2 /Zq09wdFLSmB0O3u7KpwZsw3tR8KjcJrMywZU8dH6Isb/9YW7mHwrRoBfRkYRonRVsuAu1IAMjslo Z4SS9XsMh5Vfi/rAEV0hDM7cZyLnFiHlxFBZrbES7tl/Jow26/zbvzjGXvgPvPuD6JtT2892ipotG 3+/JZuw7O3B0bF70DUKG5Tj2vczaobW0HxUB2dvNhxOtR4TPg9ZMy1EffLbTy248pJWGbZnpHTOCJ ne4WSzYTjXldOg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyW-00059z-Es; Sat, 04 Dec 2021 15:49:40 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:19 +0100 Message-Id: <20211204204924.15581-5-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/cpp.scm (xsmimd-benchmark): New variable. --- gnu/packages/cpp.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index e2f2279418..0bf65ed364 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -300,6 +300,29 @@ (define-public xsimd operating on batches.") (license license:bsd-3))) +(define-public xsmimd-benchmark + (package + (inherit xsimd) + (name "xsimd-benchmark") + (arguments + `(#:configure-flags (list "-DBUILD_BENCHMARK=ON") + #:tests? #f + #:phases (modify-phases %standard-phases + (add-after 'unpack 'remove-march=native + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("-march=native") "")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Install nothing but the executable. + (let ((out (assoc-ref outputs "out"))) + (install-file "benchmark/benchmark_xsimd" + (string-append out "/bin")))))))) + (synopsis "Benchmark of the xsimd library") + + ;; Mark as tunable to take advantage of SIMD code in xsimd/xtensor. + (properties '((tunable? . #t))))) + (define-public chaiscript (package (name "chaiscript") From patchwork Sat Dec 4 20:49:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34962 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8971B27BBEA; Sat, 4 Dec 2021 20:50:26 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 47A5D27BBE9 for ; Sat, 4 Dec 2021 20:50:26 +0000 (GMT) Received: from localhost ([::1]:38076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbzF-0006VY-EY for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 15:50:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyu-0005tD-Ea for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyu-0001kr-5j for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbyu-0003cO-53 for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 06/10] gnu: Add xtensor-benchmark. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099013822 (code B ref 52283); Sat, 04 Dec 2021 20:50:04 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:50 +0000 Received: from localhost ([127.0.0.1]:55221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyg-0003an-6B for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyc-0003ZD-Ka for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:46 -0500 Received: from [2001:470:142:3::e] (port=45338 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyX-0001gw-Bg; Sat, 04 Dec 2021 15:49:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=BArU7FarHvTt8z9d36WkNG880pTmzDUSFK3bGEdv4qc=; b=nX9GIQ+U5TRHTL2km1SM mTQncdTyGTRnqOfXZf97CFmQzYmXpCBvhSoiDgv7wVVLdzIyEpy+Zyjms0M8AhCpO/1OE0MBcHL6b mN255j4iC6m104O035MVwPiu8xYDZOx1WpgSpIm9eBlNMAmKlj0Wr0UiUhyRIuXlGXxJ1i8dCrihC 265RuOPr8TIl207ZqZzWDXXrtguwt9y1eptkJnUOaX/ueRIt4MMziNhcJIn4ihma6bYQLJ1ypx9VF JYsileFBd2rJRXFH2J+D4xh8jdAUcYQRBVPaAR/IgCtve7bc+d6ZEZ+z+nyNzmeSb3prCXSwfQJ2r ExHBw3g0xRhEag==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyX-00059z-8Z; Sat, 04 Dec 2021 15:49:41 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:20 +0100 Message-Id: <20211204204924.15581-6-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/algebra.scm (xtensor-benchmark): New variable. --- gnu/packages/algebra.scm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index a782f8b1be..4e3f8298a2 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1200,6 +1200,46 @@ (define-public xtensor @end itemize") (license license:bsd-3))) +(define-public xtensor-benchmark + (package + (inherit xtensor) + (name "xtensor-benchmark") + (arguments + `(#:configure-flags (list "-DBUILD_BENCHMARK=ON" + "-DDOWNLOAD_GBENCHMARK=OFF") + #:tests? #f + #:phases (modify-phases %standard-phases + (add-after 'unpack 'remove-march=native + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("-march=native") "")))) + (add-after 'unpack 'link-with-googlebenchmark + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("find_package\\(benchmark.*" all) + (string-append + all "\n" + "set(GBENCHMARK_LIBRARIES benchmark)\n"))))) + (replace 'build + (lambda _ + (invoke "make" "benchmark_xtensor" "-j" + (number->string (parallel-job-count))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Install nothing but the executable. + (let ((out (assoc-ref outputs "out"))) + (install-file "benchmark/benchmark_xtensor" + (string-append out "/bin")))))))) + (synopsis "Benchmarks of the xtensor library") + (native-inputs '()) + (inputs + `(("googlebenchmark" ,googlebenchmark) + ("xsimd" ,xsimd) + ,@(package-native-inputs xtensor))) + + ;; Mark as tunable to take advantage of SIMD code in xsimd/xtensor. + (properties '((tunable? . #t))))) + (define-public gap (package (name "gap") From patchwork Sat Dec 4 20:49:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34964 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 631AD27BBEA; Sat, 4 Dec 2021 20:50:52 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 33D5427BBE9 for ; Sat, 4 Dec 2021 20:50:52 +0000 (GMT) Received: from localhost ([::1]:38582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbzf-0006qN-Bj for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 15:50:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyu-0005ug-T9 for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyu-0001l2-JS for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbyu-0003cV-I2 for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 07/10] gnu: ceres-solver: Mark as tunable. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099213833 (code B ref 52283); Sat, 04 Dec 2021 20:50:04 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:52 +0000 Received: from localhost ([127.0.0.1]:55223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyi-0003b2-HC for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyd-0003ZE-7w for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:47 -0500 Received: from [2001:470:142:3::e] (port=45340 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyX-0001h7-VL; Sat, 04 Dec 2021 15:49:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=++qwO9LU8Jph5gM2u47IkibAfhLiOYoSA9nm1rTkGUs=; b=eTPjA4j3Dsju/K5326+H 5MRLnGNOC8kiTgcHHLzkJa8kkXOSP5ATvA/bJGmCmkbbXjxXWvJov2OZfzq8JdldFftDex9JZ2y/k v+XD+LFEZURb7n7HODfFJIf/UxRPJNOrkdQCoGrJ47w5p/iQmSgF19uCcIr+1vhldW4hsMUxTj5b8 Qy04eTPQcf0UPgVdZvS2biiBx+LxLf8BwomGIUTMlBxUE255GlmP2zgpQUX2GggLwTNbCFUt55Jl7 o5zr/UzS7wF+mVfwLso8IkN4gMkWPh4H7nxphzqTpjSvK+uZ2Jo24LPVuduT13Km5WRqQT5CBURlO J04ZT3GN54Kdsg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyX-00059z-Rp; Sat, 04 Dec 2021 15:49:42 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:21 +0100 Message-Id: <20211204204924.15581-7-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/maths.scm (ceres)[properties]: New field. --- gnu/packages/maths.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 83f31c1396..19dab598c6 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2396,7 +2396,10 @@ (define-public ceres @item non-linear least squares problems with bounds constraints; @item general unconstrained optimization problems. @end enumerate\n") - (license license:bsd-3))) + (license license:bsd-3) + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties `((tunable? . #t))))) ;; For a fully featured Octave, users are strongly recommended also to install ;; the following packages: less, ghostscript, gnuplot. From patchwork Sat Dec 4 20:49:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34965 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A555727BBEA; Sat, 4 Dec 2021 20:50:53 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6316427BBE9 for ; Sat, 4 Dec 2021 20:50:53 +0000 (GMT) Received: from localhost ([::1]:38720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbzg-0006xC-IY for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 15:50:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyv-0005vj-9V for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyu-0001lC-W7 for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbyu-0003cd-Ub for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 08/10] gnu: Add ceres-solver-benchmarks. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099313840 (code B ref 52283); Sat, 04 Dec 2021 20:50:04 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:53 +0000 Received: from localhost ([127.0.0.1]:55225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyi-0003b4-OE for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyd-0003ZG-SX for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:48 -0500 Received: from [2001:470:142:3::e] (port=45348 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyY-0001hZ-J4; Sat, 04 Dec 2021 15:49:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=x5ZSt0wehn96SrZtXhYGFsauGAHgWBl6QHdHJN/P6Og=; b=Pl9KpyZ83CtncWI/GvH8 +tJzvV++961Eu/a6ZeVTqdwyZsIperyMYEZey8C+XkYQE46KvGp5qgIHhEoyrU2FDOyAtzzlo6l+Q cDqZJybn05K9aX5gFbsjjs+wbik4KHhAuhFJQpBoXMhg3fhq5Q52TPfAu16ONcQkLqYQcPhX60S+v UBekvK8En8/n7hC1gpPmoeSmXeQpoMTb4nMLVQ93ruLE+j1sy3kcVX58feeIxFopKoQHbNqZBxtyw 6QKyOh5SqjO7TE4T59+Kxz6P4KeT3i/GSR/6tvWMvZsLnDjc5wJ/R3X4UP/iZw9sFymfRwlQIItER ccXF6u7Qa026DQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyY-00059z-Ey; Sat, 04 Dec 2021 15:49:42 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:22 +0100 Message-Id: <20211204204924.15581-8-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/maths.scm (ceres-solver-benchmarks): New variable. --- gnu/packages/maths.scm | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 19dab598c6..06bdb8ed92 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2401,6 +2401,50 @@ (define-public ceres ;; Mark as tunable to take advantage of SIMD code in Eigen. (properties `((tunable? . #t))))) +(define-public ceres-solver-benchmarks + (package + (inherit ceres) + (name "ceres-solver-benchmarks") + (arguments + '(#:modules ((ice-9 popen) + (ice-9 rdelim) + (guix build utils) + (guix build cmake-build-system)) + + #:phases (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (define flags + (string-tokenize + (read-line (open-pipe* OPEN_READ + "pkg-config" "eigen3" + "--cflags")))) + + (define (compile-file file) + (let ((source (string-append file ".cc"))) + (format #t "building '~a'...~%" file) + (apply invoke "c++" "-fopenmp" "-O2" "-g" "-DNDEBUG" + source "-lceres" "-lbenchmark" "-lglog" + "-pthread" + "-o" (string-append bin "/" file) + "-I" ".." flags))) + + (mkdir-p bin) + (with-directory-excursion "internal/ceres" + (for-each compile-file + '("small_blas_gemm_benchmark" + "small_blas_gemv_benchmark" + "autodiff_cost_function_benchmark")))))) + (delete 'check) + (delete 'install)))) + (inputs `(("googlebenchmark" ,googlebenchmark) + ("ceres-solver" ,ceres) + ,@(package-inputs ceres))) + (synopsis "Benchmarks of the Ceres optimization problem solver"))) + ;; For a fully featured Octave, users are strongly recommended also to install ;; the following packages: less, ghostscript, gnuplot. (define-public octave-cli From patchwork Sat Dec 4 20:49:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34966 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DCAAF27BBEA; Sat, 4 Dec 2021 20:50:59 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 78C6027BBE9 for ; Sat, 4 Dec 2021 20:50:59 +0000 (GMT) Received: from localhost ([::1]:39172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbzm-0007Lu-Lw for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 15:50:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyv-0005wg-NR for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyv-0001lR-EY for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbyv-0003cm-Db for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 09/10] gnu: libfive: Mark as tunable. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099313847 (code B ref 52283); Sat, 04 Dec 2021 20:50:05 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:53 +0000 Received: from localhost ([127.0.0.1]:55227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyj-0003bB-3j for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbye-0003ZH-QE for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:49 -0500 Received: from [2001:470:142:3::e] (port=45356 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyZ-0001hx-HO; Sat, 04 Dec 2021 15:49:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=RwkTY8ImACv9sK21TyShP51HC9of7i2itQwlvyZ2Ljw=; b=q6v+vLdBuqi+TbTnE8yA QhTJVKIvtt5J1FT1HfKrEU/ee9PI5j5/jGKAtX4UlKwpigdPuAAgsQcEIkGDGkoor+1MwMZhaaLWG TCDHUXicD+KguDpkbFMCM1GYgCeBNhBkv7SBQyXrFAlGWZEO6DgMVOHAjmGq/MARlFSer56JwdUU6 /dtnCpEQCTrDj3TFWz95vakR6kmrJHR5BF8Tx6EZ0hM4AwvnGZSHJw2el7QHWZN5Nj0w7jfI73by+ OvXhsDDBRA//1ubyFWYr39B8ZUKcVRqXjYimiYMefKCKRy5R6SlXlCtVvN0PI+UZvdV61dyw/ueXD W6q0qumWpry8dQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyZ-00059z-2V; Sat, 04 Dec 2021 15:49:43 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:23 +0100 Message-Id: <20211204204924.15581-9-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/engineering.scm (libfive)[properties]: New field. --- gnu/packages/engineering.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 50f265f085..4a749f5ecf 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -837,7 +837,10 @@ (define-public libfive Even fundamental, primitive shapes are represented as code in the user-level language.") (license (list license:mpl2.0 ;library - license:gpl2+))))) ;Guile bindings and GUI + license:gpl2+)) ;Guile bindings and GUI + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties '((tunable? . #t)))))) (define-public inspekt3d (let ((commit "703f52ccbfedad2bf5240bf8183d1b573c9d54ef") From patchwork Sat Dec 4 20:49:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34963 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 769E427BBEA; Sat, 4 Dec 2021 20:50:27 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4083327BBE9 for ; Sat, 4 Dec 2021 20:50:27 +0000 (GMT) Received: from localhost ([::1]:38164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbzG-0006Z4-Cj for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 15:50:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyw-0005wx-3F for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyv-0001le-Qp for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbyv-0003ct-Q9 for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 10/10] gnu: prusa-slicer: Mark as tunable. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099313853 (code B ref 52283); Sat, 04 Dec 2021 20:50:05 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:53 +0000 Received: from localhost ([127.0.0.1]:55229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyj-0003bI-Cf for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyf-0003ZO-DD for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:49 -0500 Received: from [2001:470:142:3::e] (port=45358 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbya-0001i4-4B; Sat, 04 Dec 2021 15:49:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=vTJXuB2My8mB6WcLdDFOt66kigdeyyXjkjkowCwvIkg=; b=JgGeXqRHz951/OFilocs MsJbe0qJVZMW8G24FOIaG5d9gMQCvgjZ+3uW44LuaadzSkxbdrE0xVIQptz0d6O3zyq2ltBcd9pVQ AUnvxG5Xh5YY6b1ORiZxWiKDFtaeAmaolEfUpKizcXWXKtY9Fgz3gKf8yThse4fHcZPRDPC+Xqbnl VnYCzgs+Vr17NaDRK7kGM5J+6yuJrh9E0e4CQCyBlfD/fUuDRWUUFS5Kn524kcPusxxbmqNyyMMyE 5qyTeoGkOBKHNiFSmrhBUU5kweZbjyQ4NKNrhhYi3UjOkfEAHFUBVt/PhrkMgMr30S6xjXLdJo3qk B8VxuDHq3/YItQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbya-00059z-0w; Sat, 04 Dec 2021 15:49:44 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:24 +0100 Message-Id: <20211204204924.15581-10-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/engineering.scm (prusa-slicer)[properties]: New field. --- gnu/packages/engineering.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 4a749f5ecf..7e8c042653 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -3070,4 +3070,7 @@ (define-public prusa-slicer (synopsis "G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)") (description "PrusaSlicer takes 3D models (STL, OBJ, AMF) and converts them into G-code instructions for FFF printers or PNG layers for mSLA 3D printers.") - (license license:agpl3))) + (license license:agpl3) + + ;; Mark as tunable to take advantage of SIMD code in Eigen and in libigl. + (properties '((tunable? . #t)))))