[PATCH 0/2] Better interoperability between guix and Julia built-in package manager

  • Done
  • quality assurance status badge
Details
4 participants
  • Efraim Flashner
  • Jean-Baptiste Volatier
  • Ludovic Courtès
  • zimoun
Owner
unassigned
Submitted by
Jean-Baptiste Volatier
Severity
normal
J
J
Jean-Baptiste Volatier wrote on 21 Oct 2021 15:06
(address . guix-patches@gnu.org)(name . Jean-Baptiste Volatier)(address . jbv@pm.me)
20211021130648.14594-1-jbv@pm.me
With this patch, when a user install a package using Julia package manager,
the package manager finds packages that were already installed in the guix
profile and use them.

First patch of the serie does the implementation, the second patch is an example using
sundials_jll package.

Sundials_jll is a julia package that wraps the sundials library, it is typically not
installed on its own but as a dependency of DifferentialEquations.jl for example.

As DifferentialEquations.jl is not currently packaged in julia, a fallback is to
install it with julia package manager. Unfortunately that will also install
sundials_jll and downloads some .so that will fail to load on Guix because of
linker incompatilibities.

Now with the proposed patch, the user can install sundials_jll using guix,
and then julia package manager will use this package instead of downloading some
binary files.

As for the patch itself, it works by following more closely the directory
structure that Julia expects in JULIA_DEPOT_PATH. Namely the packages
subfolder should not contain packages but packages/XXXX/ where XXXX is
a string encoding package uuid and sha1 of package files.

$JULIA_DEPOT_PATH/packages was also used as JULIA_LOAD_PATH, this will not
work anymore as packages are behind a layer of XXXX sub directories.
So instead I added a new subfolder $JULIA_DEPOT_PATH/loadpath where the package
is installed and $JULIA_DEPOT_PATH/packages/XXXX is a symlink to it.

Jean-Baptiste Volatier (2):
build-system/julia: Enable Julia Pkg to find installed packages
gnu: Add julia-sundials-jull

gnu/packages/julia-jll.scm | 38 +++++++++++++++++++++++++
gnu/packages/julia-xyz.scm | 2 +-
gnu/packages/julia.scm | 2 +-
gnu/packages/maths.scm | 24 ++++++++++++++++
guix/build/julia-build-system.scm | 46 ++++++++++++++++++++++++++++---
5 files changed, 106 insertions(+), 6 deletions(-)

--
2.33.1
J
J
Jean-Baptiste Volatier wrote on 21 Oct 2021 15:09
(address . 51319@debbugs.gnu.org)(name . Jean-Baptiste Volatier)(address . jbv@pm.me)
20211021130952.14696-1-jbv@pm.me
With this patch, when a user install a package using Julia package manager,
the package manager finds packages that were already installed in the guix
profile and use them.

First patch of the serie does the implementation, the second patch is an example using
sundials_jll package.

Sundials_jll is a julia package that wraps the sundials library, it is typically not
installed on its own but as a dependency of DifferentialEquations.jl for example.

As DifferentialEquations.jl is not currently packaged in julia, a fallback is to
install it with julia package manager. Unfortunately that will also install
sundials_jll and downloads some .so that will fail to load on Guix because of
linker incompatilibities.

Now with the proposed patch, the user can install sundials_jll using guix,
and then julia package manager will use this package instead of downloading some
binary files.

As for the patch itself, it works by following more closely the directory
structure that Julia expects in JULIA_DEPOT_PATH. Namely the packages
subfolder should not contain packages but packages/XXXX/ where XXXX is
a string encoding package uuid and sha1 of package files.

$JULIA_DEPOT_PATH/packages was also used as JULIA_LOAD_PATH, this will not
work anymore as packages are behind a layer of XXXX sub directories.
So instead I added a new subfolder $JULIA_DEPOT_PATH/loadpath where the package
is installed and $JULIA_DEPOT_PATH/packages/XXXX is a symlink to it.

