Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions pythonforandroid/meson_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def handle_python_info():

prefix = C.TARGET_PYTHON_PREFIX

sysconfig_file = glob(join(prefix, "lib/python3.14/_sysconfigdata*.py"))[0]
ver_python = f"python{C.PYTHON_MAJOR_VERSION}.{C.PYTHON_MINOR_VERSION}"

sysconfig_file = glob(join(prefix, f"lib/{ver_python}/_sysconfigdata*.py"))[0]

spec = importlib.util.spec_from_file_location("_android_cfg", sysconfig_file)
cfg = importlib.util.module_from_spec(spec)
spec.loader.exec_module(cfg)

ver_python = f"python{C.PYTHON_MAJOR_VERSION}.{C.PYTHON_MINOR_VERSION}"

site_path = join(prefix, f"lib/{ver_python}/site-packages")

android_paths = {
Expand Down
4 changes: 3 additions & 1 deletion pythonforandroid/recipes/libopenblas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ def build_arch(self, arch):
"-DCMAKE_ANDROID_ARCH_ABI={arch}".format(arch=arch.arch),
"-DCMAKE_ANDROID_NDK=" + self.ctx.ndk_dir,
"-DCMAKE_ANDROID_API={api}".format(api=self.ctx.ndk_api),
"-DCMAKE_Fortran_COMPILER=NOTFOUND",
"-DCMAKE_BUILD_TYPE=Release",
"-DBUILD_SHARED_LIBS=ON",
"-DC_LAPACK=ON",
"-DDYNAMIC_ARCH=0",
"-DTARGET={target}".format(
target={
"arm64-v8a": "ARMV8",
Expand All @@ -47,4 +49,4 @@ def build_arch(self, arch):
shprint(sh.make, "-j" + str(cpu_count()), _env=env)


recipe = LibOpenBlasRecipe()
recipe = LibOpenBlasRecipe()
14 changes: 12 additions & 2 deletions pythonforandroid/recipes/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
class NumpyRecipe(MesonRecipe):
version = "v2.3.0"
url = "git+https://github.com/numpy/numpy"
extra_build_args = ["-Csetup-args=-Dblas=none", "-Csetup-args=-Dlapack=none"]
depends = ["libopenblas"]
extra_build_args = [
"-Csetup-args=-Dblas=auto",
"-Csetup-args=-Dlapack=auto",
"-Csetup-args=-Dallow-noblas=False",
]
need_stl_shared = True
min_ndk_api_support = 24

Expand Down Expand Up @@ -41,6 +46,11 @@ def get_recipe_env(self, arch, **kwargs):
"android-build",
"python",
)
blas_dir = join(Recipe.get_recipe("libopenblas", self.ctx
).get_build_dir(arch.arch), "build")
blas_incdir = blas_dir
blas_libdir = join(blas_dir, "lib")
env["CXXFLAGS"] += f" -I{blas_incdir} -L{blas_libdir}"
return env

def get_hostrecipe_env(self, arch=None):
Expand All @@ -49,4 +59,4 @@ def get_hostrecipe_env(self, arch=None):
return env


recipe = NumpyRecipe()
recipe = NumpyRecipe()
Loading