Compiling 32bit dependency on 64bit system

22 views
Skip to first unread message

DVPeer

unread,
Feb 16, 2018, 4:22:51 AM2/16/18
to Python For Android
I'm trying to compile the package pyclipper (https://github.com/greginvm/pyclipper) for `armeabi-v7a`. Using the master branch compilation succeeds but i get the following error upon running the application on my android device: `ImportError: dlopen failed: "/data/data/org.test.hcdpyclipper/files/app/lib/python2.7/site-packages/pyclipper.so" is 64-bit instead of 32-bit`


When using a custom recipe to compile to 32bit I get the following compilation error: `wrong ELF class: ELFCLASS32` when building the dependency.  The recipe I created is:
```from pythonforandroid.toolchain import Recipe, shprint, current_directory, CythonRecipe, PythonRecipe
from os.path import exists, join
import sh
import glob
import pprint
from pprint import pprint

class PyclipperRecipe(PythonRecipe):
    # This could also inherit from PythonRecipe etc. if you want to
    # use their pre-written build processes

    version = '1.1.0'
    url = 'https://github.com/greginvm/pyclipper/releases/download/{version}/pyclipper-{version}.zip'
    # {version} will be replaced with self.version when downloading

    depends = ['python2', 'setuptools']  # A list of any other recipe names
                                    # that must be built before this
                                    # one

    conflicts = []  # A list of any recipe names that cannot be built
                    # alongside this one

    site_packages_name = 'pyclipper'


    def get_recipe_env(self,arch):
        env = super(PyclipperRecipe, self).get_recipe_env(arch)
        # Manipulate the env here if you want
        env['PYTHONPATH'] = ':'.join([self.ctx.get_site_packages_dir()])
        env['LDFLAGS'] += " -m32"
        env['CFLAGS'] += " -m32"
        pprint(env)
        return env


recipe = PyclipperRecipe()
```

Alexander Taylor

unread,
Feb 23, 2018, 1:08:32 PM2/23/18
to Python For Android
It looks like pyclipper is a cython module, so try using a CythonRecipe.

Dennis van Peer

unread,
Feb 23, 2018, 1:18:05 PM2/23/18
to python-...@googlegroups.com
Unfortunately this gives me the same result 

--
You received this message because you are subscribed to a topic in the Google Groups "Python For Android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python-android/1HJZvfCq2iw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python-android+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexander Taylor

unread,
Feb 24, 2018, 9:49:23 AM2/24/18
to Python For Android
Hmm, just to check, did you clean the build fully after making this change?
To unsubscribe from this group and all its topics, send an email to python-androi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages