2018-07-18 13:32:16 +00:00
|
|
|
package:
|
|
|
|
name: scipy
|
2022-04-09 01:43:30 +00:00
|
|
|
version: 1.8.0
|
2022-01-03 22:07:13 +00:00
|
|
|
|
|
|
|
# See extra explanation in info.md
|
|
|
|
#
|
|
|
|
# For future reference: if you see the following errors:
|
|
|
|
# Declaration error: adjustable dimension on non-argument
|
|
|
|
# or:
|
|
|
|
# nonconstant array size
|
|
|
|
# you are trying to compile code that isn't written to the fortran 77 standard.
|
|
|
|
# The line number in the error points to the last line of the problematic
|
|
|
|
# subroutine. Try deleting it.
|
2018-07-18 13:32:16 +00:00
|
|
|
|
|
|
|
source:
|
2022-04-09 01:43:30 +00:00
|
|
|
url: https://files.pythonhosted.org/packages/b4/a2/4faa34bf0cdbefd5c706625f1234987795f368eb4e97bde9d6f46860843e/scipy-1.8.0.tar.gz
|
|
|
|
sha256: 31d4f2d6b724bc9a98e527b5849b8a7e589bf1ea630c33aa563eda912c9ff0bd
|
2018-10-05 13:26:21 +00:00
|
|
|
|
|
|
|
patches:
|
Fix scipy linking errors (#2289)
With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)
Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:
sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )
where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.
2022-03-24 06:17:29 +00:00
|
|
|
- patches/0001-Fix-dstevr-in-special-lapack_defs.h.patch
|
2022-04-09 01:43:30 +00:00
|
|
|
- patches/0002-loadDynamicLibrary-flapack.patch
|
|
|
|
- patches/0003-Add-lapack_extras-to-linalg-setup.py.patch
|
|
|
|
- patches/0004-int-to-string.patch
|
|
|
|
- patches/0005-disable-blas-detection.patch
|
|
|
|
- patches/0006-fix-fotran-files-minpack.patch
|
|
|
|
- patches/0007-gemm_-no-const.patch
|
|
|
|
- patches/0008-make-int-return-values.patch
|
|
|
|
- patches/0009-Rename-_page_trend_test.py-to-prevent-test-unvendori.patch
|
|
|
|
- patches/0010-sasum-returns-double-not-float.patch
|
|
|
|
- patches/0011-skip-fortran-fails-to-link.patch
|
|
|
|
- patches/0012-Disable-lapack-detection.patch
|
|
|
|
- patches/0013-Add-extra-END-to-prini.f.patch
|
|
|
|
- patches/0014-BUG-Fix-signature-of-D_IIR_forback-1-2.patch
|
2018-07-18 13:32:16 +00:00
|
|
|
|
|
|
|
build:
|
2021-06-19 22:49:25 +00:00
|
|
|
cflags: |
|
|
|
|
-I$(PYODIDE_ROOT)/packages/CLAPACK/build/CLAPACK-3.2.1/INCLUDE
|
2022-03-22 05:05:30 +00:00
|
|
|
-I$(HOSTSITEPACKAGES)/pythran/
|
2022-01-03 22:07:13 +00:00
|
|
|
-Wno-return-type
|
No replay (#2256)
Our package build process currently has a significant flaw: we first run setup.py, recording all compilation commands, then we rewrite these compilation commands to invoke emcc and replay them, and then we pray that the cross compiled executables ended up in the right place to go into the wheel. This is not a good strategy because the build script is allowed to implement arbitrary logic, and if it moves, renames, etc any of the output files then we lose track of them. This has repeatedly caused difficulty for us.
However, we also make no particularly significant use of the two pass approach. We can just do the simpler thing: capture the compiler commands as they occur, modify them as needed, and then run the fixed command.
I also added a patch to fix the numpy feature detection for wasm so that we don't have to include _npyconfig.h and config.h, numpy can generate them in the way it would for a native build. I opened a numpy PR that would fix the detection for us upstream:
numpy/numpy#21154
This clears the way for us to switch to using pypa/build (as @henryiii has suggested) by removing our dependence on specific setuptools behavior.
This is on top of #2238.
2022-03-13 18:39:06 +00:00
|
|
|
-DUNDERSCORE_G77
|
2021-06-19 22:49:25 +00:00
|
|
|
ldflags: |
|
2022-05-12 03:31:16 +00:00
|
|
|
-L$(NUMPY_LIB)/core/lib/
|
|
|
|
-L$(NUMPY_LIB)/random/lib/
|
2022-01-03 22:07:13 +00:00
|
|
|
# IMPORTANT: Other locations important in scipy build process:
|
|
|
|
# There are two files built in the "capture" pass that need patching:
|
|
|
|
# _blas_subroutines.h, and _cython
|
|
|
|
# Scipy has a bunch of custom logic implemented in
|
|
|
|
# pyodide-build/pyodide_build/_f2c_fixes.py.
|
2021-01-09 09:44:41 +00:00
|
|
|
script: |
|
2022-05-12 03:31:16 +00:00
|
|
|
pip install -t $HOSTSITEPACKAGES pythran
|
2022-01-03 22:07:13 +00:00
|
|
|
# We get linker errors because the following 36 functions are missing
|
|
|
|
# Copying them from a more recent LAPACK seems to work fine.
|
|
|
|
wget https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.10.0.tar.gz
|
|
|
|
tar xzf v3.10.0.tar.gz
|
|
|
|
cd lapack-3.10.0/SRC
|
2022-04-09 01:43:30 +00:00
|
|
|
|
2022-01-03 22:07:13 +00:00
|
|
|
cat \
|
2022-04-09 01:43:30 +00:00
|
|
|
cgemqrt.f cgeqrfp.f cgeqrt.f clahqr.f csyconv.f csyconvf.f csyconvf_rook.f ctpmqrt.f ctpqrt.f cuncsd.f \
|
|
|
|
dgemqrt.f dgeqrfp.f dgeqrt.f dlahqr.f dsyconv.f dsyconvf.f dsyconvf_rook.f dtpmqrt.f dtpqrt.f dorcsd.f \
|
|
|
|
sgemqrt.f sgeqrfp.f sgeqrt.f slahqr.f ssyconv.f ssyconvf.f ssyconvf_rook.f stpmqrt.f stpqrt.f sorcsd.f \
|
|
|
|
zgemqrt.f zgeqrfp.f zgeqrt.f zlahqr.f zsyconv.f zsyconvf.f zsyconvf_rook.f ztpmqrt.f ztpqrt.f zuncsd.f \
|
2022-01-03 22:07:13 +00:00
|
|
|
>> ../../scipy/linalg/lapack_extras.f
|
Fix scipy linking errors (#2289)
With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)
Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:
sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )
where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.
2022-03-24 06:17:29 +00:00
|
|
|
sed -i 's/CHARACTER/INTEGER/g' ../../scipy/linalg/lapack_extras.f
|
2022-04-09 01:43:30 +00:00
|
|
|
sed -i 's/RECURSIVE//g' ../../scipy/linalg/lapack_extras.f
|
2022-01-03 22:07:13 +00:00
|
|
|
cd ../..
|
|
|
|
|
|
|
|
# Change many functions that return void into functions that return int
|
2021-02-27 07:44:52 +00:00
|
|
|
find scipy -name "*.c*" | xargs sed -i 's/extern void F_FUNC/extern int F_FUNC/g'
|
Fix scipy linking errors (#2289)
With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)
Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:
sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )
where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.
2022-03-24 06:17:29 +00:00
|
|
|
|
2021-02-27 07:44:52 +00:00
|
|
|
sed -i 's/void F_FUNC/int F_FUNC/g' scipy/odr/__odrpack.c
|
Fix scipy linking errors (#2289)
With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)
Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:
sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )
where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.
2022-03-24 06:17:29 +00:00
|
|
|
sed -i 's/^void/int/g' scipy/odr/odrpack.h
|
|
|
|
sed -i 's/^void/int/g' scipy/odr/__odrpack.c
|
|
|
|
|
|
|
|
sed -i 's/void BLAS_FUNC/int BLAS_FUNC/g' scipy/special/lapack_defs.h
|
|
|
|
# sed -i 's/void F_FUNC/int F_FUNC/g' scipy/linalg/_lapack_subroutines.h
|
2022-01-03 22:07:13 +00:00
|
|
|
sed -i 's/extern void/extern int/g' scipy/optimize/__minpack.h
|
|
|
|
sed -i 's/void/int/g' scipy/linalg/cython_blas_signatures.txt
|
Fix scipy linking errors (#2289)
With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)
Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:
sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )
where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.
2022-03-24 06:17:29 +00:00
|
|
|
sed -i 's/^void/int/g' scipy/interpolate/src/_fitpackmodule.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/, 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/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
|
|
|
|
|
2022-01-03 22:07:13 +00:00
|
|
|
|
|
|
|
# Missing declaration from cython_lapack_signatures.txt
|
|
|
|
echo "void ilaenv(int *ispec, char *name, char *opts, int *n1, int *n2, int *n3, int *n4)" \
|
|
|
|
>> scipy/linalg/cython_lapack_signatures.txt
|
|
|
|
|
Fix scipy linking errors (#2289)
With newer versions of emscripten, linker errors surface eariler.
This makes it easier to find function pointer cast errors without
having to execute the bad code path -- the errors happen when the
wasm modules are linked (at load time in the browser)
Anyways, this fixes more linker errors. Mostly the problems have
to do with LAPACK functions that take string arguments. Most
LAPACK functions that take string arguments use them as enums and
only care about the first character of the string. Because of the
way that f2c works, we need to replace these strings with the ascii
code of the first character so we should replace:
sTRSV( 'UPPER', 'NOTRANS', 'NONUNIT', J, H, LDH, Y, 1 )
==>
CALL sTRSV( 85, 78, 78, J, H, LDH, Y, 1 )
where 85 and 78 are the ascii codes of U and N. Various character
variables are subbed into being integer variables. The two
functions `ilaenv` and `xerbla` expect actual C strings as an
argument, but it is very annoying to produce C strings so instead
I added wrapper functions ilaenvf2c and xerblaf2c to clapack and
instead of calling ilaenv and xerbla we call the f2c versions.
2022-03-24 06:17:29 +00:00
|
|
|
# sed -i 's/^void/int/g' scipy/linalg/cython_lapack_signatures.txt
|
|
|
|
|
2022-01-03 22:07:13 +00:00
|
|
|
# Input error causes "duplicate symbol" linker errors. Empty out the file.
|
2022-04-09 01:43:30 +00:00
|
|
|
echo "" > scipy/sparse/linalg/_dsolve/SuperLU/SRC/input_error.c
|
2022-05-12 03:31:16 +00:00
|
|
|
cross-build-env: true
|
|
|
|
cross-build-files:
|
|
|
|
- scipy/linalg/cython_lapack.pxd
|
|
|
|
- scipy/linalg/cython_blas.pxd
|
2022-01-03 22:07:13 +00:00
|
|
|
|
2018-07-18 13:32:16 +00:00
|
|
|
requirements:
|
|
|
|
run:
|
|
|
|
- numpy
|
2020-12-23 13:24:32 +00:00
|
|
|
- CLAPACK
|
2018-10-30 12:10:10 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
imports:
|
|
|
|
- scipy
|
2018-10-31 14:06:08 +00:00
|
|
|
- scipy.cluster
|
2022-01-03 22:07:13 +00:00
|
|
|
- scipy.cluster.vq
|
|
|
|
- scipy.cluster.hierarchy
|
2018-10-31 14:06:08 +00:00
|
|
|
- scipy.constants
|
2022-01-03 22:07:13 +00:00
|
|
|
- scipy.fft
|
2018-10-31 14:06:08 +00:00
|
|
|
- scipy.fftpack
|
|
|
|
- scipy.integrate
|
2022-01-03 22:07:13 +00:00
|
|
|
- scipy.interpolate
|
|
|
|
- scipy.io
|
|
|
|
- scipy.io.arff
|
|
|
|
- scipy.io.matlab
|
|
|
|
- scipy.io.wavfile
|
2018-10-30 12:10:10 +00:00
|
|
|
- scipy.linalg
|
2022-01-03 22:07:13 +00:00
|
|
|
- scipy.linalg.blas
|
|
|
|
- scipy.linalg.cython_blas
|
|
|
|
- scipy.linalg.lapack
|
|
|
|
- scipy.linalg.cython_lapack
|
|
|
|
- scipy.linalg.interpolative
|
2018-10-31 14:06:08 +00:00
|
|
|
- scipy.misc
|
|
|
|
- scipy.ndimage
|
2022-01-03 22:07:13 +00:00
|
|
|
- scipy.odr
|
|
|
|
- scipy.optimize
|
|
|
|
- scipy.signal
|
|
|
|
- scipy.signal.windows
|
|
|
|
- scipy.sparse
|
|
|
|
- scipy.sparse.linalg
|
|
|
|
- scipy.sparse.csgraph
|
2018-10-31 14:06:08 +00:00
|
|
|
- scipy.spatial
|
2022-01-03 22:07:13 +00:00
|
|
|
- scipy.spatial.distance
|
|
|
|
- scipy.spatial.transform
|
2018-10-30 12:10:10 +00:00
|
|
|
- scipy.special
|
2022-01-03 22:07:13 +00:00
|
|
|
- scipy.stats
|
|
|
|
- scipy.stats.contingency
|
|
|
|
- scipy.stats.distributions
|
|
|
|
- scipy.stats.mstats
|
|
|
|
- scipy.stats.qmc
|