[PATCH 1/4] gnu: gecode: Update to development version 6.3.0.

  • Done
  • quality assurance status badge
Details
3 participants
  • Andreas Enge
  • Herman Rimm
  • Ludovic Courtès
Owner
unassigned
Submitted by
Herman Rimm
Severity
normal
H
H
Herman Rimm wrote on 30 Mar 12:40 +0100
(address . guix-patches@gnu.org)(name . Herman Rimm)(address . herman@rimm.ee)
f5a006def8b65680ffe79602658825e2b25bfb56.1711794209.git.herman@rimm.ee
* gnu/packages/maths.scm (gecode): Update.

Change-Id: I5e89105f3fef61d6aa677a4a118225679220ce5d
---
gnu/packages/maths.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Toggle diff (36 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 479591889f..6c23aa3562 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -63,6 +63,7 @@
;;; Copyright © 2023 Jake Leporte <jakeleporte@outlook.com>
;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
;;; Copyright © 2023 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -2615,16 +2616,16 @@ (define-public clp
(define-public gecode
(package
(name "gecode")
- (version "6.2.0")
+ (version "6.3.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/Gecode/gecode")
- (commit (string-append "release-" version))))
+ (commit "2d20e88cae176584b6e09d909aca3eb72ae76829")))
(file-name (git-file-name name version))
(sha256
(base32
- "0b1cq0c810j1xr2x9y9996p894571sdxng5h74py17c6nr8c6dmk"))
+ "0hf7hd7m5p26xwn8f561f0gn2a6q33xz818jg3ivmvp2ysmmmm4r"))
(modules '((guix build utils)))
(snippet
'(begin

base-commit: 350cdbe83819233b6db9fb1cfc797eaf80b0d168
--
2.41.0
H
H
Herman Rimm wrote on 30 Mar 12:42 +0100
[PATCH 2/4] gnu: Add chuffed.
(address . 70087@debbugs.gnu.org)(name . Herman Rimm)(address . herman@rimm.ee)
a6f28de25feaacb939b8da06539aed6de1b4f8de.1711794209.git.herman@rimm.ee
* gnu/packages/maths.scm (chuffed): Add variable.

Change-Id: I77fc1ceb9caa42833689fba771010aeb38443e5e
---
gnu/packages/maths.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (50 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 6c23aa3562..0c08851616 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -306,6 +306,43 @@ (define-public calc
(home-page "http://www.isthe.com/chongo/tech/comp/calc/")
(license license:lgpl2.1)))
+(define-public chuffed
+ (package
+ (name "chuffed")
+ (version "0.13.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/chuffed/chuffed")
+ (commit version)))
+ (sha256
+ (base32
+ "1c28q166qh84q4i5wz77fqvw7kld3fmhd245sgdvyxcbjpi2wr0m"))))
+ (build-system cmake-build-system)
+ (synopsis "Lazy clause generation solver")
+ (arguments '(#:tests? #f ; no 'check' target
+ #:modules ((guix build cmake-build-system)
+ (guix build utils))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'patch-msc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* "chuffed.msc"
+ ;; TODO: Replace fzn-chuffed and chuffed path
+ ;; before build.
+ (("\\.\\./../..") out)
+ (("\\.\\.")
+ (string-append
+ out "/share/minizinc")))))))))
+ (description
+ "Chuffed is a state of the art lazy clause solver designed from the
+ground up with lazy clause generation in mind. Lazy clause generation
+is a hybrid approach to constraint solving that combines features of
+finite domain propagation and Boolean satisfiability.")
+ (home-page "https://github.com/chuffed/chuffed")
+ (license license:expat)))
+
(define-public coda
(package
(name "coda")
--
2.41.0
H
H
Herman Rimm wrote on 30 Mar 12:42 +0100
[PATCH 3/4] gnu: minizinc: Add chuffed backend.
(address . 70087@debbugs.gnu.org)(name . Herman Rimm)(address . herman@rimm.ee)
1f8b3e870c43629a1b35ecb532a1cffc19146315.1711794209.git.herman@rimm.ee
* gnu/packages/maths.scm (minizinc): Add backend.

Change-Id: If178a7585d70eb4b6f3223f5f6b2f34d9d2f2257
---
gnu/packages/maths.scm | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

Toggle diff (52 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 0c08851616..fd44f1f985 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4065,9 +4065,9 @@ (define-public minizinc
(lambda (file)
(member file (cons* "." ".." targets)))
(scandir ".")))
- (substitute* "libmzn.cmake"
- (("include\\(cmake/targets/(.*)\\)" all target)
- (if (member target targets) all "")))))
+ (substitute* "libmzn.cmake"
+ (("include\\(cmake/targets/(.*)\\)" all target)
+ (if (member target targets) all "")))))
(with-directory-excursion "include/minizinc/solvers/MIP"
(for-each delete-file
(remove
@@ -4106,9 +4106,10 @@ (define-public minizinc
(modify-phases %standard-phases
(add-after 'install 'install-solver-configs
(lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((gecode (assoc-ref inputs "gecode"))
+ (let ((chuffed (assoc-ref inputs "chuffed"))
+ (gecode (assoc-ref inputs "gecode"))
(pkgdatadir (string-append (assoc-ref outputs "out")
- "/share/minizinc")))
+ "/share/minizinc")))
(call-with-output-file (string-append pkgdatadir
"/Preferences.json")
(lambda (port)
@@ -4123,7 +4124,9 @@ (define-public minizinc
port)
(newline port)))
- (mkdir-p (string-append pkgdatadir "/solvers"))
+ (copy-recursively
+ (string-append chuffed "/share/minizinc/solvers")
+ (string-append pkgdatadir "/solvers"))
(call-with-output-file (string-append pkgdatadir
"/solvers/gecode.msc")
(lambda (port)
@@ -4150,7 +4153,7 @@ (define-public minizinc
(native-inputs
(list bison flex))
(inputs
- (list cbc gecode zlib))
+ (list cbc chuffed gecode zlib))
(home-page "https://www.minizinc.org")
(synopsis "High-level constraint modeling language")
(description "MiniZinc is a high-level modeling language for constraint
--
2.41.0
H
H
Herman Rimm wrote on 30 Mar 12:42 +0100
[PATCH 4/4] gnu: minizinc: Update to 2.8.3.
(address . 70087@debbugs.gnu.org)(name . Herman Rimm)(address . herman@rimm.ee)
5345bf947c546c7a9c1a581e9d22d33b953158ec.1711794209.git.herman@rimm.ee
* gnu/packages/maths.scm (minizinc): Update.

Change-Id: I503fd004b38abaac8829a2cb94c182b001d83763
---
gnu/packages/maths.scm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index fd44f1f985..5a58696858 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4034,7 +4034,7 @@ (define-public metamath
(define-public minizinc
(package
(name "minizinc")
- (version "2.5.5")
+ (version "2.8.3")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -4043,7 +4043,7 @@ (define-public minizinc
(file-name (git-file-name name version))
(sha256
(base32
- "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
+ "1h3pc92m7ypvmhrrhk2263ib5rqc4fv4n6lai0p8dwiidjpcqnpz"))
(modules '((guix build utils)
(ice-9 ftw)
(srfi srfi-1)))
@@ -4089,6 +4089,9 @@ (define-public minizinc
"MIP_solverinstance.cpp"
"MIP_wrap.cpp")))
(scandir "."))))
+ ;; Gecode 6.3 does not yet support new interface.
+ (substitute* "solvers/gecode/gecode_solverinstance.cpp"
+ (("600300") "600400"))
(substitute* "CMakeLists.txt"
(("find_package\\(([^ ]*).*\\)" all pkg)
(if (member pkg '("Gecode" "OsiCBC" "Threads"))
--
2.41.0
A
A
Andreas Enge wrote on 12 May 21:08 +0200
Re: [bug#70087] [PATCH 1/4] gnu: gecode: Update to development version 6.3.0.
(name . Herman Rimm)(address . herman@rimm.ee)
ZkETxxAlMKIbzPXz@jurong
Hello,

Am Sat, Mar 30, 2024 at 12:40:05PM +0100 schrieb Herman Rimm:
Toggle quote (10 lines)
> * gnu/packages/maths.scm (gecode): Update.
> - (version "6.2.0")
> + (version "6.3.0")
> (source (origin
> (method git-fetch)
> (uri (git-reference
> (url "https://github.com/Gecode/gecode")
> - (commit (string-append "release-" version))))
> + (commit "2d20e88cae176584b6e09d909aca3eb72ae76829")))

we normally only package the latest released version; indeed this dates
from 2019 and is 6.2.0 according to their webpage.
Is a newer package really needed? Why this commit from 2020, and not another
one from 2024? Their git repository is, let us say, unusual: The master
branch has not seen any commit after the 6.2.0 release except for a license
change. Work seems to be done in the origin/release/6.3.0 branch.

So without compelling reason, I would suggest to not do the update;
in any case it could not be called 6.3.0, since there is no such release.

Maybe joining issue
from last August to make a new release would be a path forward?

Andreas
H
H
Herman Rimm wrote on 14 May 09:31 +0200
(name . Andreas Enge)(address . andreas@enge.fr)
6yyxnjj2tcvelkavpi2h6erndzrdconkaol7nsczn5vujmurtq@4aaq7v4aqrt2
Hello,

On Sun, May 12, 2024 at 09:08:55PM +0200, Andreas Enge wrote:
Toggle quote (5 lines)
> Is a newer package really needed? Why this commit from 2020, and not another
> one from 2024? Their git repository is, let us say, unusual: The master
> branch has not seen any commit after the 6.2.0 release except for a license
> change. Work seems to be done in the origin/release/6.3.0 branch.

A new version is required because for e.g. [1] the current gecode gives:

$ minizinc --solver gecode magic_square.mzn
/gnu/store/nxk99lxxlsyjg1wy9xjcsyhx1904qy1h-minizinc-2.5.5/share/minizinc/std/nvalue_fn.mzn:7.57-67:
MiniZinc: type error: no function or predicate with this signature found: `nvalue(var int,array[$_] of var int)'
Cannot use the following functions or predicates with the same identifier:
function var int : nvalue(array[$_] of var int: x);
(requires 1 argument, but 2 given)
predicate nvalue(var int: n,array[int] of var int: x);
(argument 2 expects type array[int] of var int, but type array[$_] of var int given)
While the development version returns:

$ minizinc --solver gecode magic_square.mzn
Total: 15
2 7 6
9 5 1
4 3 8
----------

I don't remember why I specifically picked that commit, I could try
packaging at a more recent commit.

Toggle quote (2 lines)
> in any case it could not be called 6.3.0, since there is no such release.

Can I use the 'git-version' procedure in the updated package and create
a 'gecode/pinned' package which inherits from it for the 6.2.0 release?

Cheers,
Herman

A
A
Andreas Enge wrote on 14 May 13:44 +0200
(name . Herman Rimm)(address . herman@rimm.ee)
ZkNOn4GU0EP0j4uZ@jurong
Hello,

Am Tue, May 14, 2024 at 09:31:47AM +0200 schrieb Herman Rimm:
Toggle quote (3 lines)
> A new version is required because for e.g. [1] the current gecode gives:
> $ minizinc --solver gecode magic_square.mzn

thanks for the example! Actually you can also drop "--solver gecode", since
gecode is the default choice. And when doing
$ minizinc --solver coin-bc magic_square.mzn
it prints a solution.

So this is a good reason for updating gecode.
I do not know what would be a good commit; maybe the most recent one,
or anything before if that looks more stable. I will let you have
a look.

Toggle quote (4 lines)
> > in any case it could not be called 6.3.0, since there is no such release.
> Can I use the 'git-version' procedure in the updated package and create
> a 'gecode/pinned' package which inherits from it for the 6.2.0 release?

As I understand things, you use '(git-version "6.2.0" 1 commit-number)'
for the first Guix package created from a release after 6.2.0.
There is no reason to have two packages - only minizinc depends on it,
and this is actually requiring a new package. So indeed, just update
the package.

Andreas
A
A
Andreas Enge wrote on 15 May 12:12 +0200
(name . Herman Rimm)(address . herman@rimm.ee)
ZkSKlaYJ70Fj3uMx@jurong
Hello,

I have just pushed a gexpified version of your chuffed patch. Thanks!

Andreas
A
A
Andreas Enge wrote on 15 May 14:06 +0200
(name . Herman Rimm)(address . herman@rimm.ee)
ZkSlWrWqtrlivP__@jurong
And I have just pushed a gecode version based on the latest git commit
in the release/6.3.0 branch.

Unfortunately I had forgotten to test whether the dependent package minizinc
still builds, and it does not - neither the current version, nor 2.8.3, nor
the just released 2.8.4.

The last one fails like so:
/tmp/guix-build-minizinc-2.8.4.drv-0/source/solvers/gecode/gecode_solverinstance.cpp: In member function ‘void MiniZinc::GecodeSolverInstance::prepareEngine()’:
/tmp/guix-build-minizinc-2.8.4.drv-0/source/solvers/gecode/gecode_solverinstance.cpp:1350:54: error: no matching function for call to ‘Gecode::Driver::CombinedStop::create(int&, int&, int&, bool)’
1350 | engineOptions.stop = Driver::CombinedStop::create(nodeStop, failStop, timeStop, false);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /gnu/store/dhnd6kpwp5g1ycc3s9ycdccybapdfjxy-gecode-6.2.0-1.f7f0d7c/include/gecode/driver.hh:835,
from /tmp/guix-build-minizinc-2.8.4.drv-0/source/include/minizinc/solvers/gecode/fzn_space.hh:16,
from /tmp/guix-build-minizinc-2.8.4.drv-0/source/solvers/gecode/gecode_solverinstance.cpp:15:
/gnu/store/dhnd6kpwp5g1ycc3s9ycdccybapdfjxy-gecode-6.2.0-1.f7f0d7c/include/gecode/driver/script.hpp:98:5: note: candidate: ‘static Gecode::Search::Stop* Gecode::Driver::CombinedStop::create(long long unsigned int, long long unsigned int, double, long long unsigned int, bool)’
98 | create(unsigned long long int node,
| ^~~~~~
/gnu/store/dhnd6kpwp5g1ycc3s9ycdccybapdfjxy-gecode-6.2.0-1.f7f0d7c/include/gecode/driver/script.hpp:98:5: note: candidate expects 5 arguments, 4 provided

One solution would be to downgrade gecode to the commit that you provided
and tested minizinc with. Since you are probably familiar with the code,
do you see a better solution?

Andreas
A
A
Andreas Enge wrote on 15 May 14:39 +0200
(name . Herman Rimm)(address . herman@rimm.ee)
ZkStG0sHuOuf85lc@jurong
Am Wed, May 15, 2024 at 02:06:50PM +0200 schrieb Andreas Enge:
Toggle quote (3 lines)
> One solution would be to downgrade gecode to the commit that you provided
> and tested minizinc with.

I have done just this; now minizinc compiles and solves the magic square
example. I have also modernised the gecode package definition using gexps.

Andreas
A
A
Andreas Enge wrote on 15 May 15:08 +0200
(name . Herman Rimm)(address . herman@rimm.ee)
ZkSz0b1rOI4kvd9S@jurong
Hello,

I have now applied your patch to add chuffed to minizinc, and I have
gexpified this latter package.

An update of minizinc to 2.8.3 (or 2.8.4, released 5 days ago) does not
build; I think one would need to move to a different commit of gecode
(but not the latest one...).

I am closing the current bug. If you are motivated to look for a combination
of newer gecode and minizinc versions that work together, please feel free
to open a new bug.

Andreas
Closed
H
H
Herman Rimm wrote on 15 May 17:51 +0200
[PATCH v2 1/4] gnu: gecode: Update to 6.2.0-1.f7f0d7c.
(address . 70087@debbugs.gnu.org)
a5751f750c3aa223830e82826d4f3204c509c314.1715786322.git.herman@rimm.ee
* gnu/packages/maths.scm (gecode): Update to 6.2.0-1.f7f0d7c.
[version]: Use version.
[source]: Use commit.
[arguments]: Add patch-msc-and-version phase.
(minizinc)[arguments]: Copy provided gecode.msc file instead.

Change-Id: I5e89105f3fef61d6aa677a4a118225679220ce5d
---
gnu/packages/maths.scm | 174 +++++++++++++++++++----------------------
1 file changed, 82 insertions(+), 92 deletions(-)

Toggle diff (203 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index d551b751e6..48f43f264b 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -63,6 +63,7 @@
;;; Copyright © 2023 Jake Leporte <jakeleporte@outlook.com>
;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
;;; Copyright © 2023 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -2612,73 +2613,81 @@ (define-public clp
(license license:epl1.0)))
(define-public gecode
- (package
- (name "gecode")
- (version "6.2.0")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/Gecode/gecode")
- (commit (string-append "release-" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "0b1cq0c810j1xr2x9y9996p894571sdxng5h74py17c6nr8c6dmk"))
- (modules '((guix build utils)))
- (snippet
- '(begin
- ;; delete generated sources
- (for-each delete-file
- '("gecode/kernel/var-imp.hpp"
- "gecode/kernel/var-type.hpp"))))))
- (outputs '("out" "examples"))
- (build-system gnu-build-system)
- (arguments
- `(#:configure-flags
- (list (string-append "GLDFLAGS=-Wl,-rpath="
- (assoc-ref %outputs "out")
- "/lib")
- "--enable-examples=no")
- #:modules ((guix build gnu-build-system)
- (guix build utils)
- (ice-9 rdelim)
- (ice-9 popen))
- #:phases
- (modify-phases %standard-phases
- (add-after 'build 'build-examples
- (lambda* (#:key outputs #:allow-other-keys)
- (invoke "make" "compileexamples")))
- ;; The Makefile disrespects GLDFLAGS for some reason, so we have to
- ;; patch it ourselves... *sigh*
- (add-after 'install 'fix-rpath
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((libdir (string-append (assoc-ref outputs "out") "/lib")))
- (for-each
- (lambda (file)
- (let* ((pipe (open-pipe* OPEN_READ "patchelf"
- "--print-rpath" file))
- (line (read-line pipe)))
- (and (zero? (close-pipe pipe))
- (invoke "patchelf" "--set-rpath"
- (string-append libdir ":" line)
- file))))
- (find-files libdir ".*\\.so$")))))
- (add-after 'install 'install-examples
- (lambda* (#:key outputs #:allow-other-keys)
- (invoke "make" "installexamples"
- (string-append "bindir=" (assoc-ref outputs "examples")
- "/bin"))))
- ;; Tests depend on installed libraries.
- (delete 'check)
- (add-after 'fix-rpath 'check
- (assoc-ref %standard-phases 'check)))))
- (native-inputs
- (list patchelf perl sed))
- (home-page "https://www.gecode.org")
- (synopsis "Toolkit for developing constraint-based systems")
- (description "Gecode is a C++ toolkit for developing constraint-based
-systems and applications. It provides a modular and extensible solver.")
- (license license:expat)))
+ (let* ((commit "f7f0d7c273d6844698f01cec8229ebe0b66a016a")
+ (version (git-version "6.2.0" "1" commit)))
+ (package
+ (name "gecode")
+ (version version)
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Gecode/gecode")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "16gzwa64w90vifaflmii515rsrqclf2y7nziq621m4ad9cjgcixj"))
+ (modules '((guix build utils)))
+ ;; delete generated sources
+ (snippet '(for-each delete-file
+ '("gecode/kernel/var-imp.hpp"
+ "gecode/kernel/var-type.hpp")))))
+ (outputs '("out" "examples"))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:configure-flags
+ #~(list (string-append "GLDFLAGS=-Wl,-rpath="
+ (assoc-ref %outputs "out") "/lib")
+ "--enable-examples=no")
+ #:modules '((guix build gnu-build-system)
+ (guix build utils)
+ (ice-9 rdelim)
+ (ice-9 popen))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'configure 'patch-msc-and-version
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* "tools/flatzinc/gecode.msc.in"
+ (("\\.\\./../..") out)
+ (("\\.\\.")
+ (string-append out "/share/minizinc")))
+ (substitute* "configure"
+ (("(PACKAGE_[^0-9]*)[0-9\\.]+" all match)
+ (string-append match #$version))))))
+ (add-after 'build 'build-examples
+ (lambda _
+ (invoke "make" "compileexamples")))
+ ;; The Makefile disrespects GLDFLAGS for some reason, so
+ ;; we have to patch it ourselves... *sigh*
+ (add-after 'install 'fix-rpath
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (libdir (string-append out "/lib")))
+ (for-each
+ (lambda (file)
+ (let* ((pipe (open-pipe* OPEN_READ "patchelf"
+ "--print-rpath" file))
+ (line (read-line pipe)))
+ (and (zero? (close-pipe pipe))
+ (invoke "patchelf" "--set-rpath"
+ (string-append libdir ":" line)
+ file))))
+ (find-files libdir ".*\\.so$")))))
+ (add-after 'install 'install-examples
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((examples (assoc-ref outputs "examples"))
+ (bindir (format #f "bindir=~a/bin" examples)))
+ (invoke "make" "installexamples" bindir)))))))
+ (native-inputs (list patchelf perl sed))
+ (home-page "https://www.gecode.org")
+ (synopsis "Toolkit for developing constraint-based systems")
+ (description
+ "Gecode is a C++ toolkit for developing constraint-based systems
+and applications. It provides a modular and extensible solver.")
+ (license license:expat))))
(define-public libfixmath
(let ((commit "1416c9979635c69f344d3c1de84b3246001a6540")
@@ -4083,31 +4092,12 @@ (define-public minizinc
}"
port)
(newline port)))
-
- (mkdir-p (string-append pkgdatadir "/solvers"))
- (call-with-output-file (string-append pkgdatadir
- "/solvers/gecode.msc")
- (lambda (port)
- (format port
- "\
-{
- \"id\": \"org.gecode.gecode\",
- \"name\": \"Gecode\",
- \"description\": \"Gecode FlatZinc executable\",
- \"version\": ~s,
- \"mznlib\": ~s,
- \"executable\": ~s,
- \"supportsMzn\": false,
- \"supportsFzn\": true,
- \"needsSolns2Out\": true,
- \"needsMznExecutable\": false,
- \"needsStdlibDir\": false,
- \"isGUIApplication\": false
-}"
- (last (string-split gecode #\-))
- (string-append gecode "/share/gecode/mznlib")
- (string-append gecode "/bin/fzn-gecode"))
- (newline port)))))))))
+ (for-each
+ (lambda (solver)
+ (copy-recursively
+ (string-append solver "/share/minizinc/solvers")
+ (string-append pkgdatadir "/solvers")))
+ (list gecode))))))))
(native-inputs
(list bison flex))
(inputs

base-commit: 059c9ed104c91f7a537f369c4524b91d6cf8a13e
--
2.41.0
H
H
Herman Rimm wrote on 15 May 17:51 +0200
[PATCH v2 2/4] gnu: Add chuffed.
(address . 70087@debbugs.gnu.org)
5fb4a1d84959c6760592abda115dcaa663559a43.1715786322.git.herman@rimm.ee
* gnu/packages/maths.scm (chuffed): Add variable.

Change-Id: I77fc1ceb9caa42833689fba771010aeb38443e5e
---
gnu/packages/maths.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (49 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 48f43f264b..d245805ffb 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -305,6 +305,42 @@ (define-public calc
(home-page "http://www.isthe.com/chongo/tech/comp/calc/")
(license license:lgpl2.1)))
+(define-public chuffed
+ (package
+ (name "chuffed")
+ (version "0.13.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/chuffed/chuffed")
+ (commit version)))
+ (sha256
+ (base32
+ "164brmwn71p9gb2441kh7b1gzmy2sg7bjv5z00wjs9nw41qc908g"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f ; no 'check' target
+ #:modules '((guix build cmake-build-system)
+ (guix build utils))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'build 'patch-msc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* "chuffed.msc"
+ (("\\.\\./../..") out)
+ (("\\.\\.")
+ (string-append out "/share/minizinc")))))))))
+ (synopsis "Lazy clause generation solver")
+ (description
+ "Chuffed is a state of the art lazy clause solver designed from the
+ground up with lazy clause generation in mind. Lazy clause generation
+is a hybrid approach to constraint solving that combines features of
+finite domain propagation and Boolean satisfiability.")
+ (home-page "https://github.com/chuffed/chuffed")
+ (license license:expat)))
+
(define-public coda
(package
(name "coda")
--
2.41.0
H
H
Herman Rimm wrote on 15 May 17:51 +0200
[PATCH v2 3/4] gnu: minizinc: Add chuffed backend.
(address . 70087@debbugs.gnu.org)
ce2a3f62847271190904003a02c0e4e93ff92741.1715786322.git.herman@rimm.ee
* gnu/packages/maths.scm (minizinc): Add backend.

Change-Id: If178a7585d70eb4b6f3223f5f6b2f34d9d2f2257
---
gnu/packages/maths.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index d245805ffb..ec15af22c5 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4113,8 +4113,9 @@ (define-public minizinc
(add-after 'install 'install-solver-configs
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((gecode (assoc-ref inputs "gecode"))
+ (chuffed (assoc-ref inputs "chuffed"))
(pkgdatadir (string-append (assoc-ref outputs "out")
- "/share/minizinc")))
+ "/share/minizinc")))
(call-with-output-file (string-append pkgdatadir
"/Preferences.json")
(lambda (port)
@@ -4133,11 +4134,11 @@ (define-public minizinc
(copy-recursively
(string-append solver "/share/minizinc/solvers")
(string-append pkgdatadir "/solvers")))
- (list gecode))))))))
+ (list chuffed gecode))))))))
(native-inputs
(list bison flex))
(inputs
- (list cbc gecode zlib))
+ (list cbc chuffed gecode zlib))
(home-page "https://www.minizinc.org")
(synopsis "High-level constraint modeling language")
(description "MiniZinc is a high-level modeling language for constraint
--
2.41.0
H
H
Herman Rimm wrote on 15 May 17:51 +0200
[PATCH v2 4/4] gnu: minizinc: Update to 2.8.4.
(address . 70087@debbugs.gnu.org)
04a6b1402fe44ed8c6475af624516f17050f554b.1715786322.git.herman@rimm.ee
* gnu/packages/maths.scm (minizinc): Update to 2.8.4.

Change-Id: I503fd004b38abaac8829a2cb94c182b001d83763
---
gnu/packages/maths.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index ec15af22c5..b9dfb9d6f8 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4040,7 +4040,7 @@ (define-public metamath
(define-public minizinc
(package
(name "minizinc")
- (version "2.5.5")
+ (version "2.8.4")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -4049,7 +4049,7 @@ (define-public minizinc
(file-name (git-file-name name version))
(sha256
(base32
- "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
+ "03iliizyadd0wvx6a63rg22lb6p4m6krhlpfm2hfzwj66y3a76j6"))
(modules '((guix build utils)
(ice-9 ftw)
(srfi srfi-1)))
--
2.41.0
A
A
Andreas Enge wrote on 15 May 19:08 +0200
Re: [bug#70087] [PATCH v2 1/4] gnu: gecode: Update to 6.2.0-1.f7f0d7c.
(name . Herman Rimm)(address . herman@rimm.ee)
ZkTsFXbsH4IQY5nG@jurong
Hello Herman,

it looks like we have worked in parallel on this patchset, sorry for this!
With my previous commits to master, your v2 does not apply any more.

I have updated chuffed to version 0.13.2, which covers your patch 2.
Your patch 3 has already been applied in a form derived from your v1.
I have compiled minizinc with the new chuffed, and could use them together
to solve the magic square. So we are in a working and consistent state.

Could you please send a v3 of your patches 1 and 4, based on current
master? I suppose patch 4 can remain as it is.
For patch 1, the new revision should then be 3, as we are currently at 2.
As written above, updating minizinc and gecode simultaneously to their
latest versions did not work out of the box for me. I suppose that these
two features:

Am Wed, May 15, 2024 at 05:51:22PM +0200 schrieb Herman Rimm:
Toggle quote (3 lines)
> [arguments]: Add patch-msc-and-version phase.
> (minizinc)[arguments]: Copy provided gecode.msc file instead.

solve the problem?

I have reopened the bug, and will let you go ahead now; I think you
are in a better position than me for adapting your patches to the
current master.

Thanks,

Andreas
H
H
Herman Rimm wrote on 15 May 20:01 +0200
[PATCH 0/3] Update minizinc and solvers.
(address . 70087@debbugs.gnu.org)
cover.1715795372.git.herman@rimm.ee
Hello Andreas,

I fixed the gecode example installation as well. If you make any
adjustments, please keep the line length at or below 72 chars.

Thanks,
Herman

Herman Rimm (3):
gnu: gecode: Update to 6.2.0-1.f7f0d7c.
gnu: chuffed: Update to 0.13.2.
gnu: minizinc: Update to 2.8.4.

gnu/packages/maths.scm | 139 +++++++++++++++++------------------------
1 file changed, 59 insertions(+), 80 deletions(-)


base-commit: 9d42741693c02396be54ccf548b4c36249e94ef2
--
2.41.0
H
H
Herman Rimm wrote on 15 May 20:01 +0200
[PATCH 2/3] gnu: chuffed: Update to 0.13.2.
(address . 70087@debbugs.gnu.org)
9070957d6d2c9f4a0361d1f6e35f0a936643cdb1.1715795372.git.herman@rimm.ee
* gnu/packages/maths.scm (chuffed): Update to 0.13.2.

Change-Id: I77fc1ceb9caa42833689fba771010aeb38443e5e
---
gnu/packages/maths.scm | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)

Toggle diff (52 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 6cb3bdbfb0..2aa7ccaa7a 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -309,7 +309,7 @@ (define-public calc
(define-public chuffed
(package
(name "chuffed")
- (version "0.13.1")
+ (version "0.13.2")
(source
(origin
(method git-fetch)
@@ -317,23 +317,21 @@ (define-public chuffed
(url "https://github.com/chuffed/chuffed")
(commit version)))
(sha256
- (base32 "1c28q166qh84q4i5wz77fqvw7kld3fmhd245sgdvyxcbjpi2wr0m"))))
+ (base32
+ "164brmwn71p9gb2441kh7b1gzmy2sg7bjv5z00wjs9nw41qc908g"))))
(build-system cmake-build-system)
- (synopsis "Lazy clause generation solver")
(arguments
- (list
- #:tests? #f ;no 'test' target
- #:phases #~(modify-phases %standard-phases
- (add-before 'build 'patch-msc
- (lambda _
- (let ((out #$output))
- (substitute* "chuffed.msc"
- ;; Replace fzn-chuffed and chuffed paths
- ;; before build.
- (("\\.\\./../..")
- out)
- (("\\.\\.")
- (string-append out "/share/minizinc")))))))))
+ (list #:tests? #f ;no 'test' target
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'build 'patch-msc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* "chuffed.msc"
+ (("\\.\\./../..") out)
+ (("\\.\\.")
+ (string-append out "/share/minizinc")))))))))
+ (synopsis "Lazy clause generation solver")
(description
"Chuffed is a state of the art lazy clause solver designed from the
ground up with lazy clause generation in mind. Lazy clause generation
--
2.41.0
H
H
Herman Rimm wrote on 15 May 20:02 +0200
[PATCH 3/3] gnu: minizinc: Update to 2.8.4.
(address . 70087@debbugs.gnu.org)
9d4badd9df6c5d64a9ada298d0ee59629a97ef4b.1715795372.git.herman@rimm.ee
* gnu/packages/maths.scm (minizinc): Update to 2.8.4.

Change-Id: I503fd004b38abaac8829a2cb94c182b001d83763
---
gnu/packages/maths.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 2aa7ccaa7a..a82e28e6a0 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4090,7 +4090,7 @@ (define-public metamath
(define-public minizinc
(package
(name "minizinc")
- (version "2.5.5")
+ (version "2.8.4")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -4099,7 +4099,7 @@ (define-public minizinc
(file-name (git-file-name name version))
(sha256
(base32
- "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp"))
+ "03iliizyadd0wvx6a63rg22lb6p4m6krhlpfm2hfzwj66y3a76j6"))
(modules '((guix build utils)
(ice-9 ftw)
(srfi srfi-1)))
--
2.41.0
H
H
Herman Rimm wrote on 15 May 20:01 +0200
[PATCH 1/3] gnu: gecode: Update to 6.2.0-1.f7f0d7c.
(address . 70087@debbugs.gnu.org)
5f72bf3db2123b5e1a7b724a09b87325661ad103.1715795372.git.herman@rimm.ee
* gnu/packages/maths.scm (gecode): Update to 6.2.0-1.f7f0d7c.
[version]: Use version.
[arguments]: Add patch-msc-and-version phase. Install examples to the
examples output again.
(minizinc)[arguments]: Copy provided gecode.msc file instead.

Change-Id: I5e89105f3fef61d6aa677a4a118225679220ce5d
---
gnu/packages/maths.scm | 105 +++++++++++++++++------------------------
1 file changed, 43 insertions(+), 62 deletions(-)

Toggle diff (153 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 1feabe5f1c..6cb3bdbfb0 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2703,28 +2703,26 @@ (define-public clp
(license license:epl1.0)))
(define-public gecode
- ;; The current release is not compatible with minizinc anymore.
- ;; Use a commit that has been tested with minizinc.
- (let ((commit "2d20e88cae176584b6e09d909aca3eb72ae76829")
- (revision "2"))
+ (let* ((commit "f7f0d7c273d6844698f01cec8229ebe0b66a016a")
+ (version (git-version "6.2.0" "1" commit)))
(package
(name "gecode")
- (version (git-version "6.2.0" revision commit))
+ (version version)
(source
(origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/Gecode/gecode")
- (commit commit)))
+ (url "https://github.com/Gecode/gecode")
+ (commit commit)))
(file-name (git-file-name name version))
(sha256
- (base32 "0hf7hd7m5p26xwn8f561f0gn2a6q33xz818jg3ivmvp2ysmmmm4r"))
+ (base32
+ "16gzwa64w90vifaflmii515rsrqclf2y7nziq621m4ad9cjgcixj"))
(modules '((guix build utils)))
- (snippet '(begin
- ;; delete generated sources
- (for-each delete-file
- '("gecode/kernel/var-imp.hpp"
- "gecode/kernel/var-type.hpp"))))))
+ ;; delete generated sources
+ (snippet '(for-each delete-file
+ '("gecode/kernel/var-imp.hpp"
+ "gecode/kernel/var-type.hpp")))))
(outputs '("out" "examples"))
(build-system gnu-build-system)
(arguments
@@ -2738,6 +2736,16 @@ (define-public gecode
(ice-9 popen))
#:phases
#~(modify-phases %standard-phases
+ (add-before 'configure 'patch-msc-and-version
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* "tools/flatzinc/gecode.msc.in"
+ (("\\.\\./../..") out)
+ (("\\.\\.")
+ (string-append out "/share/minizinc")))
+ (substitute* "configure"
+ (("(PACKAGE_[^0-9]*)[0-9\\.]+" all match)
+ (string-append match #$version))))))
(add-after 'build 'build-examples
(lambda _
(invoke "make" "compileexamples")))
@@ -2746,33 +2754,27 @@ (define-public gecode
(add-after 'install 'fix-rpath
(lambda _
(let ((libdir (string-append #$output "/lib")))
- (for-each (lambda (file)
- (let* ((pipe (open-pipe* OPEN_READ
- "patchelf"
- "--print-rpath" file))
- (line (read-line pipe)))
- (and (zero? (close-pipe pipe))
- (invoke "patchelf" "--set-rpath"
- (string-append libdir
- ":" line)
- file))))
- (find-files libdir ".*\\.so$")))))
+ (for-each
+ (lambda (file)
+ (let* ((pipe (open-pipe* OPEN_READ "patchelf"
+ "--print-rpath" file))
+ (line (read-line pipe)))
+ (and (zero? (close-pipe pipe))
+ (invoke "patchelf" "--set-rpath"
+ (string-append libdir ":" line)
+ file))))
+ (find-files libdir ".*\\.so$")))))
(add-after 'install 'install-examples
- (lambda _
- (invoke "make" "installexamples"
- (string-append "bindir="
- #$output "/bin"))))
- ;; Tests depend on installed libraries.
- (delete 'check)
- (add-after 'fix-rpath 'check
- (assoc-ref %standard-phases
- 'check)))))
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((examples (assoc-ref outputs "examples"))
+ (bindir (format #f "bindir=~a/bin" examples)))
+ (invoke "make" "installexamples" bindir)))))))
(native-inputs (list patchelf perl sed))
(home-page "https://www.gecode.org")
(synopsis "Toolkit for developing constraint-based systems")
(description
- "Gecode is a C++ toolkit for developing constraint-based
-systems and applications. It provides a modular and extensible solver.")
+ "Gecode is a C++ toolkit for developing constraint-based systems
+and applications. It provides a modular and extensible solver.")
(license license:expat))))
(define-public libfixmath
@@ -4180,33 +4182,12 @@ (define-public minizinc
}"
port)
(newline port)))
-
- (copy-recursively
- (string-append chuffed "/share/minizinc/solvers")
- (string-append pkgdatadir "/solvers"))
- (call-with-output-file (string-append pkgdatadir
- "/solvers/gecode.msc")
- (lambda (port)
- (format port
- "\
-{
- \"id\": \"org.gecode.gecode\",
- \"name\": \"Gecode\",
- \"description\": \"Gecode FlatZinc executable\",
- \"version\": ~s,
- \"mznlib\": ~s,
- \"executable\": ~s,
- \"supportsMzn\": false,
- \"supportsFzn\": true,
- \"needsSolns2Out\": true,
- \"needsMznExecutable\": false,
- \"needsStdlibDir\": false,
- \"isGUIApplication\": false
-}"
- (last (string-split gecode #\-))
- (string-append gecode "/share/gecode/mznlib")
- (string-append gecode "/bin/fzn-gecode"))
- (newline port)))))))))
+ (for-each
+ (lambda (solver)
+ (copy-recursively
+ (string-append solver "/share/minizinc/solvers")
+ (string-append pkgdatadir "/solvers")))
+ (list gecode chuffed))))))))
(native-inputs
(list bison flex))
(inputs
--
2.41.0
A
A
Andreas Enge wrote on 15 May 21:03 +0200
Re: [bug#70087] [PATCH 0/3] Update minizinc and solvers.
(name . Herman Rimm)(address . herman@rimm.ee)
ZkUG961fHd4dVVko@jurong
Hello,

Am Wed, May 15, 2024 at 08:01:57PM +0200 schrieb Herman Rimm:
Toggle quote (4 lines)
> gnu: gecode: Update to 6.2.0-1.f7f0d7c.
> gnu: chuffed: Update to 0.13.2.
> gnu: minizinc: Update to 2.8.4.

I have just reverted my update of chuffed to 0.13.2 on master, so that your
patch series applies cleanly and QA will pick it up; it will also result in
you being credited for the update.

To anybody continuing work on this patchset, notice that the line
(file-name (git-file-name name version))
should be added to the chuffed package.

Andreas
A
A
Andreas Enge wrote on 22 May 17:12 +0200
(name . Herman Rimm)(address . herman@rimm.ee)
Zk4LZ-QlG6UQefQV@jurong
Am Wed, May 15, 2024 at 09:03:19PM +0200 schrieb Andreas Enge:
Toggle quote (4 lines)
> To anybody continuing work on this patchset, notice that the line
> (file-name (git-file-name name version))
> should be added to the chuffed package.

Personally, I will not be available for about two weeks; I can have a look
again at this patchset after that, but if another committer wants to go
ahead, please feel welcome.

Andreas
L
L
Ludovic Courtès wrote on 2 Jun 12:17 +0200
(name . Andreas Enge)(address . andreas@enge.fr)
87h6eblkcp.fsf@gnu.org
Hey Herman and all,

I went ahead and pushed this revision as
0bd5e1bf9290894d2a56e217f3eed3ecc2c96103.

Thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 70087
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