(address . guix-patches@gnu.org)
From: Ludovic Courtès <ludovic.courtes@inria.fr>
* gnu/packages/julia.scm (julia): Update to 1.9.3.
[arguments]: Use gexps.
[inputs, native-inputs]: Remove labels.
* gnu/packages/llvm.scm (llvm-julia): Rename to…
(llvm-14-julia): … this. Upgrade to 14.0.6-3.
* gnu/packages/patches/julia-1.9-build-tweaks.patch: New file.
* gnu/packages/patches/julia-Use-MPFR-4.2.patch: Remove.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
Co-authored-by: Philippe Virouleau <philippe.virouleau@inria.fr>
Change-Id: I6ef35c6cd31741a7725b50364dd0f8fa6a0c6424
---
gnu/local.mk | 2 +-
gnu/packages/julia.scm | 862 ++++++++++--------
gnu/packages/llvm.scm | 38 +-
.../patches/julia-1.9-build-tweaks.patch | 152 +++
gnu/packages/patches/julia-Use-MPFR-4.2.patch | 228 -----
5 files changed, 651 insertions(+), 631 deletions(-)
create mode 100644 gnu/packages/patches/julia-1.9-build-tweaks.patch
delete mode 100644 gnu/packages/patches/julia-Use-MPFR-4.2.patch
Hello comrades!
Here is an update of Julia adapted from:
Version 1.9.3 has been in the guix-hpc channel for a while. It’s not
the latest version, not even the latest series, but it’s an improvement
over what we have.
Thoughts?
Ludo’.
Toggle diff (371 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index ed630041ff..76d58c8e38 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1586,8 +1586,8 @@ dist_patch_DATA = \
%D%/packages/patches/john-the-ripper-jumbo-with-gcc-11.patch \
%D%/packages/patches/json-c-0.13-CVE-2020-12762.patch \
%D%/packages/patches/json-c-0.12-CVE-2020-12762.patch \
+ %D%/packages/patches/julia-1.9-build-tweaks.patch \
%D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \
- %D%/packages/patches/julia-Use-MPFR-4.2.patch \
%D%/packages/patches/libcall-ui-make-it-installable.patch \
%D%/packages/patches/libcamera-ipa_manager-disable-signature-verification.patch \
%D%/packages/patches/libcss-check-format.patch \
diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm
index 9668b3fd1e..5c7d900a09 100644
--- a/gnu/packages/julia.scm
+++ b/gnu/packages/julia.scm
@@ -28,6 +28,7 @@ (define-module (gnu packages julia)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
@@ -142,412 +143,493 @@ (define-public libwhich
(define-public julia
(package
(name "julia")
- (version "1.8.3")
- (source (origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/JuliaLang/julia/releases/download/v"
- version "/julia-" version ".tar.gz"))
- (sha256
- (base32
- "0jf8dr5j7y8cjnr65kn38xps5h9m2qvi8g1yd8qgiip5r87ld3ad"))
- (patches (search-patches "julia-SOURCE_DATE_EPOCH-mtime.patch"
- "julia-Use-MPFR-4.2.patch"))))
+ (version "1.9.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/JuliaLang/julia/releases/download/v" version
+ "/julia-" version ".tar.gz"))
+ (sha256
+ (base32 "0788hbcr1v89crv2j3insy89lxs0zwjbxk9q73jpj4g7j26bszcd"))
+ (patches (search-patches "julia-SOURCE_DATE_EPOCH-mtime.patch"
+ "julia-1.9-build-tweaks.patch"))))
(build-system gnu-build-system)
(arguments
- `(#:test-target "test"
- #:modules ((ice-9 match)
- (guix build gnu-build-system)
- (guix build utils))
+ (list #:test-target "test"
+ #:modules `((ice-9 match)
+ (guix build gnu-build-system)
+ (guix build utils))
- ;; The test suite takes many times longer than building and
- ;; can easily fail on smaller machines when they run out of memory.
- #:tests? ,(not (or (%current-target-system)
- (target-aarch64?)))
+ ;; The test suite takes many times longer than building and
+ ;; can easily fail on smaller machines when they run out of memory.
+ #:tests? (not (or (%current-target-system)
+ (target-aarch64?)))
- ;; Do not strip binaries to keep support for full backtraces.
- ;; See https://github.com/JuliaLang/julia/issues/17831
- #:strip-binaries? #f
+ ;; Do not strip binaries to keep support for full backtraces.
+ ;; See https://github.com/JuliaLang/julia/issues/17831
+ #:strip-binaries? #f
- ;; The DSOs use $ORIGIN to refer to each other, but (guix build
- ;; gremlin) doesn't support it yet, so skip this phase.
- #:validate-runpath? #f
+ ;; The DSOs use $ORIGIN to refer to each other, but (guix build
+ ;; gremlin) doesn't support it yet, so skip this phase.
+ #:validate-runpath? #f
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (add-after 'unpack 'prepare-deps
- (lambda* (#:key inputs #:allow-other-keys)
- ;; needed by libwhich
- (setenv "LD_LIBRARY_PATH"
- (string-join (map (lambda (pkg)
- (string-append (assoc-ref inputs pkg)
- "/lib"))
- '("curl" "dsfmt"
- "gmp" "lapack"
- "libssh2" "libnghttp2" "libgit2"
- "libblastrampoline"
- "mbedtls" "mpfr"
- "openblas" "openlibm" "pcre2"
- "suitesparse" "gfortran:lib"))
- ":"))))
- ;; FIXME: Building the documentation requires Julia packages that
- ;; would be downloaded from the Internet. We should build them in a
- ;; separate build phase.
- (add-after 'unpack 'disable-documentation
- (lambda _
- (substitute* "Makefile"
- (("(install: .*) \\$\\(BUILDROOT\\)/doc/_build/html/en/index.html" _ line)
- (string-append line "\n"))
- (("src ui doc deps")
- "src ui deps"))))
- (add-after 'unpack 'activate-gnu-source-for-loader
- (lambda _
- (substitute* "cli/Makefile"
- (("LOADER_CFLAGS =") "LOADER_CFLAGS = -D_GNU_SOURCE"))))
- ;; libquadmath is not available on all architectures.
- ;; https://github.com/JuliaLang/julia/issues/41613
- (add-after 'unpack 'make-libquadmath-optional
- (lambda _
- (substitute* "base/Makefile"
- (("libquadmath,0") "libquadmath,0,ALLOW_FAILURE"))))
- (add-before 'check 'set-home
- ;; Some tests require a home directory to be set.
- (lambda _ (setenv "HOME" "/tmp")))
- (add-before 'build 'fix-include-and-link-paths
- (lambda* (#:key inputs #:allow-other-keys)
- ;; The REPL must be linked with libuv.
- (substitute* "cli/Makefile"
- (("JLDFLAGS \\+= ")
- (string-append "JLDFLAGS += "
- (assoc-ref inputs "libuv")
- "/lib/libuv.so ")))))
- (add-before 'build 'replace-default-shell
- (lambda* (#:key inputs #:allow-other-keys)
- (substitute* "base/client.jl"
- (("/bin/sh") (search-input-file inputs "/bin/sh")))))
- (add-before 'build 'shared-objects-paths
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((jlpath
- (lambda (pkgname)
- (string-append
- "stdlib/" pkgname "_jll/src/" pkgname "_jll.jl")))
- (from
- (lambda (libname)
- (string-append "const " libname " = .*\\.so")))
- (to
- (lambda* (pkg libname #:optional libname_jl)
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'prepare-deps
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; needed by libwhich
+ (match inputs
+ (((labels . directories) ...)
+ (set-path-environment-variable
+ "LD_LIBRARY_PATH"
+ '("lib") directories)))))
+ (add-before 'check 'set-home
+ ;; Some tests require a home directory to be set.
+ (lambda _
+ (setenv "HOME" "/tmp")))
+ (add-before 'build 'fix-include-and-link-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; The REPL must be linked with libuv.
+ (substitute* "cli/Makefile"
+ (("JLDFLAGS \\+= ")
+ (string-append "JLDFLAGS += "
+ (search-input-file inputs
+ "/lib/libuv.so") " ")))))
+ (add-before 'build 'fix-nested-dlopen
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "Make.inc"
+ ;; See the patch comment for the explanation, *must* be updated
+ ;; when updating julia.
+ (("GUIX_LIBUTF8PROC")
+ (search-input-file inputs "/lib/libutf8proc.a")))
+ (substitute* "Makefile"
+ ;; See the patch comment for the explanation, *must* be updated
+ ;; when updating julia.
+ (("GUIX_LIBCHOLMOD")
+ (search-input-file inputs "/lib/libcholmod.so"))
+ (("GUIX_LIBSPQR")
+ (search-input-file inputs "/lib/libspqr.so"))
+ (("GUIX_LIBSC")
+ (search-input-file inputs
+ "/lib/libsuitesparseconfig.so"))
+ (("GUIX_LIBUMFPACK")
+ (search-input-file inputs "/lib/libumfpack.so")))))
+ (add-before 'build 'replace-default-shell
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "base/client.jl"
+ (("/bin/sh")
+ (search-input-file inputs "/bin/sh")))))
+ (add-before 'build 'shared-objects-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((jlpath (lambda (pkgname)
+ (string-append "stdlib/" pkgname
+ "_jll/src/" pkgname
+ "_jll.jl")))
+ (jlbasepath (lambda (pkgname)
+ (string-append "base/" pkgname
+ ".jl")))
+ (tolib (lambda (libname)
+ (search-input-file inputs
+ (string-append
+ "/lib/" libname
+ ".so"))))
+ (toquotedlib (lambda (libname)
+ (define file
+ (string-append "/lib/"
+ libname
+ ".so"))
+ (string-append "\""
+ (search-input-file
+ inputs file)
+ "\"")))
+ (from (lambda (libname)
+ (string-append "const " libname
+ " = .*\\.so")))
+ (to (lambda* (libname #:optional libname_jl)
+ (define file
+ (string-append "/lib/" libname ".so"))
+
+ (string-append "const "
+ (or libname_jl libname)
+ " = \""
+ (search-input-file
+ inputs file)))))
+ (substitute* "src/jitlayers.cpp"
+ (("libatomic.so")
+ (search-input-file inputs "/lib/libatomic.so")))
+ (substitute* (list (jlbasepath "linking")
+ (jlpath "LLD"))
+ (("\"lld\"")
+ (string-append "\""
+ (search-input-file inputs
+ "/bin/lld")
+ "\"")))
+ (substitute* (jlbasepath "pcre")
+ (("libpcre2-8")
+ (tolib "libpcre2-8")))
+ (substitute* (jlbasepath "gmp")
+ (("libgmp.so.10")
+ (tolib "libgmp")))
+ (substitute* (jlbasepath "mpfr")
+ (("libmpfr.so.6")
+ (tolib "libmpfr")))
+ (substitute* (jlbasepath "irrationals")
+ ((":libmpfr")
+ (toquotedlib "libmpfr")))
+ (substitute* "stdlib/Random/src/generation.jl"
+ ((":libmpfr")
+ (toquotedlib "libmpfr")))
+ (substitute* "stdlib/Printf/src/Printf.jl"
+ (("\"libmpfr\"")
+ (toquotedlib "libmpfr")))
+ (substitute* "stdlib/Random/src/DSFMT.jl"
+ ((":libdSFMT")
+ (toquotedlib "libdSFMT")))
+ (for-each (lambda (file)
+ (substitute* file
+ ((":libgit2")
+ (toquotedlib "libgit2"))))
+ (find-files "stdlib/LibGit2/" "\\.jl$"))
+ (substitute* (jlpath "CompilerSupportLibraries")
+ (((from "libgomp"))
+ (to "libgomp"))
+ (((from "libgfortran"))
+ (string-append
+ "const libgfortran = string(\""
+ (search-input-file inputs
+ "/lib/libgfortran.so"))))
+ (substitute* (jlpath "dSFMT")
+ (((from "libdSFMT"))
+ (to "libdSFMT")))
+ (substitute* (jlpath "GMP")
+ (((from "libgmp"))
+ (to "libgmp"))
+ (((from "libgmpxx"))
+ (to "libgmpxx")))
+ (substitute* (jlpath "libLLVM")
+ (((from "libLLVM"))
+ (to "libLLVM")))
+ (substitute* (jlbasepath "binaryplatforms")
+ (("libLLVM-14jl")
+ (tolib "libLLVM-14jl")))
+ (substitute* (jlpath "LibCURL")
+ (((from "libcurl"))
+ (to "libcurl")))
+ (substitute* (jlpath "LibGit2")
+ (((from "libgit2"))
+ (to "libgit2")))
+ (substitute* (jlpath "LibSSH2")
+ (((from "libssh2"))
+ (to "libssh2")))
+ (substitute* (jlpath "LibUV")
+ (((from "libuv"))
+ (to "libuv")))
+ (substitute* (jlpath "LibUnwind")
+ (((from "libunwind"))
+ (to "libunwind")))
+ (substitute* (jlpath "MPFR")
+ (((from "libmpfr"))
+ (to "libmpfr")))
+ (substitute* (jlpath "MbedTLS")
+ (((from "libmbedcrypto"))
+ (to "libmbedcrypto"))
+ (((from "libmbedtls"))
+ (to "libmbedtls"))
+ (((from "libmbedx509"))
+ (to "libmbedx509")))
+ (substitute* (jlpath "nghttp2")
+ (((from "libnghttp2"))
+ (to "libnghttp2")))
+ (substitute* (jlpath "OpenBLAS")
+ (("libgfortran.so")
+ (tolib "libgfortran"))
+ (((from "libopenblas"))
+ #$@(if (target-x86-64?)
+ `((to "libopenblas64_" "libopenblas"))
+ `((to "libopenblas")))))
+ (substitute* (jlpath "OpenLibm")
+ (((from "libopenlibm"))
+ (to "libopenlibm")))
+ (substitute* (jlpath "PCRE2")
+ (((from "libpcre2_8"))
+ (to "libpcre2-8" "libpcre2_8")))
+ (substitute* (jlpath "SuiteSparse")
+ (((from "libamd"))
+ (to "libamd"))
+ (((from "libbtf"))
+ (to "libbtf"))
+ (((from "libcamd"))
+ (to "libcamd"))
+ (((from "libccolamd"))
+ (to "libccolamd"))
+ (((from "libcholmod"))
+ (to "libcholmod"))
+ (((from "libcolamd"))
+ (to "libcolamd"))
+ (((from "libklu"))
+ (to "libklu"))
+ (((from "libldl"))
+ (to "libldl"))
+ (((from "librbio"))
+ (to "librbio"))
+ (((from "libspqr"))
+ (to "libspqr"))
+ (((from "libsuitesparse"))
+ (to "libsuitesparse"))
+ (((from "libsuitesparseconfig"))
+ (to "libsuitesparseconfig"))
+ (((from "libumfpack"))
+ (to "libumfpack")))
+ (substitute* (jlpath "Zlib")
+ (((from "libz"))
+ (to "libz")))
+ (substitute* (jlpath "libblastrampoline")
+ (("libblastrampoline\\.so")
+ (search-input-file inputs
+ "/lib/libblastrampoline.so"))))))
+ (add-before 'build 'use-ssl-cert-file
+ (lambda _
+ ;; We must adapt MozillaCACerts to use SSL_CERT_FILE.
+ (substitute* "stdlib/MozillaCACerts_jll/src/MozillaCACerts_jll.jl"
+ (("global cacert = .*")
This message was truncated. Download the full message here.