From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oGzrNKx+9GC+BQAAgWs5BA (envelope-from ) for ; Sun, 18 Jul 2021 21:19:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id eBe4MKx+9GA+cAAA1q6Kng (envelope-from ) for ; Sun, 18 Jul 2021 19:19:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3F6EE5A7A for ; Sun, 18 Jul 2021 21:19:08 +0200 (CEST) Received: from localhost ([::1]:43392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5CJf-00083n-Au for larch@yhetil.org; Sun, 18 Jul 2021 15:19:07 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626635948; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=2DlVLKzn3J1fRUDxw5AcLtZ/55StAynH7niisH2CfMA=; b=MwsjlELmcsPcXkEG17z9RcZ/9BpO59xybqx/Q5LrQKg4MvZoX1/tJi4W3BI4WB1cAGFI6Q xonzZsY/GoPq34MJS8Vxz6Sw5FuEnm+VpVUa+Z6Gm2wZcZYyP4IGOmtxBUftTjcYdbJiQD 5aOA/sU7OMI1VxBRqXqDL/n3HWovToNVltbxync1dCgh5iTqqEi2uu0wl6d80d4kCgYt7F n59nk2Frp53AjuG7gXLHZKi13KNfg90UWK/oL0ScrWcbCmHnmLwtvzOIpjVRPPiZ7nhBEW +9sSrgdaK38t/FV6uV6EVqFeTI9z2Hxc1kc8kML43ABF9q2jh3eFC00oILMCqg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626635948; a=rsa-sha256; cv=none; b=Av4tVKQxP6qIkAUZDgDiroJGgjArwlw5WFnGBt+5i8DfpyxNK+kwKJZBGHgR2T9TmNljSg nLmdyDsLQ/Npy6rsgAr8G8jfJIRLEYiBpRkFV5RZTLNyfoG/PgLRm4dvR6jRwuAnsTsuff k9/u8SaUA/M3VkPwt5gsDd15KtxRW/WNL4HQUNrrO5a2yxfq5WVyYOkbt04j3GHQGscw7l B5sK1QsqMYKItJOYEnTb8Uc4TcB9R/+Rq6ArryBmqgefN7IfoYy9iO57lh/9Ml/WbTAVP9 H2So3A54unoZYk0HsL/l2v97tFekLDVWAip/rZ5We7j/7Ut6t3x+RLGTBlHQ/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=Efw1GtnQ; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=Efw1GtnQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 3F6EE5A7A X-Spam-Score: -0.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: g1blV5EkeDvb * 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") -- 2.32.0