From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id SMCIN3qXlGRbUQEASxT56A (envelope-from ) for ; Thu, 22 Jun 2023 20:48:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id mBehNnqXlGTRBwEAG6o9tA (envelope-from ) for ; Thu, 22 Jun 2023 20:48:26 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 52D7513008 for ; Thu, 22 Jun 2023 20:48:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCPLg-0002cK-TF; Thu, 22 Jun 2023 14:48:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCPLf-0002bJ-5D for bug-guix@gnu.org; Thu, 22 Jun 2023 14:48:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCPLe-0003HX-Sl for bug-guix@gnu.org; Thu, 22 Jun 2023 14:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qCPLe-0008HV-Eb for bug-guix@gnu.org; Thu, 22 Jun 2023 14:48:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63986: Julia is very slow Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 22 Jun 2023 18:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63986 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Efraim Flashner Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 63986@debbugs.gnu.org, Nicolas Graves , csantosb@inventati.org Received: via spool by 63986-submit@debbugs.gnu.org id=B63986.168745968031815 (code B ref 63986); Thu, 22 Jun 2023 18:48:02 +0000 Received: (at 63986) by debbugs.gnu.org; 22 Jun 2023 18:48:00 +0000 Received: from localhost ([127.0.0.1]:36734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCPLb-0008H2-Ly for submit@debbugs.gnu.org; Thu, 22 Jun 2023 14:48:00 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]:39937) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCPLZ-0008GD-Q3 for 63986@debbugs.gnu.org; Thu, 22 Jun 2023 14:47:58 -0400 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3112599fd5cso1864140f8f.0 for <63986@debbugs.gnu.org>; Thu, 22 Jun 2023 11:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687459672; x=1690051672; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=0y2jwc9zoMvk3rZO1kB3N5leeibatl97Uk95S7oUrDA=; b=avU+VIOFvj7NVUfU4m0X7CQgP0X3L3dabmyhzX65/Vbe4oMSkAIX2+XmdSs9/P4RCJ BQX4cTElggqRj1FH2Rxk++TB/Ez83FravC8q2B8sKowlPBbpTGMW1CeYr9X08+Ae0iuG Ab847BctucGTPjI5uxnoMBLTuxcnsF2goCt407kKqxH5q1P51rxqDse5m9R1l4811RNJ Jf0eDqkNn+QGBrgTp8OyGGlt7uG43d5wEfVMKmG1HJD9YqIMfzRHzXHeHXdk/aCPVuk6 PtHmGDQ+42JkrlRc1aCa+p3ded0Ibk9bN5LDHFlAFNksEYNIhbChz7Zt3jwdNVzpeDj6 E/tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687459672; x=1690051672; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0y2jwc9zoMvk3rZO1kB3N5leeibatl97Uk95S7oUrDA=; b=Z1ozi0FKePObB35PmwrdzI2PWoJgDKqpxw+a7tCGy8qlyDCKb3i740IQEzJFP4fZIk c2tC3oYmjW+uuvSzXrKAQhenJP89iE4J0TjBjnDkATCnsVB7qtf9hbk37sKCG8kjWYwW Qa4vDQZghUWOSm0h/xbLNfQieTBy716tncUAKtyjKLqIHiOQFEXqkSBPoHiQ8YxFRN10 1CTBpRLGt9Fi/6C35TkcYvnoxvAUSQ03NyjGOY0ItzaBd3pgJk9Hs1Pi4NNMXltlNhaq jORwF/jTRmU6NGdSuT01WD6SZcqlC61lNth7WRPBwcjzQ7PShyMPNdUxFTVyS6zQIGFj MuIA== X-Gm-Message-State: AC+VfDzcroTiGlVQEfHxaFJxZyCPx/7Rxzvl16c6L3zrS5Ok2VceFO/5 zgjcp091kj8xnqRQVVO7+dU= X-Google-Smtp-Source: ACHHUZ4pStzuxaCGMmJm6RluYCnmi8a/0FXSIabaZLhS0t7Ugn+9nMSZePlrHbVFphmfhFde/rsL4w== X-Received: by 2002:adf:ef8d:0:b0:30f:ca51:629e with SMTP id d13-20020adfef8d000000b0030fca51629emr15377397wro.5.1687459671648; Thu, 22 Jun 2023 11:47:51 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id c9-20020a056000104900b0030631a599a0sm7528073wrx.24.2023.06.22.11.47.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 11:47:51 -0700 (PDT) From: Simon Tournier In-Reply-To: References: <87legsl3cm.fsf@inventati.org> <87jzw6rq48.fsf@gnu.org> <871qi7a0qr.fsf@gmail.com> <87pm5o7uh9.fsf@gnu.org> <87ttv0mth3.fsf@inventati.org> <87wmzvmxt8.fsf@inventati.org> <87h6qz8pg0.fsf@gmail.com> Date: Thu, 22 Jun 2023 20:47:48 +0200 Message-ID: <875y7f8hbf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1687459706; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=0y2jwc9zoMvk3rZO1kB3N5leeibatl97Uk95S7oUrDA=; b=JEoIMl8ug5brLrUL3gPgOakb/BVTp7XVGV0Lt013gNGY0L1jnYcKj5qLy6hmoi5iuqVBmN 8cYj2zk+jAjW0zSHQotyGxRDIZhh3dXCA7wUQpU2AGRJjim94yDFYqvleQVlEl3YQgwIxJ vpX6k0/zmnC1G0z2MiHVEMqFNOUjpBWagiRAzWNglyBLWDWRuawlhBIj3G84hWPc9uhfJv 1bJYDDqmSQzlAKju6sICm6kjQmPa7l4RpeZ9Sly3l5SNUA7JBjuFw2R2OPXR20IyhKi8uR m04V7inmk3Yf6sa0n22P25Chw7Fsk8+KTp8C9z+UMv49lvq5/L96VNGFibY9Ug== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=avU+VIOF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1687459706; a=rsa-sha256; cv=none; b=doK8USBtKj8xHtv/d7U/EKpWANcFIECSTyTGD4YLn54l6GiihPjBSC4ixg5JXYd3n6V90F wZVDoMIWscZqiVVB0H6H+q00rgGZ/Be6O8BlxO9Mz5LZ7XVvKJ8/aFU3jUTQxtW7jdcXwm /0CKYJjBg+kB6wBlzibfmJwA+X4//0zZ1ZOD+7uWsq1wR3hAUjX1b9Q971roHGafg2Apqy 0R9R14WnzE380ctyWkplPfVRkVUtayT8IVRj0/N21x/zD6QM3Qz6Td5YCLjuFx9PVWY9tt ngiSc+9jOAchlx/qi4v39iZjCO1QiAUXiVCT6+3JXJo6pFBH06qw6tA9cyXhFA== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -0.65 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=avU+VIOF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 52D7513008 X-Spam-Score: -0.65 X-TUID: upRoffrf5g3a --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, On Thu, 22 Jun 2023 at 19:25, Efraim Flashner wrote: > (ins)efraim@3900XT ~/workspace/guix$ cat /gnu/store/v6z5ykkjfzbc72x1x900x= flspqc5wd5r-openblas-ilp64-0.3.20/lib/pkgconfig/openblas.pc > libdir=3D/gnu/store/v6z5ykkjfzbc72x1x900xflspqc5wd5r-openblas-ilp64-0.3.2= 0/lib > includedir=3D/gnu/store/v6z5ykkjfzbc72x1x900xflspqc5wd5r-openblas-ilp64-0= .3.20/include > openblas_config=3D USE_64BITINT=3D DYNAMIC_ARCH=3D1 DYNAMIC_OLDER=3D1 NO_= CBLAS=3D NO_LAPACK=3D NO_LAPACKE=3D NO_AFFINITY=3D1 USE_OPENMP=3D generic M= AX_THREADS=3D128 > version=3D0.3.20 > extralib=3D-lm -lpthread -lgfortran -lm -lpthread -lgfortran > Name: openblas > Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.1= 3 BSD version > Version: ${version} > URL: https://github.com/xianyi/OpenBLAS > Libs: -L${libdir} -lopenblas > Libs.private: ${extralib} > Cflags: -I${includedir} > > Looks like it should be "LIBBLAS=3D-lopenblas" I propose to tweak openblas-ilp64. Currently it looks like: --8<---------------cut here---------------start------------->8--- $ tree $(guix build openblas-ilp64)/lib /gnu/store/v6z5ykkjfzbc72x1x900xflspqc5wd5r-openblas-ilp64-0.3.20/lib =E2=94=9C=E2=94=80=E2=94=80 cmake =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 openblas =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 OpenBLASConfig.cmake =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 OpenBLASConfigVersion= .cmake =E2=94=9C=E2=94=80=E2=94=80 libopenblas_ilp64p-r0.3.20.so =E2=94=9C=E2=94=80=E2=94=80 libopenblas_ilp64.so -> libopenblas_ilp64p-r0.3= .20.so =E2=94=9C=E2=94=80=E2=94=80 libopenblas_ilp64.so.0 -> libopenblas_ilp64p-r0= .3.20.so =E2=94=94=E2=94=80=E2=94=80 pkgconfig =E2=94=94=E2=94=80=E2=94=80 openblas.pc --8<---------------cut here---------------end--------------->8--- which is inconsistent with pkgconfig as you noticed above. Therefore, I am proposing the addition of a symlink of libopenblas_ilp64p.so to libopenblas.so. For instance this attached patch. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v3-0001-gnu-openblas-ilp64-Install-symlink-to-libopenblas.patch Content-Description: p3-openblas-ilp64.patch >From 0c8c7e9371d11972f4a6012ef503ef3057c91364 Mon Sep 17 00:00:00 2001 Message-Id: <0c8c7e9371d11972f4a6012ef503ef3057c91364.1687459454.git.zimon.toutoune@gmail.com> From: Simon Tournier Date: Thu, 22 Jun 2023 20:31:26 +0200 Subject: [PATCH v3 1/2] gnu: openblas-ilp64: Install symlink to libopenblas. * gnu/packages/maths.scm (openblas-ilp64)[arguments]: Add phases for installing symlink to libopenblas. --- gnu/packages/maths.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index f5a2181905..5c39ab8b94 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -4646,7 +4646,13 @@ (define-public openblas-ilp64 (substitute-keyword-arguments (package-arguments openblas) ((#:make-flags flags #~'()) #~(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64") - #$flags)))) + #$flags)) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'install 'install-symlink + (lambda _ + (symlink "libopenblas_ilp64.so" + (string-append #$output "/lib/libopenblas.so")))))))) (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)") (license license:bsd-3))) base-commit: 37c2e94cec6cb8b5e0e93e7b6c712c3b187ca5db -- 2.38.1 --=-=-= Content-Type: text/plain Then, the patch for Julia looks like the other attached patch. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v3-0002-gnu-julia-Conditionally-use-openblas-with-ILP64-s.patch Content-Description: p3.patch >From 8563a738703d133b44ae05b91b7448ca56d280b5 Mon Sep 17 00:00:00 2001 Message-Id: <8563a738703d133b44ae05b91b7448ca56d280b5.1687459454.git.zimon.toutoune@gmail.com> In-Reply-To: <0c8c7e9371d11972f4a6012ef503ef3057c91364.1687459454.git.zimon.toutoune@gmail.com> References: <0c8c7e9371d11972f4a6012ef503ef3057c91364.1687459454.git.zimon.toutoune@gmail.com> From: Simon Tournier Date: Thu, 22 Jun 2023 17:45:50 +0200 Subject: [PATCH v3 2/2] gnu: julia: Conditionally use openblas with ILP64 support. Fixes . Reported by Cayetano Santos . * gnu/packages/julia.scm (julia)[arguments]<#:make-flags>: Conditionally use 64-bit BLAS for x86-64 target. [inputs]: Conditionally replace openblas by openblas-ilp64 for x86-64 target. --- gnu/packages/julia.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm index ba54175822..17a27f4928 100644 --- a/gnu/packages/julia.scm +++ b/gnu/packages/julia.scm @@ -479,9 +479,9 @@ (define-public julia "NO_GIT=1" ; build from release tarball. "USE_GPL_LIBS=1" ; proudly - ,@(if (target-aarch64?) - `("USE_BLAS64=0") - '()) + ,@(if (target-x86-64?) + `("USE_BLAS64=1") + '()) "LIBBLAS=-lopenblas" "LIBBLASNAME=libopenblas" @@ -513,7 +513,9 @@ (define-public julia ("llvm" ,llvm-julia) ("mbedtls-apache" ,mbedtls-apache) ("mpfr" ,mpfr) - ("openblas" ,openblas) + ,@(if (target-x86-64?) + `(("openblas" ,openblas-ilp64)) + `(("openblas" ,openblas))) ("openlibm" ,openlibm) ("p7zip" ,p7zip) ("pcre2" ,pcre2) -- 2.38.1 --=-=-= Content-Type: text/plain WDYT? Well, I am running all the testsuite for checking if all is correct. Somehow, I think this is direction. Otherwise, what would you suggest? Cheers, simon --=-=-=--