Hi there,
I have been struggling for some time to add matplotlib recipe to python-for-android project and now since numpy was recently added I hoped it will be easier but I am stuck with importing a dependency lib (numpy)
I downloaded matplotlib source code and when trying to import numpy I get an 'cannot open shared object file: No such file or directory' error:
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.1.1
python: 2.7.2 (default, Jun 3 2013, 23:16:27) [GCC 4.6.3]
platform: linux3
REQUIRED DEPENDENCIES
['/home/przemek/python-for-android/build/matplotlib/matplotlib-1.1.1', '/home/przemek/python-for-android/build/python-install/lib/python27.zip', '/home/przemek/python-for-android/build/python-install/lib/python2.7', '/home/przemek/python-for-android/build/python-install/lib/python2.7/plat-linux3', '/home/przemek/python-for-android/build/python-install/lib/python2.7/lib-tk', '/home/przemek/python-for-android/build/python-install/lib/python2.7/lib-old', '/home/przemek/python-for-android/build/python-install/lib/python2.7/lib-dynload', '/home/przemek/python-for-android/build/python-install/lib/python2.7/site-packages']
/home/przemek/python-for-android/build/python-install/lib/python2.7/site-packages/numpy/core/multiarray.so: cannot open shared object file: No such file or directory
numpy: no
* You must install numpy 1.4 or later to build
* matplotlib.
I suppose that this is because numpy so is ARM compiled and python.host binary cannot access it since it is compiled for another architecture
/home/przemek/python-for-android/build/numpy/numpy-1.7.1/build/lib.linux-i686-2.7/numpy/core/multiarray.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamical
ly linked, not stripped
my recipe.sh is cloned from numpy and looks so far like this:
#!/bin/bash
VERSION_matplotlib=1.1.1
URL_matplotlib=
http://pypi.python.org/packages/source/m/matplotlib/matplotlib-${VERSION_matplotlib}.tar.gzDEPS_matplotlib=(numpy)
MD5_matplotlib=30ee59119599331bf1f3b6e838fee9a8
BUILD_matplotlib=$BUILD_PATH/matplotlib/$(get_directory $URL_matplotlib)
RECIPE_matplotlib=$RECIPES_PATH/matplotlib
function prebuild_matplotlib() {
cd $BUILD_matplotlib
if [ -f .patched ]; then
return
fi
try patch -p1 < $RECIPE_matplotlib/patches/fix-matplotlib.patch
touch .patched
}
function build_matplotlib() {
if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/matplotlib" ]; then
return
fi
cd $BUILD_matplotlib
env
echo "push_arm"
push_arm
env
#PATH=$PATH:/home/przemek/python-for-android/build/python-install/lib/python2.7
#export PATH=$PATH:$BUILD_PATH/numpy/numpy-1.7.1/build/lib.linux-i686-2.7
try $BUILD_PATH/python-install/bin/python.host setup.py build_ext -v
try find build/lib.* -name "*.o" -exec $STRIP {} \;
try $BUILD_PATH/python-install/bin/python.host setup.py install -O2
pop_arm
}
function postbuild_matplotlib() {
true
}
I noticed that
https://play.google.com/store/apps/details?id=org.thinktanks.mathsysalpha&hl=en already uses kivy + matlplotlib, therefore there has to be a way to setup this
any help/clue is greatly appreciated