Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false

- name: Install Emscripten ccache
run: |
Expand Down Expand Up @@ -244,6 +246,10 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false

- name: Cache conda
uses: actions/cache@v4
Expand Down Expand Up @@ -316,6 +322,8 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false

- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "pyodide-build"]
path = pyodide-build
url = https://github.com/pyodide/pyodide-build
branch = updates-for-scipy
7 changes: 6 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
additionalRepositories:
- url: https://github.com/emscripten-core/emsdk
- url: https://github.com/pyodide/pyodide-build
checkoutLocation: pyodide-build
tasks:
- name: Sync submodule(s)
init: git submodule update --init --recursive
command: echo "Submodules initialized"
- name: Setup
init: |
pyenv global system
conda env create -f environment.yml
conda activate pyodide-env

pip install git+https://github.com/pyodide/pyodide-build.git
pip install ./pyodide-build/
pyodide xbuildenv install

EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ Collections of package recipes for Pyodide

## Adding a new package

> Note: Use Python 3.12 or upper to run the following commands.
> Note: Use Python 3.13 or upper to run the following commands.

To add a new package, create a package recipe in the `packages` directory.
You can start by creating a boilerplate recipe with the following command:

It is required to clone the repository with the `--recurse-submodules` option to ensure
that all submodules are initialized. If hyou have already cloned the repository without
this option, you can run the following command to initialize the submodules:

```bash
$ git submodule update --init --recursive
```

You can then start by creating a boilerplate recipe with the following command:

```bash
$ pip install pyodide-build
$ pip install ./pyodide-build
$ pyodide skeleton pypi <package-name>
```

Expand Down
6 changes: 3 additions & 3 deletions docs/MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ by updating the `Makefile.envs` file in the pyodide/pyodide repository.
To build and test packages locally, you need to prepare the necessary tools and dependencies.

- compatible Python version
- pyodide-build
- pyodide-build, which is provided by the `pyodide-build` Git submodule in the repository root
- emscripten
- selenium (for testing)

Expand Down Expand Up @@ -71,9 +71,9 @@ The `pyodide-recipes` repository is used to build packages for both stable and n
We use different branches for those versions:

- `main`: the default branch, used for nightly versions of Pyodide
- It uses nightly xbuildenv and nightly pyodide-build to build packages.
- It uses nightly xbuildenv and the pyodide-build submodule to build packages.
- `<version>`: a branch for stable versions of Pyodide
- It uses stable xbuildenv and nightly (or stable if there is any breaking change) pyodide-build to build packages.
- It uses stable xbuildenv and pyodide-build submodule (or a stable version, if there are any breaking changes) to build packages.

Let's say we have a stable Pyodide version `0.27.0`, and we are developing a new version `0.28.0`.

Expand Down
52 changes: 36 additions & 16 deletions packages/scipy/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package:
name: scipy
version: 1.14.1
pinned: true
version: 1.16.0
tag:
- min-scipy-stack
top-level:
Expand All @@ -18,8 +17,8 @@ package:
# subroutine. Try deleting it.

source:
url: https://files.pythonhosted.org/packages/62/11/4d44a1f274e002784e4dbdb81e0ea96d2de2d1045b2132d5af62cc31fd28/scipy-1.14.1.tar.gz
sha256: 5a275584e726026a5699459aa72f828a610821006228e841b94275c4a7c08417
url: https://files.pythonhosted.org/packages/source/s/scipy/scipy-1.16.0.tar.gz
sha256: b5ef54021e832869c8cfb03bc3bf20366cbcd426e02a58e8a58d7584dfbb8f62

