From patchwork Sun Jul 18 15:03:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Prikler X-Patchwork-Id: 31486 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 42D1027BC78; Sun, 18 Jul 2021 20:19:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BDCEE27BC6B for ; Sun, 18 Jul 2021 20:19:10 +0100 (BST) Received: from localhost ([::1]:43392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5CJh-00083n-PY for patchwork@mira.cbaines.net; Sun, 18 Jul 2021 15:19:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5CJa-00080d-GE for guix-patches@gnu.org; Sun, 18 Jul 2021 15:19:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5CJa-0001uN-8O for guix-patches@gnu.org; Sun, 18 Jul 2021 15:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5CJa-000297-5V for guix-patches@gnu.org; Sun, 18 Jul 2021 15:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49625] [PATCH WIP] gnu: Add minizinc. Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 18 Jul 2021 19:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49625 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49625@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16266359028183 (code B ref -1); Sun, 18 Jul 2021 19:19:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Jul 2021 19:18:22 +0000 Received: from localhost ([127.0.0.1]:57372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5CIw-00027v-9j for submit@debbugs.gnu.org; Sun, 18 Jul 2021 15:18:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:58080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5CIs-00027d-VK for submit@debbugs.gnu.org; Sun, 18 Jul 2021 15:18:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m58Ky-0006x0-Ca for guix-patches@gnu.org; Sun, 18 Jul 2021 11:04:13 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:13090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m58Ku-0008RU-Rd for guix-patches@gnu.org; Sun, 18 Jul 2021 11:04:11 -0400 Received: from localhost.localdomain (80-121-26-175.adsl.highway.telekom.at [80.121.26.175]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4GSSt82G38z1DH9P for ; Sun, 18 Jul 2021 17:04:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4GSSt82G38z1DH9P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1626620640; bh=2DlVLKzn3J1fRUDxw5AcLtZ/55StAynH7niisH2CfMA=; h=From:To:Subject:Date:From; b=Efw1GtnQmxOnA9UnXRsx28YIcshQYsX7q/PyYfge++PrRp59uYfLlWxhkQu45OeGa mRo9Gdis50wwb9PXcT3ijfhc6PivZnJiTjFFHTcSvXNrFOhBDiVQWsbR4kL196ShVB 9KZABuinGa3ON5S8+AmMeHhC1wN31HNm7DYqnG+Y= From: Leo Prikler Date: Sun, 18 Jul 2021 17:03:51 +0200 Message-Id: <20210718150351.12359-1-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 Received-SPF: pass client-ip=129.27.2.202; envelope-from=leo.prikler@student.tugraz.at; helo=mailrelay.tugraz.at X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/maths.scm (minizinc): New variable. --- MiniZinc typically wants to be used with the hitherto unpackaged Gecode (https://www.gecode.org), but getting its RUNPATH correct appears pretty non-straightforward. It does however also function with CBC by specifying ‘--solver cbc’. gnu/packages/maths.scm | 82 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index b4cf0b5409..dce1b5627f 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2837,6 +2837,88 @@ 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 + )) + (inputs + `(("bison" ,bison) + ("flex" ,flex) + ("zlib" ,zlib) + ;; solvers + ("cbc" ,cbc))) + (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")