all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#50933] [PATCH 1/3] gnu: Add libpotassco.
  2021-10-01  9:51 [bug#50933] [PATCH 0/3] Add clingo Liliana Marie Prikler
@ 2021-09-25  9:51 ` Liliana Marie Prikler
  2021-09-25 11:16 ` [bug#50933] [PATCH 2/3] gnu: Add clasp Liliana Marie Prikler
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Liliana Marie Prikler @ 2021-09-25  9:51 UTC (permalink / raw)
  To: 50933

* gnu/packages/maths.scm (libpotassco): New variable.
---
 gnu/packages/maths.scm | 49 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 164924b6af..dbb149db53 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2194,6 +2194,55 @@ Computational Engineering and Sciences} at The University of Texas at Austin.
 includes a complete LAPACK implementation.")
     (license license:bsd-3)))
 
+(define-public libpotassco
+  ;; No public release, update together with clasp
+  (let ((revision "1")
+        (commit "2f9fb7ca2c202f1b47643aa414054f2f4f9c1821"))
+    (package
+      (name "libpotassco")
+      (version (git-version "0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/potassco/libpotassco")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1c32f9gqclf7qx07lpx8wd720vfhkjqhzc6nyy8mjmgwpmb3iyyn"))))
+      (arguments
+       `(#:configure-flags '("-DLIB_POTASSCO_BUILD_TESTS=on"
+                             "-DLIB_POTASSCO_INSTALL_LIB=on"
+                             "-DBUILD_SHARED_LIBS=on")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'patch-cmake
+             (lambda _
+               (substitute* "CMakeLists.txt"
+                 ;; clasp expects lowercase potassco and include directory is
+                 ;; lowercase as well, so let's use that
+                 (("\"cmake/Potassco\"") "\"cmake/potassco\"")
+                 (("PotasscoConfig\\.cmake") "potassco-config.cmake")
+                 (("PotasscoConfigVersion\\.cmake")
+                  "potassco-config-version.cmake"))
+               (rename-file "cmake/PotasscoConfig.cmake.in"
+                            "cmake/potassco-config.cmake.in"))))))
+      (build-system cmake-build-system)
+      (home-page "https://potassco.org/")
+      (synopsis "Utility library for Potassco's projects")
+      (description "@code{libpotassco} is a utility library providing functions
+and datatypes for
+@itemize
+@item parsing, writing, and converting logic programs in aspif and smodels
+format,
+@item passing information between a grounder and a solver,
+@item and defining and parsing command-line options and for creating
+command-line applications.
+@end itemize
+Furthermore, it comes with the tool @command{lpconvert} that converts either
+between aspif and smodels format or to a human-readable text format.")
+      (license license:expat))))
+
 (define-public ceres
   (package
     (name "ceres-solver")
-- 
2.33.0






^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#50933] [PATCH 2/3] gnu: Add clasp.
  2021-10-01  9:51 [bug#50933] [PATCH 0/3] Add clingo Liliana Marie Prikler
  2021-09-25  9:51 ` [bug#50933] [PATCH 1/3] gnu: Add libpotassco Liliana Marie Prikler
@ 2021-09-25 11:16 ` Liliana Marie Prikler
  2021-10-01  9:47 ` [bug#50933] [PATCH 3/3] gnu: Add clingo Liliana Marie Prikler
  2021-10-24 18:44 ` bug#50933: [PATCH 0/3] " Liliana Marie Prikler
  3 siblings, 0 replies; 5+ messages in thread
From: Liliana Marie Prikler @ 2021-09-25 11:16 UTC (permalink / raw)
  To: 50933

* gnu/packages/maths.scm (clasp): New variable.
---
 gnu/packages/maths.scm | 43 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index dbb149db53..f9790dd64a 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2243,6 +2243,49 @@ Furthermore, it comes with the tool @command{lpconvert} that converts either
 between aspif and smodels format or to a human-readable text format.")
       (license license:expat))))
 
+(define-public clasp
+  (package
+    (name "clasp")
+    (version "3.3.6")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/potassco/clasp")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0rahqiq530jckvx717858h1q5p8znp1kb6sjm95p8blkr4n3pvmj"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags '("-DCLASP_BUILD_TESTS=on"
+                           "-DCLASP_INSTALL_LIB=on"
+                           "-DCLASP_USE_LOCAL_LIB_POTASSCO=off"
+                           "-DBUILD_SHARED_LIBS=on")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-cmake
+           (lambda _
+             (substitute* "CMakeLists.txt"
+               ;; Use lowercase to be consistent with libpotassco
+               (("\"cmake/Clasp\"") "\"cmake/clasp\"")
+               (("ClaspConfig\\.cmake") "clasp-config.cmake")
+               (("ClaspConfigVersion\\.cmake")
+                "clasp-config-version.cmake"))
+             (substitute* "cmake/ClaspConfig.cmake.in"
+               (("find_package\\(Potassco") "find_package(potassco"))
+             (rename-file "cmake/ClaspConfig.cmake.in"
+                          "cmake/clasp-config.cmake.in"))))))
+    (inputs
+     `(("libpotassco" ,libpotassco)))
+    (home-page "https://potassco.org/")
+    (synopsis "Answer set solver")
+    (description "clasp is an answer set solver for (extended) normal and
+disjunctive logic programs.  The primary algorithm of clasp relies on
+conflict-driven nogood learning, a technique that proved very successful for
+satisfiability checking (SAT).")
+    (license license:expat)))
+
 (define-public ceres
   (package
     (name "ceres-solver")
-- 
2.33.0






^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#50933] [PATCH 3/3] gnu: Add clingo.
  2021-10-01  9:51 [bug#50933] [PATCH 0/3] Add clingo Liliana Marie Prikler
  2021-09-25  9:51 ` [bug#50933] [PATCH 1/3] gnu: Add libpotassco Liliana Marie Prikler
  2021-09-25 11:16 ` [bug#50933] [PATCH 2/3] gnu: Add clasp Liliana Marie Prikler
@ 2021-10-01  9:47 ` Liliana Marie Prikler
  2021-10-24 18:44 ` bug#50933: [PATCH 0/3] " Liliana Marie Prikler
  3 siblings, 0 replies; 5+ messages in thread
From: Liliana Marie Prikler @ 2021-10-01  9:47 UTC (permalink / raw)
  To: 50933

* gnu/packages/maths.scm (clingo): New variable.
---
 gnu/packages/maths.scm | 65 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index f9790dd64a..4baca52007 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2286,6 +2286,71 @@ conflict-driven nogood learning, a technique that proved very successful for
 satisfiability checking (SAT).")
     (license license:expat)))
 
+(define-public clingo
+  (package
+    (name "clingo")
+    (version "5.5.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/potassco/clingo")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0rfjwkcwm0mmf3r4i7asyjwb6cia4i7px7fn2kdbi9j85qvas4pb"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags `("-DCLINGO_BUILD_TESTS=on"
+                           "-DCLINGO_INSTALL_LIB=on"
+                           "-DCLINGO_BUILD_STATIC=off"
+                           "-DCLINGO_BUILD_SHARED=on"
+                           ;; XXX: Clingo requries private headers and
+                           ;;      sources from clasp
+                           ,(string-append
+                             "-DCLASP_SOURCE_DIR="
+                             (assoc-ref %build-inputs "clasp-src")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-cmake
+           (lambda _
+             (substitute* "CMakeLists.txt"
+               (("add_subdirectory\\(clasp\\)")
+                "find_package(clasp REQUIRED)"))
+             (substitute* "libclingo/CMakeLists.txt"
+               (("\"cmake/Clingo\"") "\"cmake/clingo\"")
+               (("ClingoConfig\\.cmake") "clingo-config.cmake")
+               (("ClingoConfigVersion\\.cmake")
+                "clingo-config-version.cmake"))
+             (substitute* "cmake/ClingoConfig.cmake.in"
+               (("find_package\\(Clasp") "find_package(clasp"))
+             (rename-file "cmake/ClingoConfig.cmake.in"
+                          "cmake/clingo-config.cmake.in")))
+         (add-after 'unpack 'skip-failing-tests
+           (lambda _
+             (with-directory-excursion "libclingo/tests"
+               (substitute* "CMakeLists.txt"
+                 (("COMMAND test_clingo" all)
+                  (string-append all
+                                 " -f "
+                                 "\"${CMAKE_CURRENT_SOURCE_DIR}/good.txt\"")))
+               (call-with-output-file "good.txt"
+                 (lambda (port)
+                   (for-each (lambda (test) (format port "~s~%" test))
+                             '("parse-ast-v2" "add-ast-v2" "build-ast-v2"
+                               "unpool-ast-v2" "parse_term"
+                               "propagator" "propgator-sequence-mining"
+                               "symbol" "visitor"))))))))))
+    (inputs
+     `(("clasp" ,clasp)
+       ("libpotassco" ,libpotassco)))
+    (native-inputs
+     `(("clasp-src" ,(package-source clasp))))
+    (home-page "https://potassco.org/")
+    (synopsis "Grounder and solver for logic programs")
+    (description "Clingo computes answer sets for a given logic program.")
+    (license license:expat)))
+
 (define-public ceres
   (package
     (name "ceres-solver")
-- 
2.33.0






^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#50933] [PATCH 0/3] Add clingo
@ 2021-10-01  9:51 Liliana Marie Prikler
  2021-09-25  9:51 ` [bug#50933] [PATCH 1/3] gnu: Add libpotassco Liliana Marie Prikler
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Liliana Marie Prikler @ 2021-10-01  9:51 UTC (permalink / raw)
  To: 50933

This patch adds a package for clingo ad its dependencies.  I haven't
tested clingo itself (I did test clasp however) and the test suite has
two failing assertion in the solver category, but as far as I can see
it ought to work mostly.

Regards,
Liliana

Liliana Marie Prikler (3):
  gnu: Add libpotassco.
  gnu: Add clasp.
  gnu: Add clingo.

 gnu/packages/maths.scm | 157 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 157 insertions(+)

-- 
2.33.0






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#50933: [PATCH 0/3] Add clingo
  2021-10-01  9:51 [bug#50933] [PATCH 0/3] Add clingo Liliana Marie Prikler
                   ` (2 preceding siblings ...)
  2021-10-01  9:47 ` [bug#50933] [PATCH 3/3] gnu: Add clingo Liliana Marie Prikler
@ 2021-10-24 18:44 ` Liliana Marie Prikler
  3 siblings, 0 replies; 5+ messages in thread
From: Liliana Marie Prikler @ 2021-10-24 18:44 UTC (permalink / raw)
  To: 50933-done

Am Freitag, den 01.10.2021, 11:51 +0200 schrieb Liliana Marie Prikler:
> This patch adds a package for clingo ad its dependencies.  I haven't
> tested clingo itself (I did test clasp however) and the test suite
> has two failing assertion in the solver category, but as far as I can
> see it ought to work mostly.
After finally getting around to test that clingo indeed can solve crime
[1], I've decided to push this patch set.

Regards,
Liliana

[1] https://potassco.org/doc/start/






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-24 18:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01  9:51 [bug#50933] [PATCH 0/3] Add clingo Liliana Marie Prikler
2021-09-25  9:51 ` [bug#50933] [PATCH 1/3] gnu: Add libpotassco Liliana Marie Prikler
2021-09-25 11:16 ` [bug#50933] [PATCH 2/3] gnu: Add clasp Liliana Marie Prikler
2021-10-01  9:47 ` [bug#50933] [PATCH 3/3] gnu: Add clingo Liliana Marie Prikler
2021-10-24 18:44 ` bug#50933: [PATCH 0/3] " Liliana Marie Prikler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.