Jean-Baptiste Volatier (2):
build-system/julia: Enable Julia Pkg to find installed packages
gnu: Add julia-sundials-jull

gnu/packages/julia-jll.scm | 38 +++++++++++++++++++++++++
gnu/packages/julia-xyz.scm | 2 +-
gnu/packages/julia.scm | 2 +-
gnu/packages/maths.scm | 24 ++++++++++++++++
guix/build/julia-build-system.scm | 46 ++++++++++++++++++++++++++++---
5 files changed, 106 insertions(+), 6 deletions(-)

--
2.33.1
J
J
Jean-Baptiste Volatier wrote on 21 Oct 2021 15:10
[PATCH 2/2] gnu: Add julia-sundials-jull
(address . 51319@debbugs.gnu.org)(name . Jean-Baptiste Volatier)(address . jbv@pm.me)
20211021130952.14696-3-jbv@pm.me
* gnu/packages/julia-jll.scm (julia-sundials-jll): New variable.
* gnu/packages/maths.scm (sundials-julia): New variable.
---
gnu/packages/julia-jll.scm | 38 ++++++++++++++++++++++++++++++++++++++
gnu/packages/maths.scm | 24 ++++++++++++++++++++++++
2 files changed, 62 insertions(+)

Toggle diff (81 lines)
diff --git a/gnu/packages/julia-jll.scm b/gnu/packages/julia-jll.scm
index d3677d0a33..e1c33903dd 100644
--- a/gnu/packages/julia-jll.scm
+++ b/gnu/packages/julia-jll.scm
@@ -2709,3 +2709,41 @@ (define-public julia-zstd-jll
(synopsis "Zstd library wrappers")
(description "This package provides a wrapper for the zstd library.")
(license license:expat)))
+
+(define-public julia-sundials-jll
+ (package
+ (name "julia-sundials-jll")
+ (version "5.2.1+0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/JuliaBinaryWrappers/Sundials_jll.jl")
+ (commit (string-append "Sundials-v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0cijb9frq8gj8bjpqf2lr5d0jxlj262y6h6xi4z3536dingrvffc"))))
+ (build-system julia-build-system)
+ (arguments
+ '(#:tests? #f ; no runtests
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'link-depot 'override-binary-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (map
+ (lambda (wrapper)
+ (substitute* wrapper
+ (("global artifact_dir.*")
+ (string-append
+ "global artifact_dir = \""
+ (assoc-ref inputs "sundials") "\"\n"))))
+ ;; There's a Julia file for each platform, override them all
+ (find-files "src/wrappers/" "\\.jl$")))))))
+ (inputs
+ `(("sundials" ,sundials-julia)))
+ (propagated-inputs
+ `(("julia-jllwrappers" ,julia-jllwrappers)))
+ (home-page "https://github.com/JuliaBinaryWrappers/Sundials_jll.jl")
+ (synopsis "SUndials library wrappers")
+ (description "This package provides a wrapper for the sundials library.")
+ (license license:expat)))
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 038ca5518c..54f44a3b55 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5943,6 +5943,30 @@ (define-public sundials-openmpi
,%openmpi-setup)))))
(synopsis "SUNDIALS with OpenMPI support")))

