diff options
Diffstat (limited to 'numpy/linalg')
| -rw-r--r-- | numpy/linalg/lapack_lite/f2c.c | 4 | ||||
| -rw-r--r-- | numpy/linalg/lapack_lite/f2c.h | 3 | ||||
| -rw-r--r-- | numpy/linalg/meson.build | 56 |
3 files changed, 63 insertions, 0 deletions
diff --git a/numpy/linalg/lapack_lite/f2c.c b/numpy/linalg/lapack_lite/f2c.c index 869fce5d3..ddaa8d172 100644 --- a/numpy/linalg/lapack_lite/f2c.c +++ b/numpy/linalg/lapack_lite/f2c.c @@ -7,10 +7,14 @@ it is available, and shipping a static library isn't portable. */ +#define PY_SSIZE_T_CLEAN +#include <Python.h> + #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> + #include "f2c.h" diff --git a/numpy/linalg/lapack_lite/f2c.h b/numpy/linalg/lapack_lite/f2c.h index b44aaac44..0db1b9ecb 100644 --- a/numpy/linalg/lapack_lite/f2c.h +++ b/numpy/linalg/lapack_lite/f2c.h @@ -7,6 +7,9 @@ #ifndef F2C_INCLUDE #define F2C_INCLUDE +#define PY_SSIZE_T_CLEAN +#include <Python.h> + #include <math.h> #include "numpy/npy_common.h" #include "npy_cblas.h" diff --git a/numpy/linalg/meson.build b/numpy/linalg/meson.build new file mode 100644 index 000000000..083692913 --- /dev/null +++ b/numpy/linalg/meson.build @@ -0,0 +1,56 @@ +lapack_lite_sources = [ + 'lapack_lite/f2c.c', + 'lapack_lite/f2c_c_lapack.c', + 'lapack_lite/f2c_d_lapack.c', + 'lapack_lite/f2c_s_lapack.c', + 'lapack_lite/f2c_z_lapack.c', + 'lapack_lite/f2c_blas.c', + 'lapack_lite/f2c_config.c', + 'lapack_lite/f2c_lapack.c', + 'lapack_lite/python_xerbla.c', +] + +# TODO: ILP64 support + +lapack_lite_module_src = ['lapack_litemodule.c'] +if not have_lapack + warning('LAPACK was not found, NumPy is using an unoptimized, naive build from sources!') + lapack_lite_module_src += lapack_lite_sources +endif + +py.extension_module('lapack_lite', + lapack_lite_module_src, + dependencies: [np_core_dep, lapack], + install: true, + subdir: 'numpy/linalg', +) + +_umath_linalg_src = ['umath_linalg.cpp'] + lapack_lite_sources + +py.extension_module('_umath_linalg', + _umath_linalg_src, + dependencies: np_core_dep, + link_with: npymath_lib, + install: true, + subdir: 'numpy/linalg', +) + +py.install_sources( + [ + '__init__.py', + '__init__.pyi', + 'linalg.py', + 'linalg.pyi', + ], + subdir: 'numpy/linalg' +) + +py.install_sources( + [ + 'tests/__init__.py', + 'tests/test_deprecations.py', + 'tests/test_linalg.py', + 'tests/test_regression.py', + ], + subdir: 'numpy/linalg/tests' +) |
