From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 12 14:55:44 2022 Received: (at 48463) by debbugs.gnu.org; 12 Jan 2022 19:55:44 +0000 Received: from localhost ([127.0.0.1]:59209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7jii-0004kO-6R for submit@debbugs.gnu.org; Wed, 12 Jan 2022 14:55:44 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7jiT-0004js-7m for 48463@debbugs.gnu.org; Wed, 12 Jan 2022 14:55:43 -0500 Received: by mail-wr1-f68.google.com with SMTP id l25so6137265wrb.13 for <48463@debbugs.gnu.org>; Wed, 12 Jan 2022 11:55:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=K2uyHQFk9rnYfWcXZUJEEcbOofOKCQuQkFR4e5KTCi0=; b=WKAVhb9vuzm7QkMC9WTtXxGoPFON2Fo/jReDk+JV1oz4Xg2NL6vXpdLSh3BkVv2f+n 050nANBa7VX1BwdfZa+Utb9pqbxD958oblQl9Ef3Lkhh0zmq2woal48S9xNjRmqfkNDL GV8Cp03RXWj6P5PpVg0ZBA3Y2u0+EZgcJmkhp7cGsvr9raqSBzFo9AuEJPbJLUVGO7VX Jp7ZqPAZ5k8EaWSN59DpiDWmurwkBeVIotaJd7l0JStBVPVph0bTJRZjkBikUivm5Q31 iiFbsVAHd0z5dNOlTKZT6ZUeADJficjkQ6aYzPq5Tnv3ENAMimGP11zKcStFNjXGxEc6 B2sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=K2uyHQFk9rnYfWcXZUJEEcbOofOKCQuQkFR4e5KTCi0=; b=eelp4pW2qvQulGbQxSDfvEHCAt8y94KYqu+A0xhWc8AocPt6o4GQ/uSK0Csj1Q9oTZ l3SKyzXDElWK4aJc5Xg4/Y8XBgJocKhMWxjUXd8IxjTOQH9UwpXb90xbjTHl5CZIJajv GJlPkh7600SGVXvk0LbaUWfUdkpJLku8o1tRiQD3QGy7C9mJjfcbfU0/PDyIaJCfNwpy RZVwc3oxHA0Z2LqtC2dpHLU0YIegFd+6ZHnQBoo0fCWW0zqkVqoxmYKzTrTxhAnoEqyw HMMOnDg6inAU91ngzI/0+ORLyuECVQ+HqGMZ06DhMBeSyx9kv6HXNb+p3oqTjcZnNeIf 7VYA== X-Gm-Message-State: AOAM533adiHW0U1YgVEK78YF5uP0O1FFS8Pscm+czhKDGbr0QafZ7/c8 GYXgqXF0qPPvSc5Ik+Rg5kM= X-Google-Smtp-Source: ABdhPJyLQjFhXsHwe/jZXmPDtXQsRwQIpao5EsiAha3nZPOd7heHC1ZYLTEirj5N1CaUY6i7aKndMQ== X-Received: by 2002:a5d:690c:: with SMTP id t12mr1144270wru.536.1642017323089; Wed, 12 Jan 2022 11:55:23 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id z5sm5035975wmf.25.2022.01.12.11.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 11:55:22 -0800 (PST) Message-ID: <72aff035c93f9f91afa54ef5b51c7381b0b02ccb.camel@gmail.com> Subject: Re: [bug#48463] gnu: Add j. From: Liliana Marie Prikler To: elaexuotee@wilsonb.com, Maxime Devos Date: Wed, 12 Jan 2022 20:55:21 +0100 In-Reply-To: <2P322C327XW0Q.21O5A4IFGMNDI@wilsonb.com> References: <3LOAUDT0FLL4U.2SOD925YP915T@wilsonb.com> <8b853d0585505ce29c9afc638b644fa34805e6c0.camel@student.tugraz.at> <293L8YPQS4CLB.3VK1B1A36XNAY@wilsonb.com> <5d30160bd2a4592459cd407f99cbd3edadb1db1b.camel@student.tugraz.at> <27DCD25Y68ZWJ.2HRC4G65PWIA7@wilsonb.com> <94f4625dcb0479d873cf60449631527e841fd457.camel@gmail.com> <2JQJMV0O718S1.31FZE8GKCTLPF@wilsonb.com> <90704c2259f576a14fb1268219e8c0dc2b3bf289.camel@telenet.be> <2P322C327XW0Q.21O5A4IFGMNDI@wilsonb.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48463 Cc: 48463@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, > +(define-module (gnu packages jsoftware) > + #:use-module ((guix build utils)) > + [...] Double bracketing is pointless, use it only when needed. > +(define* (make-j #:key > + (builder "guix.gnu.org") > + vername > + revision > + hash > + (type 'release) > + commit > + (patches '()) > + (extra-inputs '()) > + (extra-envars '())) > + (package > + (name (jname "jsoftware-j" type)) > + (version (jversion->string vername revision)) > + (source > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/jsoftware/jsource") > + (commit (or commit (jinfo->git-tag vername type > revision)))) Vername sounds a little weird, make that version-base or something clearer. Also, the argument #:commit is used in an unclear fashion -- if you were to pass an actual commit hash to it, it'd still be treated as a release and not be using git-version. On a related note > +(define (jversion->string version revision) > + "Return a string representation of a J version and (optional) > revision pair." > + (let ((postfix (if (not revision) "" > + (string-append "." revision)))) > + (string-append version postfix))) should also take commit and revision should probably be dashed. In that way, when packaging commits between releases we can use "jrevision.guix-revision" as the complete revision. In short, I'd add a #:tag argument to override the tag and treat commit like a let-bound commit. > + `(#:modules (((ice-9 ftw) #:select (scandir)) > + ((ice-9 popen) #:select (open-pipe* close-pipe)) > + ((ice-9 regex) #:select (match:substring string- > match)) > + ((ice-9 threads) #:select (parallel par-for-each)) > + ((srfi srfi-26) #:select (cut)) > + ((srfi srfi-1) #:select (fold)) > + ,@%gnu-build-system-modules) It's nice that you annotated all those, but note that it probably wouldn't have been needed. If you notice this list getting longer and longer as you update, consider dropping the #:selects. > + (replace 'build > + (lambda _ > + (setenv "USE_OPENMP" "1") > + (setenv "USE_THREAD" "1") > + (for-each (lambda (var-val) (apply setenv var-val)) > + (quote ,extra-envars)) > + ;; The build scripts assume that PWD is make2. > + (with-directory-excursion "make2" > + (let* ((platform ,(if (target-arm?) "raspberry" > "linux")) > + (jplat (string-append "jplatform=" platform)) > + (target-bit ,(if (target-64bit?) "64" "32")) > + (jbit (string-append "j64x=" "j" target-bit)) > + (jbit-avx (string-append jbit "avx")) > + (jbit-avx2 (string-append jbit "avx2"))) > + (parallel > + ;; Since jconsole doesn't depend on AVX features, > we just > + ;; build it once. > + (invoke "env" jplat jbit "./build_jconsole.sh") > + (invoke "env" jplat jbit "./build_libj.sh") > + (if ,(target-64bit?) > + (parallel > + (invoke "env" jplat jbit-avx > "./build_libj.sh") > + (invoke "env" jplat jbit-avx2 > + "./build_libj.sh")))))))) Maxime already made a comment w.r.t. 32bit AVX here, but I think this would be a prime example to use the CPU tuning that was recently landed. Most of the above (except the semantics of the make-j keyword arguments) are not blockers in my opinion. Cheers