[PyQt] Android & the pyqtdeploy tool: the provided demo relies on undocumented libraries/headers?

Phil Thompson phil at riverbankcomputing.com
Wed Aug 29 11:00:41 BST 2018


On 29 Aug 2018, at 12:53 am, Jonathan Leaders <jonathan at leadersandco.com> wrote:
> 
> Same error, even with default=1... I'm confused because that patch seems like it should fix it

You could try making similar changes for HAVE_DEVICE_MACROS in the same file (ie. disable for android).

You are using...

Linux host
r17b NDK
android-28 platform

I am using...

macOS host
r10e NDK
android-21 platform

In the android-21 version of sysmacros.h the device functions are simple inline functions that do a bit of arithmetic. What is in the android-28 version of the file?

Phil

> -------- Original message --------
> From: Phil Thompson <phil at riverbankcomputing.com>
> Date: 8/27/18 5:08 AM (GMT-08:00)
> To: Jonathan Leaders <jonathan at leadersandco.com>
> Cc: pyqt at riverbankcomputing.com
> Subject: Re: [PyQt] Android & the pyqtdeploy tool: the provided demo relies on undocumented libraries/headers?
> 
> On 23 Aug 2018, at 9:09 pm, Jonathan Leaders <jonathan at leadersandco.com> wrote:
> > 
> > Hey Phil! Thank you so much for the direction. We got further by following your advice of using the same versions of SIP & PyQt5 that was found in the pyqtdeploy demo image in the docs
> > 
> > I'm a big fan of software that is "one-click" dev environment setup. I noticed I had to use specific old versions of PyQt5, Python, SIP, for the pyqtdeploy demo to work. It'd be interesting to add a --download-libs argument to demo-build.py that automatically downloads the source archives, since only certain versions are compatible. To help make that easier, here is a list of statements to download versions that are listed in your docs image:
> > 
> > 
> > # you must first run the universal Qt Installer script to install exactly 5.9.3
> > # I used qt-unified-linux-x64-3.0.5-online.run to install exactly 5.9.3 in ~/Qt5.9.3
> > ln -s ~/Qt5.9.3/ src/Qt
> > 
> > cd src
> > 
> > # Download source archive required by pyqtdeploy 2.1 (only certain versions work)
> > wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
> > wget https://superb-sea2.dl.sourceforge.net/project/pyqt/sip/sip-4.19.6/sip-4.19.6.tar.gz
> > wget https://phoenixnap.dl.sourceforge.net/project/pyqt/PyQt5/PyQt-5.9.2/PyQt5_gpl-5.9.2.tar.gz
> > wget https://download.qt.io/archive/qt/5.9/5.9.3/single/qt-everywhere-opensource-src-5.9.3.tar.xz
> > 
> > # Versions that are known to fail in pyqtdeploy 2.1:
> > #wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz
> > #wget http://mirrors.ocf.berkeley.edu/qt/archive/qt/5.11/5.11.1/single/qt-everywhere-src-5.11.1.tar.xz
> > #wget https://superb-sea2.dl.sourceforge.net/project/pyqt/sip/sip-4.19.12/sip-4.19.12.tar.gz
> > #wget https://phoenixnap.dl.sourceforge.net/project/pyqt/PyQt5/PyQt-5.11.2/PyQt5_gpl-5.11.2.tar.gz
> > 
> > cd -
> > 
> > 
> > 
> > The documentation aside, here's where I'm stuck now. Have you seen this error before? This happens after everything is built, the build directory is removed, and things are freezing, so it's really late in the process. It looks like its an issue linking:
> > ---------------------
> > 
> > /home/jonny/Android/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/jonny/Android/android-ndk-r17b/platforms/android-28/arch-arm/ -Wl,-soname,libpyqt-demo.so -Wl,-rpath=/home/jonny/Qt5.9.3/5.9.3/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libpyqt-demo.so pyqtdeploy_main.o pyqtdeploy_start.o pdytools_module.o _heapqmodule.o _math.o _posixsubprocess.o mathmodule.o selectmodule.o timemodule.o qrc_pyqtdeploy.o   -L/home/jonny/Android/android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -L/home/jonny/Android/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x -L/home/jonny/Projects/organic-mail/tools/pyqtdeploy-2.1/demo/sysroot-android-32/lib -L/home/jonny/Projects/organic-mail/tools/pyqtdeploy-2.1/demo/sysroot-android-32/lib/python3.6/site-packages -L/home/jonny/Projects/organic-mail/tools/pyqtdeploy-2.1/demo/sysroot-android-32/lib/python3.6/site-packages/PyQt5 -lQtAndroidExtras -lQtCore -lQtGui -lQtNetwork -lQtWidgets -lpython3.6 -lsip -L/home/jonny/Qt5.9.3/5.9.3/android_armv7/lib -lQt5Widgets -L/opt/android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -L/opt/android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9 -lQt5Gui -lQt5Network -lQt5AndroidExtras -lQt5Core -lGLESv2 -lgnustl_shared -lgcc -llog -lz -lm -ldl -lc
> > /home/jonny/Projects/organic-mail/tools/pyqtdeploy-2.1/demo/sysroot-android-32/lib/libpython3.6.a(posixmodule.o):posixmodule.c:function os_makedev: error: undefined reference to 'makedev'
> > /home/jonny/Projects/organic-mail/tools/pyqtdeploy-2.1/demo/sysroot-android-32/lib/libpython3.6.a(posixmodule.o):posixmodule.c:function os_minor: error: undefined reference to 'minor'
> > /home/jonny/Projects/organic-mail/tools/pyqtdeploy-2.1/demo/sysroot-android-32/lib/libpython3.6.a(posixmodule.o):posixmodule.c:function os_major: error: undefined reference to 'major'
> > collect2: error: ld returned 1 exit status
> > Makefile:259: recipe for target 'libpyqt-demo.so' failed
> > make: *** [libpyqt-demo.so] Error 1
> > 
> > -----------
> > 
> > Doing some digging into the C code, it appears it has to with this block in line 58 of posixmodule.c https://github.com/python/cpython/blob/3.6/Modules/posixmodule.c:
> > ------
> > 
> > #ifdef HAVE_SYS_SYSMACROS_H
> > /* GNU C Library: major(), minor(), makedev() */
> > #include <sys/sysmacros.h>
> > #endif
> > 
> > --------
> > I wonder if it was a recent change based on this comment in February: https://github.com/IntelRealSense/librealsense/pull/1114#issuecomment-362528830
> > 
> > Any ideas? I'm stumped on how to get the Android APK of the pyqtdeploy demo built. Even with the versions listed it seems to fail building.
> 
> Try this patch.
> 
> Phil
> 



More information about the PyQt mailing list