From patchwork Thu Dec 16 17:58:25 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: 35289 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 190E927BBEA; Thu, 16 Dec 2021 18:01: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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 C9CC527BBE9 for ; Thu, 16 Dec 2021 18:01:25 +0000 (GMT) Received: from localhost ([::1]:44824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv4G-0001cU-VP for patchwork@mira.cbaines.net; Thu, 16 Dec 2021 13:01:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv2z-0000P7-KW for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv2z-0008En-7l for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv2z-0006op-4x for guix-patches@gnu.org; Thu, 16 Dec 2021 13:00:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 10/12] 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: Thu, 16 Dec 2021 18:00: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.163967757126060 (code B ref 52283); Thu, 16 Dec 2021 18:00:05 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:31 +0000 Received: from localhost ([127.0.0.1]:36712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2Q-0006mA-PW for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1r-0006iQ-RZ for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:56 -0500 Received: from [2001:470:142:3::e] (port=44378 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 1mxv1m-0007ui-IC; Thu, 16 Dec 2021 12:58:50 -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=PNyHqzixGiqZL1t497RfTSgAB8s4ZvZXWuIcVJSLi0s=; b=BaMTjbz9nHHcPd97D4NP Ouen7lOcPBGlqgP58xbTaw8UeY9gSghr6/fCJ6BQSlpBehyB+cvdZQWQfBMBEPRIrtPyfiNfFU+9J XS0yXEnvOy137KpCmGs/5yWj7k9TD/mELPes37696fI9cgpXgMNfq0tr0JMEtWfhb4Kh63am7FMA4 Jc1/FDeJ9t0ZpX1sUkdJfPOe40LhS756OXwqNHKSILLFgJoa1GPKuIs0qCEUETQA3j0Op7yKuPnE6 e4jZXXkQgKTRbL25ixOs8uMPQ0Q7H9CoVDzrNZ+3M4zO+L/IeM52COH9KA05qbacsEz6dGg4/yV6Q hps6y2UrOBH9ng==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 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 1mxv1l-0000YX-7F; Thu, 16 Dec 2021 12:58:50 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:25 +0100 Message-Id: <20211216175827.2077-11-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-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 | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 256b1c4421..7f2994d10b 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2416,6 +2416,49 @@ (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 (modify-inputs (package-inputs ceres) + (prepend googlebenchmark 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