Skip to content

Commit d4ddb31

Browse files
committed
numpy should be installed also on hostpython for scipy
1 parent cc72413 commit d4ddb31

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pythonforandroid/recipes/numpy/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class NumpyRecipe(CompiledComponentsPythonRecipe):
1313
url = 'https://pypi.python.org/packages/source/n/numpy/numpy-{version}.zip'
1414
site_packages_name = 'numpy'
1515
depends = ['setuptools', 'cython']
16-
install_in_hostpython = False
16+
install_in_hostpython = True
1717
call_hostpython_via_targetpython = False
1818

1919
patches = [
@@ -40,9 +40,6 @@ def _build_compiled_components(self, arch):
4040

4141
env = self.get_recipe_env(arch)
4242
with current_directory(self.get_build_dir(arch.arch)):
43-
hostpython = sh.Command(self.real_hostpython_location)
44-
if self.install_in_hostpython:
45-
shprint(hostpython, 'setup.py', 'clean', '--all', '--force', _env=env)
4643
hostpython = sh.Command(self.hostpython_location)
4744
shprint(hostpython, 'setup.py', self.build_cmd, '-v',
4845
_env=env, *self.setup_extra_args)
@@ -68,5 +65,10 @@ def rebuild_compiled_components(self, arch, env):
6865
self._rebuild_compiled_components(arch, env)
6966
self.setup_extra_args = []
7067

68+
def get_hostrecipe_env(self, arch):
69+
env = super().get_hostrecipe_env(arch)
70+
env['RANLIB'] = sh.which('ranlib')
71+
return env
72+
7173

7274
recipe = NumpyRecipe()

pythonforandroid/recipes/scipy/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def get_recipe_env(self, arch):
5656
# compilers
5757
env['F77'] = f'{GCC}/bin/{prefix}-gfortran'
5858
env['F90'] = f'{GCC}/bin/{prefix}-gfortran'
59-
env['CC'] = f'{CLANG_BIN}/clang -target {arch.target} {arch_cflags}'
60-
env['CXX'] = f'{CLANG_BIN}/clang++ -target {arch.target} {arch_cflags}'
59+
env['CC'] = f'{CLANG_BIN}clang -target {arch.target} {arch_cflags}'
60+
env['CXX'] = f'{CLANG_BIN}clang++ -target {arch.target} {arch_cflags}'
6161

6262
# scipy expects ldshared to be a single executable without options
6363
env['LDSHARED'] = f'{CLANG_BIN}/clang'
@@ -66,7 +66,7 @@ def get_recipe_env(self, arch):
6666
env['CPPFLAGS'] = '-DANDROID'
6767

6868
# configure linker
69-
env['LDFLAGS'] += f' {LDSHARED_opts} -L{libgfortran} -L{numpylib}/core/lib -L{numpylib}/random/lib'
69+
env['LDFLAGS'] = f' {LDSHARED_opts} -L{libgfortran} -L{numpylib}/core/lib -L{numpylib}/random/lib'
7070
env['LDFLAGS'] += f' -l{self.stl_lib_name}'
7171
return env
7272

0 commit comments

Comments
 (0)