+(define-public sundials-julia
+ (package
+ (inherit sundials)
+ (name "sundials-julia")
+ (version "5.2.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/LLNL/sundials.git")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32
+ "08q9svjdl6fmqrwyd9p12m98n0wd2lws38yh223wyp6590zi3i49"))))
+ (inputs
+ `(("lapack" ,lapack)
+ ,@(package-inputs sundials)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments sundials)
+ ((#:configure-flags flags '())
+ `(cons* "-DLAPACK_ENABLE:BOOL=ON"
+ ,flags))))
+ (synopsis "SUNDIALS with lapack support as required by julia-sundials-jll")))
+
(define-public combinatorial-blas
(package
(name "combinatorial-blas")
--
2.33.1
J
J
Jean-Baptiste Volatier wrote on 21 Oct 2021 15:09
[PATCH 1/2] build-system/julia: Enable Julia Pkg to find installed packages
(address . 51319@debbugs.gnu.org)(name . Jean-Baptiste Volatier)(address . jbv@pm.me)
20211021130952.14696-2-jbv@pm.me
* guix/build/julia-build-system.scm (link-depot): New phase.
Julia built-in package manager (Pkg) looks for packages in
JULIA_DEPOT_PATH/packages/PACKAGENAME/XXXX where XXXX is
a string encoding package UUID and SHA1 of files.
The link-depot phase creates a link at the correct location
to allow Pkg to find packages that were already installed by
Guix.
(%package-path): modified package path from packages/ to
loadpath/
(project.toml->uuid): retrive package uuid from TOML file

* gnu/packages/julia-xyz.scm: correct paths to reflect
change of %package-path

* gnu/packages/julia.scm: correct paths to reflect change of
%package-path
---
gnu/packages/julia-xyz.scm | 2 +-
gnu/packages/julia.scm | 2 +-
guix/build/julia-build-system.scm | 46 ++++++++++++++++++++++++++++---
3 files changed, 44 insertions(+), 6 deletions(-)

Toggle diff (135 lines)
diff --git a/gnu/packages/julia-xyz.scm b/gnu/packages/julia-xyz.scm
index c1ebc0fba1..1e407a2277 100644
--- a/gnu/packages/julia-xyz.scm
+++ b/gnu/packages/julia-xyz.scm
@@ -4610,7 +4610,7 @@ (define-public julia-uris
(lambda* (#:key source outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(chdir
- (string-append out "/share/julia/packages/URIs/test")))
+ (string-append out "/share/julia/loadpath/URIs/test")))
#t)))))
;; required for tests
(inputs `(("julia-json" ,julia-json)))
diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm
index 411f2e2e10..5b9bf91ed6 100644
--- a/gnu/packages/julia.scm
+++ b/gnu/packages/julia.scm
@@ -673,7 +673,7 @@ (define-public julia
(native-search-paths
(list (search-path-specification
(variable "JULIA_LOAD_PATH")
- (files (list "share/julia/packages/")))
+ (files (list "share/julia/loadpath/")))
(search-path-specification
(variable "JULIA_DEPOT_PATH")
(files (list "share/julia/")))))
diff --git a/guix/build/julia-build-system.scm b/guix/build/julia-build-system.scm
index d74acf2a05..c7f2119974 100644
--- a/guix/build/julia-build-system.scm
+++ b/guix/build/julia-build-system.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019, 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
+;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,10 +21,13 @@
(define-module (guix build julia-build-system)
#:use-module ((guix build gnu-build-system) #:prefix gnu:)
#:use-module (guix build utils)
+ #:use-module (rnrs io ports)
#:use-module (ice-9 match)
#:use-module (ice-9 regex)
#:use-module (ice-9 rdelim)
+ #:use-module (ice-9 popen)
#:export (%standard-phases
+ %package-path
julia-create-package-toml
julia-build))

@@ -37,7 +41,7 @@ (define (invoke-julia code)
(invoke "julia" "-e" code))

;; subpath where we store the package content
-(define %package-path "/share/julia/packages/")
+(define %package-path "/share/julia/loadpath/")

(define (project.toml->name file)
"Look for Julia package name in the TOML file FILE (usually named
@@ -51,6 +55,18 @@ (define (project.toml->name file)
(if m (match:substring m 1)
(loop (read-line in 'concat)))))))))

+(define (project.toml->uuid file)
+ "Look for Julia package uuid in the TOML file FILE (usually named
+Project.toml)."
+ (call-with-input-file file
+ (lambda (in)
+ (let loop ((line (read-line in 'concat)))
+ (if (eof-object? line)
+ #f
+ (let ((m (string-match "uuid\\s*=\\s*\"(.*)\"" line)))
+ (if m (match:substring m 1)
+ (loop (read-line in 'concat)))))))))
+
(define* (install #:key source inputs outputs julia-package-name
#:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -73,7 +89,7 @@ (define* (precompile #:key source inputs outputs julia-package-name
(setenv "JULIA_DEPOT_PATH" builddir)
;; Add new package dir to the load path.
(setenv "JULIA_LOAD_PATH"
- (string-append builddir "packages/" ":"
+ (string-append builddir "loadpath/" ":"
(or (getenv "JULIA_LOAD_PATH")
"")))
;; Actual precompilation:
@@ -97,15 +113,36 @@ (define* (check #:key tests? source inputs outputs julia-package-name
(setenv "SOURCE_DATE_EPOCH" "1")
(setenv "JULIA_DEPOT_PATH" builddir)
(setenv "JULIA_LOAD_PATH"
- (string-append builddir "packages/" ":"
+ (string-append builddir "loadpath/" ":"
(or (getenv "JULIA_LOAD_PATH")
"")))
(setenv "HOME" "/tmp")
(invoke "julia" "--depwarn=yes"
- (string-append builddir "packages/"
+ (string-append builddir "loadpath/"
package "/test/runtests.jl"))))
#t)

+(define* (link-depot #:key source inputs outputs julia-package-name
+ #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (package-name (or
+ julia-package-name
+ (project.toml->name "Project.toml")))
+ (package-dir (string-append out %package-path package-name))
+ (uuid (project.toml->uuid "Project.toml"))
+ (pipe (open-pipe* OPEN_READ "julia" "-e"
+ (format #f "using Pkg;
+println(Base.version_slug(Base.UUID(\"~a\"),
+ Base.SHA1(Pkg.GitTools.tree_hash(\".\"))))" uuid package-dir)))
+ (slug (string-trim-right (get-string-all pipe))))
+ ;; When installing a package, julia looks first at in the JULIA_DEPOT_PATH
+ ;; for a path like packages/PACKAGE/XXXX
+ ;; Where XXXX is a slug encoding the package UUID and SHA1 of the files
+ ;; Here we create a link with the correct path to enable julia to find the package
+ (mkdir-p (string-append out "/share/julia/packages/" package-name))
+ (symlink package-dir (string-append out "/share/julia/packages/" package-name "/" slug)))
+ #t)
+
(define (julia-create-package-toml outputs source
name uuid version
deps)
@@ -138,6 +175,7 @@ (define %standard-phases
(delete 'check) ; tests must be run after installation
(replace 'install install)
(add-after 'install 'precompile precompile)
+ (add-after 'unpack 'link-depot link-depot)
(add-after 'install 'check check)
;; TODO: In the future we could add a "system-image-generation" phase
;; where we use PackageCompiler.jl to speed up package loading times
--
2.33.1
E
E
Efraim Flashner wrote on 8 Nov 2021 08:30
(name . Jean-Baptiste Volatier)(address . jbv@pm.me)(address . 51319@debbugs.gnu.org)
YYjSF2CewB3kkAhg@3900XT
Attachment: file
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmGI0hcACgkQQarn3Mo9
g1FvIxAAh4UeF65a0A6KTwS+RNL6qlEfYbOAfd55vzqYQo+wW2hjIGK7+H6+N9SB
mlsrw2nwMnjJmwnEcLrISYk5GaL2JT4oIA4ajzVOhcw3bOgbZcaTLry1loLUPawN
jbHQZf6V3U6yd/nbNcMj/vkP1nwPLV42vqBuZMxhRh2ri5r1iJ/PB2xcZRO/U6NW
m3h36TLqVKoa6F9xp41rYntrmqZc3Sp+MF2tUKg8/5rwQmcoCArLw/egYm2wI/Bh
uQmRq9TOY09doTYCeK6LEw6L3ApE3IcIQmDE7jtvLtYkl8DornJrkDcnkt8pfZ7u
CJWtYLKiwT+Z915sWhkJLQwpOo2MUQvpZhZB9gU8Ix7isNhlZz0aWc7EHnbYgiyb
qRQsUzF1SO5vR0+i1O1DlGHvy2fv3bmwjFgB/iLg/jTDE1BvjIuTlFLl1XHTXoBq
Jxu0Nck+VKTXzQ0c559rKzZ1URXHDJWlWhdKMq87qOsxpm75npnOgq5mdm++bqLH
CO1/3FySy1U9Cp9rrxR5AWZDUKU6G9c2WMYzyJU7YrtU21C9MKlQ9wilPP5LpGk9
GjPWk/OqNabtHNnXxetJoXW1OYAKdqPyonVf/0Ztp+/lMbZdwbBeFAvMpdXLaT81
fb2BryQIdqpXDiGOxG6vlwepotByDWm1Kh8oGf7c4k/e+8qTFo8=
=KRz2
-----END PGP SIGNATURE-----


J
J
Jean-Baptiste Volatier wrote on 12 Nov 2021 15:23
[PATCH v2 0/2] Better interoperability between guix and Julia built-in package manager
(name . Jean-Baptiste Volatier)(address . jbv@pm.me)
20211112142328.28400-1-jbv@pm.me
On Monday, November 8th, 2021 at 8:30 AM, Efraim Flashner <efraim@flashner.co.il> wrote:

Toggle quote (4 lines)
> Thanks for the patch series! I'm really looking forward to this working
> out in Guix, being able to use Julia to download as-yet unpackaged julia
> packages will make using Julia much easier.

Me too! Then we can concentrate first on the JLL packages since
source only packages are likely to work as is.

I forgot to mention that for this patch to work, the link-depot
phase needs to be called before the source is modified.
So in this new version, I have modified all packages that where
modifiying the source after unpack to do it after link-depot instead.

Toggle quote (5 lines)
> I had to wrap this with '(when (file-exists? "Project.toml")' since we
> do have some packages that pre-date the use of Project.toml. Building
> julia-bufferedstreams will test both a package with and without a
> Project.toml.

I added a julia-package-uuid keyword argument like julia-package-name
for packages without a Project.toml. I also modified the packages
that needed it.

Toggle quote (3 lines)
> Here you have a '~a' to use uuid but package-dir isn't used anywhere. Is
> package-dir not needed or is there a missing substitution?

This was some left over from a previous iteration.


Jean-Baptiste Volatier (2):
build-system/julia: Enable Julia Pkg to find installed packages
gnu: Add julia-sundials-jull

gnu/packages/julia-jll.scm | 176 ++++++++++++++++++------------
gnu/packages/julia-xyz.scm | 69 ++++++------
gnu/packages/julia.scm | 2 +-
gnu/packages/maths.scm | 24 ++++
guix/build-system/julia.scm | 5 +-
guix/build/julia-build-system.scm | 49 ++++++++-
6 files changed, 217 insertions(+), 108 deletions(-)


base-commit: 6e67c701a88064babd1aef93b58890aed2dcd0aa
--
2.33.1
J
J
Jean-Baptiste Volatier wrote on 12 Nov 2021 15:23
[PATCH v2 1/2] build-system/julia: Enable Julia Pkg to find installed packages
(name . Jean-Baptiste Volatier)(address . jbv@pm.me)
20211112142328.28400-2-jbv@pm.me
* guix/build/julia-build-system.scm (link-depot): New phase.
Julia built-in package manager (Pkg) looks for packages in
JULIA_DEPOT_PATH/packages/PACKAGENAME/XXXX where XXXX is
a string encoding package UUID and SHA1 of files.
The link-depot phase creates a link at the correct location
to allow Pkg to find packages that were already installed by
Guix.
(%package-path): modified package path from packages/ to
loadpath/
(project.toml->uuid): retrive package uuid from TOML file

* gnu/packages/julia-xyz.scm: correct paths to reflect
change of %package-path
modify order of phases as link-depot needs to run on an
unmodified src directory
add package-name-uuid keyword argument to packages without
Project.toml file.

* gnu/packages/julia.scm: correct paths to reflect change of
%package-path
modify order of phases as link-depot needs to run on an
unmodified src directory
---
gnu/packages/julia-jll.scm | 138 +++++++++++++++---------------
gnu/packages/julia-xyz.scm | 69 ++++++++-------
gnu/packages/julia.scm | 2 +-
guix/build-system/julia.scm | 5 +-
guix/build/julia-build-system.scm | 49 +++++++++--
5 files changed, 155 insertions(+), 108 deletions(-)

Toggle diff (461 lines)
diff --git a/gnu/packages/julia-jll.scm b/gnu/packages/julia-jll.scm
index 51643819ae..d8cf5b9eaf 100644
--- a/gnu/packages/julia-jll.scm
+++ b/gnu/packages/julia-jll.scm
@@ -77,7 +77,7 @@ (define-public julia-bzip2-jll
'(#:tests? #f ; No runtests.jl
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -117,7 +117,7 @@ (define-public julia-cairo-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -163,7 +163,7 @@ (define-public julia-compilersupportlibraries-jll
`(#:tests? #f ; no runtests.jl
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -205,7 +205,7 @@ (define-public julia-expat-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -243,7 +243,7 @@ (define-public julia-ffmpeg-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -292,7 +292,7 @@ (define-public julia-fontconfig-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -335,7 +335,7 @@ (define-public julia-freetype2-jll
'(#:tests? #f ; No runtests.jl
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -377,7 +377,7 @@ (define-public julia-fribidi-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -413,7 +413,7 @@ (define-public julia-gettext-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -454,7 +454,7 @@ (define-public julia-glfw-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -497,7 +497,7 @@ (define-public julia-glib-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -541,7 +541,7 @@ (define-public julia-gr-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -590,7 +590,7 @@ (define-public julia-gumbo-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(let ((gumbo (string-append (assoc-ref inputs "gumbo-parser"))))
(for-each
@@ -630,7 +630,7 @@ (define-public julia-imagemagick-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -672,7 +672,7 @@ (define-public julia-jllwrappers
'(#:tests? #f
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'custom-override-path
+ (add-after 'link-depot 'custom-override-path
(lambda* (#:key inputs #:allow-other-keys)
;; Make @generate_wrapper_header take an optional argument that
;; guix packagers can pass to override the default "override"
@@ -718,7 +718,7 @@ (define-public julia-jpegturbo-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -754,7 +754,7 @@ (define-public julia-lame-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -790,7 +790,7 @@ (define-public julia-libass-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -830,7 +830,7 @@ (define-public julia-libfdk-aac-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -866,7 +866,7 @@ (define-public julia-libffi-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -903,7 +903,7 @@ (define-public julia-libgcrypt-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -942,7 +942,7 @@ (define-public julia-libglvnd-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -980,7 +980,7 @@ (define-public julia-libgpg-error-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1018,7 +1018,7 @@ (define-public julia-libiconv-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1056,7 +1056,7 @@ (define-public julia-libmount-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1095,7 +1095,7 @@ (define-public julia-libpng-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1133,7 +1133,7 @@ (define-public julia-libsass-jll
`(#:tests? #f ; no runtests.jl
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1175,7 +1175,7 @@ (define-public julia-libtiff-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1214,7 +1214,7 @@ (define-public julia-libuuid-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1252,7 +1252,7 @@ (define-public julia-libvorbis-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1290,7 +1290,7 @@ (define-public julia-lzo-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1328,7 +1328,7 @@ (define-public julia-mbedtls-jll
'(#:tests? #f ; No runtests.jl
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1366,7 +1366,7 @@ (define-public julia-ogg-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1403,7 +1403,7 @@ (define-public julia-openspecfun-jll
`(#:tests? #f ; no runtests.jl
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1446,7 +1446,7 @@ (define-public julia-openssl-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1482,7 +1482,7 @@ (define-public julia-opus-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1518,7 +1518,7 @@ (define-public julia-pcre-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1556,7 +1556,7 @@ (define-public julia-pixman-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1594,7 +1594,7 @@ (define-public julia-qt5base-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1645,7 +1645,7 @@ (define-public julia-wayland-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1684,7 +1684,7 @@ (define-public julia-wayland-protocols-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1721,7 +1721,7 @@ (define-public julia-x264-jll
`(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(let ((libx264 (assoc-ref inputs "libx264")))
(map
@@ -1762,7 +1762,7 @@ (define-public julia-x265-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1798,7 +1798,7 @@ (define-public julia-xkbcommon-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1838,7 +1838,7 @@ (define-public julia-xml2-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1878,7 +1878,7 @@ (define-public julia-xorg-libpthread-stubs-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1915,7 +1915,7 @@ (define-public julia-xorg-libx11-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1953,7 +1953,7 @@ (define-public julia-xorg-libxau-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -1989,7 +1989,7 @@ (define-public julia-xorg-libxcb-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -2029,7 +2029,7 @@ (define-public julia-xorg-libxcursor-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
(lambda* (#:key inputs #:allow-other-keys)
(map
(lambda (wrapper)
@@ -2067,7 +2067,7 @@ (define-public julia-xorg-libxdmcp-jll
'(#:tests? #f ; no runtests
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'override-binary-path
+ (add-after 'link-depot 'override-binary-path
This message was truncated. Download the full message here.
J
J
Jean-Baptiste Volatier wrote on 12 Nov 2021 15:24
[PATCH v2 2/2] gnu: Add julia-sundials-jull
(name . Jean-Baptiste Volatier)(address . jbv@pm.me)
20211112142328.28400-3-jbv@pm.me
* gnu/packages/julia-jll.scm (julia-sundials-jll): New variable.
* gnu/packages/maths.scm (sundials-julia): New variable.
---
gnu/packages/julia-jll.scm | 38 ++++++++++++++++++++++++++++++++++++++
gnu/packages/maths.scm | 24 ++++++++++++++++++++++++
2 files changed, 62 insertions(+)

Toggle diff (81 lines)
diff --git a/gnu/packages/julia-jll.scm b/gnu/packages/julia-jll.scm
index d8cf5b9eaf..097d2f1123 100644
--- a/gnu/packages/julia-jll.scm
+++ b/gnu/packages/julia-jll.scm
@@ -2759,3 +2759,41 @@ (define-public julia-zstd-jll
(synopsis "Zstd library wrappers")
(description "This package provides a wrapper for the zstd library.")
(license license:expat)))
+
+(define-public julia-sundials-jll
+ (package
+ (name "julia-sundials-jll")
+ (version "5.2.1+0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/JuliaBinaryWrappers/Sundials_jll.jl")
+ (commit (string-append "Sundials-v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0cijb9frq8gj8bjpqf2lr5d0jxlj262y6h6xi4z3536dingrvffc"))))
+ (build-system julia-build-system)
+ (arguments
+ '(#:tests? #f ; no runtests
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'link-depot 'override-binary-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (map
+ (lambda (wrapper)
+ (substitute* wrapper
+ (("global artifact_dir.*")
+ (string-append
+ "global artifact_dir = \""
+ (assoc-ref inputs "sundials") "\"\n"))))
+ ;; There's a Julia file for each platform, override them all
+ (find-files "src/wrappers/" "\\.jl$")))))))
+ (inputs
+ `(("sundials" ,sundials-julia)))
+ (propagated-inputs
+ `(("julia-jllwrappers" ,julia-jllwrappers)))
+ (home-page "https://github.com/JuliaBinaryWrappers/Sundials_jll.jl")
+ (synopsis "SUndials library wrappers")
+ (description "This package provides a wrapper for the sundials library.")
+ (license license:expat)))
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 5152fe6942..eba45cd6b6 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -6159,6 +6159,30 @@ (define-public sundials-openmpi
,%openmpi-setup)))))
(synopsis "SUNDIALS with OpenMPI support")))

+(define-public sundials-julia
+ (package
+ (inherit sundials)
+ (name "sundials-julia")
+ (version "5.2.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/LLNL/sundials.git")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32
+ "08q9svjdl6fmqrwyd9p12m98n0wd2lws38yh223wyp6590zi3i49"))))
+ (inputs
+ `(("lapack" ,lapack)
+ ,@(package-inputs sundials)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments sundials)
+ ((#:configure-flags flags '())
+ `(cons* "-DLAPACK_ENABLE:BOOL=ON"
+ ,flags))))
+ (synopsis "SUNDIALS with lapack support as required by julia-sundials-jll")))
+
(define-public combinatorial-blas
(package
(name "combinatorial-blas")
--
2.33.1
L
L
Ludovic Courtès wrote on 10 Mar 2022 00:33
Re: bug#51319: [PATCH 0/2] Better interoperability between guix and Julia built-in package manager
87sfrq1z23.fsf_-_@gnu.org
Hello!

Efraim, zimoun: I just stumbled upon this patch series by Jean-Baptiste,
which seems to have fallen through the cracks:


Could you take a look and apply them if appropriate?

Thanks in advance!

Ludo’.

Jean-Baptiste Volatier <jbv@pm.me> skribis:

Toggle quote (45 lines)
> On Monday, November 8th, 2021 at 8:30 AM, Efraim Flashner <efraim@flashner.co.il> wrote:
>
>> Thanks for the patch series! I'm really looking forward to this working
>> out in Guix, being able to use Julia to download as-yet unpackaged julia
>> packages will make using Julia much easier.
>
> Me too! Then we can concentrate first on the JLL packages since
> source only packages are likely to work as is.
>
> I forgot to mention that for this patch to work, the link-depot
> phase needs to be called before the source is modified.
> So in this new version, I have modified all packages that where
> modifiying the source after unpack to do it after link-depot instead.
>
>> I had to wrap this with '(when (file-exists? "Project.toml")' since we
>> do have some packages that pre-date the use of Project.toml. Building
>> julia-bufferedstreams will test both a package with and without a
>> Project.toml.
>
> I added a julia-package-uuid keyword argument like julia-package-name
> for packages without a Project.toml. I also modified the packages
> that needed it.
>
>> Here you have a '~a' to use uuid but package-dir isn't used anywhere. Is
>> package-dir not needed or is there a missing substitution?
>
> This was some left over from a previous iteration.
>
>
> Jean-Baptiste Volatier (2):
> build-system/julia: Enable Julia Pkg to find installed packages
> gnu: Add julia-sundials-jull
>
> gnu/packages/julia-jll.scm | 176 ++++++++++++++++++------------
> gnu/packages/julia-xyz.scm | 69 ++++++------
> gnu/packages/julia.scm | 2 +-
> gnu/packages/maths.scm | 24 ++++
> guix/build-system/julia.scm | 5 +-
> guix/build/julia-build-system.scm | 49 ++++++++-
> 6 files changed, 217 insertions(+), 108 deletions(-)
>
>
> base-commit: 6e67c701a88064babd1aef93b58890aed2dcd0aa
> --
> 2.33.1
Z
Z
zimoun wrote on 10 Mar 2022 00:59
(name . Ludovic Courtès)(address . ludo@gnu.org)
86pmmusmmw.fsf_-_@gmail.com
Hi Ludo,

On Thu, 10 Mar 2022 at 00:33, Ludovic Courtès <ludo@gnu.org> wrote:

Toggle quote (4 lines)
>
> Could you take a look and apply them if appropriate?

From my understanding, already applied with
3af351a7de41b8d50f27f3623c46392f571b9a4e and
546f8537aad3ac03fef43e036d3cab3abc943915. Therefore, I am closing.

Thanks for taking care.

Cheers,
simon

PS: The feature pointed in the Guix-HPC report, IIRC. ;-)
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 51319@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 51319
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch