New packages ppl, pplpy (Parma polyhedra library), cysignals (#4407)

This commit is contained in:
Matthias Köppe 2024-01-26 21:27:34 -08:00 committed by GitHub
parent e73abb8512
commit 38c39fd847
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 202 additions and 1 deletions

View File

@ -5,8 +5,9 @@ set -ex
# from https://pyodide.org/en/stable/development/building-from-sources.html#using-make:
# - build-essential
# we install file because it is used by packages/ppl during configure
# we install pkg-config with apt because it is commented out in environment.yml
sudo apt-get update && sudo apt-get install --yes build-essential pkg-config
sudo apt-get update && sudo apt-get install --yes build-essential file pkg-config
conda env create -n pyodide-env -f environment.yml
conda init bash

View File

@ -32,6 +32,8 @@ myst:
### Packages
- New Packages: `cysignals`, `ppl`, `pplpy` {pr}`4407`
- Upgraded scikit-learn to 1.4.0 {pr}`4409`
## Version 0.25.0

View File

@ -0,0 +1,16 @@
package:
name: cysignals
version: 1.11.4
top-level:
- cysignals
source:
url: https://pypi.io/packages/source/c/cysignals/cysignals-1.11.4.tar.gz
sha256: 0f1e321e55a07f901c86a36a1e4497f6ff9dfe700681d0130a38c36e4eb238c3
patches:
- patches/193.patch
- patches/0001-src-cysignals-implementation.c-EMSCRIPTEN-Do-not-use.patch
about:
home: https://github.com/sagemath/cysignals
PyPI: https://pypi.org/project/cysignals
summary: Interrupt and signal handling for Cython
license: LGPL v3

View File

@ -0,0 +1,38 @@
From b13d2be64ff7f855465002cd507cb830de0d43da Mon Sep 17 00:00:00 2001
From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
Date: Wed, 24 Jan 2024 23:24:45 -0800
Subject: [PATCH] src/cysignals/implementation.c [EMSCRIPTEN]: Do not use
sigaltstack
This is https://github.com/sagemath/cysignals/pull/197
---
src/cysignals/implementation.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/cysignals/implementation.c b/src/cysignals/implementation.c
index 2afd6ad..3088cdf 100644
--- a/src/cysignals/implementation.c
+++ b/src/cysignals/implementation.c
@@ -531,7 +531,7 @@ static void _sig_off_warning(const char* file, int line)
static void setup_alt_stack(void)
{
-#if HAVE_SIGALTSTACK
+#if HAVE_SIGALTSTACK && !defined(__EMSCRIPTEN__)
/* Space for the alternate signal stack. The size should be
* of the form MINSIGSTKSZ + constant. The constant is chosen rather
* ad hoc but sufficiently large.
@@ -576,7 +576,9 @@ static void setup_cysignals_handlers(void)
* After setting up the trampoline, we reset the signal mask. */
sigprocmask(SIG_BLOCK, &sa.sa_mask, &default_sigmask);
#endif
+#if !defined(__EMSCRIPTEN__)
setup_trampoline();
+#endif
#if HAVE_SIGPROCMASK
sigprocmask(SIG_SETMASK, &default_sigmask, &sigmask_with_sigint);
#endif
--
2.42.0

View File

@ -0,0 +1,30 @@
From 474179c87ab0ff562fdfd2471b02797e4bdd3148 Mon Sep 17 00:00:00 2001
From: Jerome Benoit <quartermaster@rezozer.net>
Date: Sat, 4 Nov 2023 23:22:30 +0100
Subject: [PATCH] cythonize: discard now obsoleted directive
Description: upstream: fix: obsoleted compiler directive: discard
This patch discards the now obsolete compiler directive
`legacy_implicit_noexcept`.
Origin: vendor, Debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2023-11-04
This is https://github.com/sagemath/cysignals/pull/193
---
setup.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/setup.py b/setup.py
index eb9c8f5a..79531705 100755
--- a/setup.py
+++ b/setup.py
@@ -173,7 +173,6 @@ def cythonize(self, extensions):
compiler_directives=dict(
binding=True,
language_level=2,
- legacy_implicit_noexcept=True,
))

View File

@ -16,6 +16,7 @@ build:
--host none \
--disable-shared \
--enable-static \
--enable-cxx \
--prefix=${WASM_LIBRARY_DIR}
emmake make -j ${PYODIDE_JOBS:-3}
emmake make install

31
packages/ppl/meta.yaml Normal file
View File

@ -0,0 +1,31 @@
package:
name: ppl
version: 1.2
tag:
- library
source:
url: https://www.bugseng.com/products/ppl/download/ftp/releases/1.2/ppl-1.2.tar.xz
sha256: 691f0d5a4fb0e206f4e132fc9132c71d6e33cdda168470d40ac3cf62340e9a60
patches:
- patches/clang5-support.patch
requirements:
host:
- libgmp
- glpk
build:
type: static_library
script: |
emconfigure ./configure \
CFLAGS="-fPIC -Wno-reserved-identifier -Wno-reserved-macro-identifier" \
CPPFLAGS="-I${WASM_LIBRARY_DIR}/include" \
CXXFLAGS="-std=c++11 -fPIC -Wno-reserved-identifier -Wno-zero-as-null-pointer-constant -Wno-double-promotion -Wno-unsafe-buffer-usage -Wno-extra-semi-stmt -Wno-shadow -Wno-implicit-fallthrough -Wno-deprecated-literal-operator -Wno-suggest-override -Wno-suggest-destructor-override -Wno-deprecated-copy-with-user-provided-dtor -Wno-deprecated-copy-with-user-provided-copy -Wno-unused-template -Wno-comma -Wno-unreachable-code-return -Wno-deprecated-declarations -Wno-unreachable-code-break -Wno-format-nonliteral -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-weak-vtables -Wno-old-style-cast -Wno-header-hygiene -Wno-undef" \
LDFLAGS="-L${WASM_LIBRARY_DIR}/lib" \
--disable-dependency-tracking \
--enable-coefficients=mpz --disable-fpmath \
--enable-interfaces=c,c++ \
--disable-shared \
--with-gmp="${WASM_LIBRARY_DIR}" \
--prefix=${WASM_LIBRARY_DIR}
emmake make -j ${PYODIDE_JOBS:-3}
emmake make install

View File

@ -0,0 +1,43 @@
From: Roberto Bagnara <bagnara@cs.unipr.it>
Date: Sun, 11 Feb 2018 08:11:09 +0000 (+0100)
Subject: Added missing "template" and "typename" keywords.
X-Git-Url: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl%2Fppl.git;a=commitdiff_plain;h=c39f6a07b51f89e365b05ba4147aa2aa448febd7;hp=3a5e1e20a94cffb830182f22132b153d6691b7c5
Added missing "template" and "typename" keywords.
(Thanks to Dmitrii Pasechnik.)
This version of PPL, 1.2, is unfortunately the latest upstream version - https://repology.org/project/ppl/versions
For the packages that I'm adding, I am using the patches carried by the SageMath distribution - see https://github.com/sagemath/sage/tree/develop/build/pkgs/ppl
---
diff --git a/src/Determinate_inlines.hh b/src/Determinate_inlines.hh
index 2749953..5b47275 100644
--- a/src/Determinate_inlines.hh
+++ b/src/Determinate_inlines.hh
@@ -289,8 +289,8 @@ operator()(Determinate& x, const Determinate& y) const {
template <typename PSET>
template <typename Binary_Operator_Assign>
-inline
-Determinate<PSET>::Binary_Operator_Assign_Lifter<Binary_Operator_Assign>
+inline typename
+Determinate<PSET>::template Binary_Operator_Assign_Lifter<Binary_Operator_Assign>
Determinate<PSET>::lift_op_assign(Binary_Operator_Assign op_assign) {
return Binary_Operator_Assign_Lifter<Binary_Operator_Assign>(op_assign);
}
diff --git a/src/OR_Matrix_inlines.hh b/src/OR_Matrix_inlines.hh
index b20b697..8124b7f 100644
--- a/src/OR_Matrix_inlines.hh
+++ b/src/OR_Matrix_inlines.hh
@@ -97,7 +97,7 @@ OR_Matrix<T>::Pseudo_Row<U>::Pseudo_Row(const Pseudo_Row<V>& y)
template <typename T>
template <typename U>
-inline OR_Matrix<T>::Pseudo_Row<U>&
+inline typename OR_Matrix<T>::template Pseudo_Row<U>&
OR_Matrix<T>::Pseudo_Row<U>::operator=(const Pseudo_Row& y) {
first = y.first;
#if PPL_OR_MATRIX_EXTRA_DEBUG

27
packages/pplpy/meta.yaml Normal file
View File

@ -0,0 +1,27 @@
package:
name: pplpy
version: 0.8.9
top-level:
- ppl
source:
url: https://files.pythonhosted.org/packages/72/a6/8f5ff229ee82cec9d1e7d2507e6eba492350faf50ae41beb76ef0a7f34a7/pplpy-0.8.9.tar.gz
sha256: db7a3b571d6ef053f75137975e947c3a1c1e45a30bab90eaf215b4e5cc15797e
requirements:
host:
- libgmp
- ppl
- gmpy2
run:
- gmpy2
- cysignals
build:
cxxflags: |
-std=c++11
-I$(WASM_LIBRARY_DIR)/include
ldflags: |
-L$(WASM_LIBRARY_DIR)/lib
about:
home: https://github.com/sagemath/pplpy
PyPI: https://pypi.org/project/pplpy
summary: Python PPL wrapper
license: GPL v3

View File

@ -0,0 +1,12 @@
from pytest_pyodide import run_in_pyodide
@run_in_pyodide(packages=["pplpy"])
def test_pplpy(selenium):
from ppl import Constraint, Variable
x = Variable(0)
y = Variable(1)
c = x + 3 * y == 1
cc = Constraint(c)
assert c.is_equivalent_to(cc)