From 3cdb16cb5055794fedb12cbc4415a81a3122df88 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 23 Sep 2021 12:06:13 +0200 Subject: gnu: fp16: Install Python files in the site directory. * gnu/packages/maths.scm (fp16)[arguments]: New field. --- gnu/packages/maths.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'gnu/packages/maths.scm') diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 8583781f2d..6d5918a9d5 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -6891,6 +6891,29 @@ when an application performs repeated divisions by the same divisor.") "05mm4vrxsac35hjf5djif9r6rdxj9ippg97ia3p6q6b8lrp7srwv")) (patches (search-patches "fp16-system-libraries.patch")))) (build-system cmake-build-system) + (arguments + `(#:imported-modules ((guix build python-build-system) + ,@%cmake-build-system-modules) + #:modules (((guix build python-build-system) + #:select (site-packages)) + (guix build cmake-build-system) + (guix build utils)) + #:phases (modify-phases %standard-phases + (add-after 'install 'move-python-files + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Python files get installed to $includedir (!). + ;; Move them to the usual Python site directory. + (let* ((out (assoc-ref outputs "out")) + (include (string-append out "/include")) + (site (site-packages inputs outputs)) + (target (string-append site "/fp16"))) + (mkdir-p target) + (for-each (lambda (file) + (rename-file file + (string-append target "/" + (basename + file)))) + (find-files include "\\.py$")))))))) (native-inputs `(("python-wrapper" ,python-wrapper))) (inputs -- cgit v1.2.3 From 93cef6e768293225654bef4d0562268bdfe63e79 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Sat, 24 Jul 2021 14:30:55 +0200 Subject: gnu: Add gecode. * gnu/packages/maths.scm (gecode): New variable. --- gnu/packages/maths.scm | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'gnu/packages/maths.scm') diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 6d5918a9d5..0d8d411eb7 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2045,6 +2045,77 @@ linear and quadratic objectives. There are limited facilities for nonlinear and quadratic objectives using the Simplex algorithm.") (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 + `(("patchelf" ,patchelf) + ("perl" ,perl) + ("sed" ,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 libflame (package (name "libflame") -- cgit v1.2.3 From 95c88e381be838b8a2529eb616ea3664cbc07731 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Sun, 18 Jul 2021 17:03:51 +0200 Subject: gnu: Add minizinc. * gnu/packages/maths.scm (minizinc): New variable. --- gnu/packages/maths.scm | 130 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) (limited to 'gnu/packages/maths.scm') diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 0d8d411eb7..164924b6af 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -3094,6 +3094,136 @@ the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath book.") (license license:gpl2+))) +(define-public minizinc + (package + (name "minizinc") + (version "2.5.5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/MiniZinc/libminizinc") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp")) + (modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-1))) + (snippet + '(begin + ;; Do not advertise proprietary solvers + (with-directory-excursion "cmake/targets" + (let ((targets '("libminizinc_fzn.cmake" + "libminizinc_gecode.cmake" + "libminizinc_mip.cmake" + "libminizinc_nl.cmake" + "libminizinc_osicbc.cmake" + "libminizinc_parser.cmake" + "libmzn.cmake" + "minizinc.cmake" + "mzn2doc.cmake"))) + (for-each delete-file + (remove + (lambda (file) + (member file (cons* "." ".." targets))) + (scandir "."))) + (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 + (lambda (file) + (member file '("." ".." + "MIP_osicbc_solverfactory.hh" + "MIP_osicbc_wrap.hh" + "MIP_solverinstance.hh" + "MIP_solverinstance.hpp" + "MIP_wrap.hh"))) + (scandir ".")))) + (with-directory-excursion "solvers/MIP" + (for-each delete-file + (remove + (lambda (file) + (member file '("." ".." + "MIP_osicbc_solverfactory.cpp" + "MIP_osicbc_wrap.cpp" + "MIP_solverinstance.cpp" + "MIP_wrap.cpp"))) + (scandir ".")))) + (substitute* "CMakeLists.txt" + (("find_package\\(([^ ]*).*\\)" all pkg) + (if (member pkg '("Gecode" "OsiCBC" "Threads")) + all + ""))) + ;; TODO: swap out miniz for zlib + #t)))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; no ‘check’ target + #:modules ((guix build cmake-build-system) + (guix build utils) + (srfi srfi-1)) + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-solver-configs + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((gecode (assoc-ref inputs "gecode")) + (pkgdatadir (string-append (assoc-ref outputs "out") + "/share/minizinc"))) + (call-with-output-file (string-append pkgdatadir + "/Preferences.json") + (lambda (port) + (display "\ +{ + \"tagDefaults\": [ + [\"\", \"org.gecode.gecode\"], + [\"gecode\", \"org.gecode.gecode\"] + ], + \"solverDefaults\": [] +}" + 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))))))))) + (native-inputs + `(("bison" ,bison) + ("flex" ,flex))) + (inputs + `(("cbc" ,cbc) + ("gecode" ,gecode) + ("zlib" ,zlib))) + (home-page "https://www.minizinc.org") + (synopsis "High-level constraint modeling language") + (description "MiniZinc is a high-level modeling language for constraint +satisfaction and optimization problems. Models are compiled to FlatZinc, a +language understood by many solvers.") + (license license:mpl2.0))) + (define-public mumps (package (name "mumps") -- cgit v1.2.3 From 16e3f8d90a424abf17be94d7ae216d9feb932e8a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 7 Oct 2021 12:52:44 +0200 Subject: gnu: mcrl2: Update hash of modified-in-place tarball. Fixes . * gnu/packages/maths.scm (mcrl2)[source]: Update hash. --- gnu/packages/maths.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/maths.scm') diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 164924b6af..95ce13f312 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -5776,7 +5776,7 @@ reduction.") version ".tar.gz")) (sha256 (base32 - "0db9wgy9spwm76mgfisnifrlg69y9cadjgxjr4gdwzfgg6wgqf6d")))) + "1xgx3cd57vc7gbjic24j1q2za6j3ybz6nk4afvvpbwsf33xnlf4v")))) (inputs `(("boost" ,boost) ("glu" ,glu) -- cgit v1.2.3 From 26dd2321febf5290cce2f26d8f341b0e85607ebd Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 8 Oct 2021 03:47:21 +0200 Subject: gnu: why3: Update to 1.4.0. * gnu/packages/maths.scm (why3): Update to 1.4.0. --- gnu/packages/maths.scm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'gnu/packages/maths.scm') diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 95ce13f312..2c7202b4e0 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -6903,17 +6903,21 @@ numeric differences and differences in numeric formats.") (define-public why3 (package (name "why3") - (version "1.3.3") + (version "1.4.0") (source (origin - (method url-fetch) - (uri (string-append "https://gforge.inria.fr/frs/download.php/file" - "/38367/why3-" version ".tar.gz")) + (method git-fetch) + (uri (git-reference + (url "https://gitlab.inria.fr/why3/why3") + (commit version))) + (file-name (git-file-name name version)) (sha256 (base32 - "1n0a2nn1gnk0zg339lh698g4wpk7m8m1vyi2yvifd5adqvk4milw")))) + "0pfsiddnk26f384wbazfpgzh1n1ibf3xq101q74mxvczi7z0a791")))) (build-system ocaml-build-system) (native-inputs - `(("coq" ,coq) + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("coq" ,coq) ("ocaml" ,ocaml) ("which" ,which))) (propagated-inputs @@ -6929,10 +6933,12 @@ numeric differences and differences in numeric formats.") (arguments `(#:phases (modify-phases %standard-phases - (add-before 'configure 'fix-configure + (add-before 'configure 'bootstrap (lambda _ + (invoke "./autogen.sh") (setenv "CONFIG_SHELL" (which "sh")) (substitute* "configure" + (("#! /bin/sh") (string-append "#!" (which "sh"))) ;; find ocaml-num in the correct directory (("\\$DIR/nums.cma") "$DIR/num.cma") (("\\$DIR/num.cmi") "$DIR/core/num.cmi")) -- cgit v1.2.3 From 6516e88fe34f4cb12658651ef69e462fbc7ffe72 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 8 Oct 2021 03:48:35 +0200 Subject: gnu: frama-c: Update to 23.1. * gnu/packages/maths.scm (frama-c): Update to 23.1. --- gnu/packages/maths.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu/packages/maths.scm') diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 2c7202b4e0..038ca5518c 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -6970,14 +6970,14 @@ of C, Java, or Ada programs.") (define-public frama-c (package (name "frama-c") - (version "22.0") + (version "23.1") (source (origin (method url-fetch) (uri (string-append "http://frama-c.com/download/frama-c-" - version "-Titanium.tar.gz")) + version "-Vanadium.tar.gz")) (sha256 (base32 - "1mq1fijka95ydrla486yr4w6wdl9l7vmp512s1q00b0p6lmfwmkh")))) + "1rgkq9sg436smw005ag0j6y3xryhjn18a07m5wjfrfp0s1438nnj")))) (build-system ocaml-build-system) (arguments `(#:tests? #f; no test target in Makefile -- cgit v1.2.3