pyodide/packages/numpy/meta.yaml

42 lines
1.5 KiB
YAML
Raw Normal View History

2018-06-20 18:54:47 +00:00
package:
name: numpy
2021-11-14 14:03:56 +00:00
version: 1.21.4
2018-06-20 18:54:47 +00:00
source:
2021-11-14 14:03:56 +00:00
url: https://files.pythonhosted.org/packages/fb/48/b0708ebd7718a8933f0d3937513ef8ef2f4f04529f1f66ca86d873043921/numpy-1.21.4.zip
sha256: e6c76a87633aa3fa16614b61ccedfae45b91df2767cf097aa9c933932a7ed1e0
2018-06-20 18:54:47 +00:00
patches:
- patches/disable-maybe-uninitialized.patch
- patches/dont-include-execinfo.patch
- patches/fix-longdouble.patch
- patches/fix-static-init-of-nditer-pywrap.patch
- patches/init-alloc-cache.patch
- patches/use-local-blas-lapack.patch
- patches/make-int-return-values.patch
2021-03-23 21:49:38 +00:00
- patches/fix-ieee754.patch
2021-11-14 14:03:56 +00:00
- patches/disable-optimization.patch
- patches/not-build-lapack-lite-as-64-bit.patch
- patches/fix-invalid-asm-instruction.patch
2022-01-16 23:52:34 +00:00
- patches/fix-comparator-function-signatures.patch
- patches/fix-random_float_fill-return-type.patch
- patches/fix-math-feature-detection-for-wasm.patch
2018-06-20 18:54:47 +00:00
build:
cflags: |
-Wno-return-type
post: |
Use pypa/build (#2272) This resolves #2189. > build isolation would be a bit difficult to use in our case, as for instance > when building scipy we need the patched numpy on the host and not the numpy > version specified in pyproject.toml (which would be unpatched) This is indeed the case, certain packages cannot be isolated. My strategy is to make a list of packages that shouldn't be isolated and add symlinks from the isolated build environment into the `.artifacts` directory to "unisolate" them. Then we remove the unisolated package requirements from the list of packages to install, in case pesky constraints aren't satisfied. In particular, packages that expect to be used with `pypa/build` often feel free to put very specific constraints on their build dependencies (often asking them to be == to a particular version). Specific version constraints is good for build reproducibility and with build isolation doesn't cost anything. So we just ignore the constraints. Hopefully nothing goes wrong. In particular, any package that does stuff both at build time and at runtime and requires synchronization between the build time and run time environments needs the unisolation. This includes cffi with `_cffi_backend.so`, and of course numpy and scipy. pycparser needs to be unisolated because it is a dependency of cffi. Currently I have also unisolated pythran and cython, though these are build time only tools and do not really need to be unisolated. Cython I unisolated specifically because numcodecs needs it but it isn't in the numcodecs build dependencies. Pythran I unisolated because of a problem with the scipy build which I don't fully understand (some problem with long double feature detection).
2022-03-22 05:05:30 +00:00
pip install -t $HOSTSITEPACKAGES numpy==$PKG_VERSION
# copy the correct numpy config into the build artifacts. Otherwise scipy will try to build with the config
# from the build computer and bad things will happen
Use pypa/build (#2272) This resolves #2189. > build isolation would be a bit difficult to use in our case, as for instance > when building scipy we need the patched numpy on the host and not the numpy > version specified in pyproject.toml (which would be unpatched) This is indeed the case, certain packages cannot be isolated. My strategy is to make a list of packages that shouldn't be isolated and add symlinks from the isolated build environment into the `.artifacts` directory to "unisolate" them. Then we remove the unisolated package requirements from the list of packages to install, in case pesky constraints aren't satisfied. In particular, packages that expect to be used with `pypa/build` often feel free to put very specific constraints on their build dependencies (often asking them to be == to a particular version). Specific version constraints is good for build reproducibility and with build isolation doesn't cost anything. So we just ignore the constraints. Hopefully nothing goes wrong. In particular, any package that does stuff both at build time and at runtime and requires synchronization between the build time and run time environments needs the unisolation. This includes cffi with `_cffi_backend.so`, and of course numpy and scipy. pycparser needs to be unisolated because it is a dependency of cffi. Currently I have also unisolated pythran and cython, though these are build time only tools and do not really need to be unisolated. Cython I unisolated specifically because numcodecs needs it but it isn't in the numcodecs build dependencies. Pythran I unisolated because of a problem with the scipy build which I don't fully understand (some problem with long double feature detection).
2022-03-22 05:05:30 +00:00
export NUMPY_CORE_INCLUDE=numpy/core/include/numpy
cp \
build/numpy-$PKG_VERSION/build/src.emscripten_wasm32-$PYMAJOR.$PYMINOR/$NUMPY_CORE_INCLUDE/*config.h \
$HOSTSITEPACKAGES/$NUMPY_CORE_INCLUDE
# static libraries for other packages to link
mkdir -p $NUMPY_LIB
find $SRC_DIR -name '*.a' | sed "s:.*:cp \0 $NUMPY_LIB:g" | bash
2018-08-03 12:43:40 +00:00
test:
imports:
- numpy