patches:
- patches/0001-Fix-dstevr-in-special-lapack_defs.h.patch
Expand All @@ -28,18 +27,14 @@ source:
- patches/0004-make-int-return-values.patch
- patches/0005-Fix-fitpack.patch
- patches/0006-Fix-gees-calls.patch
- patches/0007-MAINT-linalg-Remove-id_dist-Fortran-files.patch
- patches/0008-Mark-mvndst-functions-recursive.patch
- patches/0009-Make-sreorth-recursive.patch
- patches/0010-Link-openblas-with-modules-that-require-f2c.patch
- patches/0011-Remove-fpchec-inline-if-then-endif-constructs.patch # remove with SciPy v1.15.0
- patches/0012-Remove-chla_transtype.patch
- patches/0013-Set-wrapper-return-type-to-int.patch
- patches/0014-Skip-svd_gesdd-test.patch # remove with SciPy v1.15.0
- patches/0015-Remove-f2py-generators.patch
- patches/0016-Make-sf_error_state_lib-a-static-library.patch
- patches/0017-Remove-test-modules-that-fail-to-build.patch
- patches/0018-Fix-lapack-larfg-function-signature.patch
- patches/0007-Make-sreorth-recursive.patch
- patches/0008-Link-openblas-with-modules-that-require-f2c.patch
- patches/0009-Remove-chla_transtype.patch
- patches/0010-Set-wrapper-return-type-to-int.patch
- patches/0011-Remove-test-modules-that-fail-to-build.patch
- patches/0012-Fix-lapack-larfg-function-signature.patch
- patches/0013-ENH-MAINT-sparse.linalg-rewrite-ARPACK-in-C-22748.patch
- patches/0014-Remove-f2py-generators.patch

build:
# NumPy 2.1 disabled visibility for symbols outside of extension modules
Expand Down Expand Up @@ -98,7 +93,12 @@ build:
sed -i 's/extern void/extern int/g' scipy/optimize/__minpack.h
sed -i 's/void/int/g' scipy/linalg/cython_blas_signatures.txt
sed -i 's/void/int/g' scipy/linalg/cython_lapack_signatures.txt
sed -i 's/^void/int/g' scipy/linalg/_common_array_utils.h

sed -i 's/^void/int/g' scipy/interpolate/src/_fitpackmodule.c
sed -i 's/^void/int/g' scipy/interpolate/src/__fitpack.h
sed -i 's/^void/int/g' scipy/interpolate/src/__fitpack.cc
sed -i 's/void BLAS_FUNC/int BLAS_FUNC/g' scipy/interpolate/src/__fitpack.h

sed -i 's/extern void/extern int/g' scipy/sparse/linalg/_dsolve/SuperLU/SRC/*.{c,h}
sed -i 's/PUBLIC void/PUBLIC int/g' scipy/sparse/linalg/_dsolve/SuperLU/SRC/*.{c,h}
Expand All @@ -107,16 +107,36 @@ build:
sed -i 's/void \(.\)print/int \1/g' scipy/sparse/linalg/_dsolve/SuperLU/SRC/*.{c,h}
sed -i 's/TYPE_GENERIC_FUNC(\(.*\), void)/TYPE_GENERIC_FUNC(\1, int)/g' scipy/sparse/linalg/_dsolve/_superluobject.h

sed -i 's/^void/int/g' scipy/optimize/__nnls.h
sed -i 's/^void/int/g' scipy/optimize/__nnls.c
sed -i 's/^void/int/g' scipy/optimize/__slsqp.h
sed -i 's/^void/int/g' scipy/optimize/__slsqp.c
sed -i 's/^static void/static int/g' scipy/optimize/__slsqp.c

sed -i 's/^void/int/g' scipy/optimize/_trlib/trlib_private.h
sed -i 's/^void/int/g' scipy/optimize/_trlib/trlib/trlib_private.h
sed -i 's/^void/int/g' scipy/_build_utils/src/wrap_dummy_g77_abi.c
sed -i 's/, int)/)/g' scipy/optimize/_trlib/trlib_private.h
sed -i 's/, 1)/)/g' scipy/optimize/_trlib/trlib_private.h

sed -i 's/^void/int/g' scipy/linalg/_matfuncs_expm.h
sed -i 's/^void/int/g' scipy/linalg/_matfuncs_expm.c
sed -i 's/^void/int/g' scipy/linalg/_matfuncs_sqrtm.h
sed -i 's/^void/int/g' scipy/linalg/_matfuncs_sqrtm.c

sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_n_double_complex.h
sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_n_double.h
sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_n_single_complex.h
sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_n_single.h
sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_s_double.h
sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_s_single.h

sed -i 's/^void/int/g' scipy/spatial/qhull_misc.h
sed -i 's/, size_t)/)/g' scipy/spatial/qhull_misc.h
sed -i 's/,1)/)/g' scipy/spatial/qhull_misc.h

sed -i 's/^void/int/g' scipy/optimize/__lbfgsb.h

# Input error causes "duplicate symbol" linker errors. Empty out the file.
echo "" > scipy/sparse/linalg/_dsolve/SuperLU/SRC/input_error.c

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 45a31145679c83f2719b6420f234d484b9459697 Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchatham@gmail.com>
Date: Fri, 18 Mar 2022 16:25:39 -0700
Subject: [PATCH 1/18] Fix dstevr in special/lapack_defs.h
Subject: [PATCH 1/14] Fix dstevr in special/lapack_defs.h

---
scipy/special/lapack_defs.h | 5 ++---
Expand Down
2 changes: 1 addition & 1 deletion packages/scipy/patches/0002-int-to-string.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From d53ade3f03ba3557fd50fb38990d605f4ae7f8f1 Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchatham@gmail.com>
Date: Sat, 25 Dec 2021 18:04:18 -0800
Subject: [PATCH 2/18] int to string
Subject: [PATCH 2/14] int to string

f2c does not handle implicit casts of function arguments correctly. The msg
argument of `xerrwv` is defined to be an `int *`, and then implicitly cast
Expand Down
2 changes: 1 addition & 1 deletion packages/scipy/patches/0003-gemm_-no-const.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From e528227dd37c8b0512381992c222789a114e3169 Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchatham@gmail.com>
Date: Sat, 18 Dec 2021 11:41:15 -0800
Subject: [PATCH 3/18] gemm_ no const
Subject: [PATCH 3/14] gemm_ no const

cgemm, dgemm, sgemm, and zgemm are declared with `const` in slu_cdefs.h, but
other places don't have the cosnt causing compile errors.
Expand Down
15 changes: 7 additions & 8 deletions packages/scipy/patches/0004-make-int-return-values.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a86a2304fd925f815bbb0e0753e46a7b863e2de2 Mon Sep 17 00:00:00 2001
From: Joe Marshall <joe.marshall@nottingham.ac.uk>
Date: Wed, 6 Apr 2022 21:25:13 -0700
Subject: [PATCH 4/18] make int return values
Subject: [PATCH 4/14] make int return values

The return values of f2c functions are insignificant in most cases, so often it
is treated as returning void, when it really should return int (values are
Expand Down Expand Up @@ -240,21 +240,20 @@ index 67e83bcc77..e5757d5c4d 100644

/* Macro definitions */
diff --git a/scipy/sparse/linalg/_dsolve/SuperLU/SRC/slu_scomplex.h b/scipy/sparse/linalg/_dsolve/SuperLU/SRC/slu_scomplex.h
index 83be8c971f..047a07ce9c 100644
index 1e53fbca5..b35313ccb 100644
--- a/scipy/sparse/linalg/_dsolve/SuperLU/SRC/slu_scomplex.h
+++ b/scipy/sparse/linalg/_dsolve/SuperLU/SRC/slu_scomplex.h
@@ -27,8 +27,9 @@ at the top-level directory.

@@ -28,7 +28,9 @@ at the top-level directory.
#ifndef SCOMPLEX_INCLUDE
#define SCOMPLEX_INCLUDE
-
-typedef struct { float r, i; } singlecomplex;
+#include"scipy_slu_config.h"
+#include "scipy_slu_config.h"
+// defined in CLAPACK
+//typedef struct { float r, i; } singlecomplex;


/* Macro definitions */
#if defined(SUPERLU_TYPEDEF_COMPLEX) || DOXYGEN
//! \brief backward compatibility with older versions of SuperLU
diff --git a/scipy/sparse/linalg/_dsolve/_superlu_utils.c b/scipy/sparse/linalg/_dsolve/_superlu_utils.c
index 49b928a431..0822687719 100644
--- a/scipy/sparse/linalg/_dsolve/_superlu_utils.c
Expand Down
2 changes: 1 addition & 1 deletion packages/scipy/patches/0005-Fix-fitpack.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c784d3a1ee38da88943364de4ea847a3b9cd155f Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchatham@gmail.com>
Date: Tue, 30 Aug 2022 11:51:53 -0700
Subject: [PATCH 5/18] Fix fitpack
Subject: [PATCH 5/14] Fix fitpack

---
scipy/interpolate/fitpack/dblint.f | 9 ++++-----
Expand Down
2 changes: 1 addition & 1 deletion packages/scipy/patches/0006-Fix-gees-calls.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 8addc1da35bc63df651946ef14c723797a431e0c Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchatham@gmail.com>
Date: Mon, 26 Jun 2023 20:12:25 -0700
Subject: [PATCH 6/18] Fix gees calls
Subject: [PATCH 6/14] Fix gees calls

---
scipy/linalg/flapack_gen.pyf.src | 8 ++++----
Expand Down
Loading
Loading