Building Panda on Android

Hmmm.

Building with --target android-27 makes no difference.

Next thing I tried was:
$pkg install libunwind
and then build with --target android-27 but WITHOUT --use-zlib --no-tiff

Then I can’t even build:

ANNOT LINK EXECUTABLE “built/bin/pzip”: cannot locate symbol “lzma_lzma_preset” referenced by “/data/data/com.termux/files/usr/lib/libtiff.so”…
Storing dependency cache.
Elapsed Time: 34 min 51 sec
The following command returned a non-zero value: built/bin/pzip built/models/misc/Dirlight.egg
Build terminated.

This problem seemed to be solved (uo in this thread) but not for me.
So I can only go with --use-zlib -no-tiff

Next thing I do is updating all packages in termux.

Actually, which Python version did you use? Maybe I must downgrade?

pkg upgrade
pkg update

same result.

unfortunately I don’t know how to downgrade python in termux.

Still I think I am missing an other package…

I’m not really sure. I’ve just been using the Python 3.7.2 that came with Termux.

Note, by the way, that the Android port can can make use of Android’s bitmap APIs, so libtiff isn’t strictly needed to be able to load tiff images.

Maybe they updated a package and we’re missing a library now? I’ll try doing a clean build on my Tegra X1 board and see if I run into any of the same issues.

Py_FileSystemDefaultEncoding is declared in
/data/data/com.termux/files/usr/include/python3.7m/fileobject.h

  • The default encoding used by the platform file system APIs
    If non-NULL, this is different than the default encoding for strings
    */
    PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;

Maybe we have a linker problem or a problem with the library path or the include path when building panda3d for android?

Even more strange. Py_FileSystemDefaultEncodig has only one occurence in the pana sources:

./panda/src/android/python_main.cxx: Py_FileSystemDefaultEncoding = “utf-8”;

I commented this line in the source and rebuilt everything but the error remains.

So the error seeems to be in the termux libraries or in the linker-settings…

But I am not a professional programmer. So at this point I must give up :frowning:

I’m taking a look. It’s just taking me a while to get to it (I also am needing to rebuild because of the libtiff issue, which takes a while).

It’s a problem in the build system. I’ve checked in a fix; use git pull to get the latest changes.

Then, rm built/lib/libppython.so and rebuild.

Don’t forget to revert the change you had made to python_main.cxx first!

rdb, you are my hero :smile:

Everything works perfectly now.

Thank you very much!!

Hi everyone, I’ve been trying to compile Panda3d on Android for the past couple days, used the readme on github to do it, however I’m now running into this error at around 20%, any help would be appreciated.

ibp3gobj.in
/data/data/com.termux/files/usr/include/sys/cdefs.h:355:39: error: syntax error, unexpected IDENTIFIER, expecting ‘)’
int size_mul_overflow(SIZE_TYPE a, SIZE_TYPE b, SIZE_TYPE *result) {
^
Error parsing file: ‘p3gobj_composite2.cxx’
Storing dependency cache.
Elapsed Time: 11 min 31 sec
The following command returned a non-zero value: built/bin/interrogate -srcdir panda/src/gobj -Ipanda/src/gobj -DCPPPARSER -D__STDC
=1 -D__cplusplus=201103L -D__attribute__(x)= -D_LP64 -D__LP64__ -D__aarch64__ -D__ANDROID__ -oc built/tmp/libp3gobj_igate.cxx -od built/pandac/input/libp3gobj.in -fnames -string -refcount -assert -python-native -Sbuilt/include/parser-inc -Ipanda/src/gobj -Sbuilt/tmp -Sbuilt/include -S/data/data/com.termux/files/usr/include -DANDROID= -module panda3d.core -library libp3gobj adaptiveLru.h animateVerticesRequest.h bufferContext.h bufferContextChain.h bufferResidencyTracker.h config_gobj.h geom.h geomCacheEntry.h geomCacheManager.h geomContext.h geomEnums.h geomLines.h geomLinesAdjacency.h geomLinestrips.h geomLinestripsAdjacency.h geomMunger.h geomPatches.h geomPoints.h geomPrimitive.h geomTriangles.h geomTrianglesAdjacency.h geomTrifans.h geomTristrips.h geomTristripsAdjacency.h geomVertexAnimationSpec.h geomVertexArrayData.h geomVertexArrayData_ext.h geomVertexArrayFormat.h geomVertexColumn.h geomVertexData.h geomVertexFormat.h geomVertexReader.h geomVertexRewriter.h geomVertexWriter.h indexBufferContext.h internalName.h internalName_ext.h lens.h material.h materialPool.h matrixLens.h occlusionQueryContext.h orthographicLens.h p3gobj_composite1.cxx p3gobj_composite2.cxx p3gobj_ext_composite.cxx paramTexture.h perspectiveLens.h preparedGraphicsObjects.h queryContext.h samplerContext.h samplerState.h savedContext.h shader.h shaderBuffer.h shaderContext.h simpleAllocator.h simpleLru.h sliderTable.h texture.h textureCollection.h textureCollection_ext.h textureContext.h texturePeeker.h texturePool.h texturePoolFilter.h textureReloadRequest.h textureStage.h textureStagePool.h texture_ext.h timerQueryContext.h transformBlend.h transformBlendTable.h transformTable.h userVertexSlider.h userVertexTransform.h vertexBufferContext.h vertexDataBlock.h vertexDataBook.h vertexDataBuffer.h vertexDataPage.h vertexDataSaveFile.h vertexSlider.h vertexTransform.h videoTexture.h
Build terminated.

Hello!
I was trying to build on Android 10, after building to some extent I got a very verbose log.
This is a very short part of the log:

Linking dynamic library built/lib/libpandagles.so
/data/data/com.termux/files/usr/bin/ld: built/tmp/pandagles_pandagles.o: in function init_libpandagles()': pandagles.cxx:(.text._Z17init_libpandaglesv+0x0): multiple definition of init_libpandagles()’; built/tmp/pandagles_pandagles.o:pandagles.cxx:(.text._Z17init_libpandaglesv+0x0): first defined here

Then it goes on and on with different sections ending with’ first declared here’

It’s Than, Not Then …

No, it’s not. That would make the sentence less correct.

1 Like

Oh so this works now? Cool I will have to try it… Eventually.

Hello, ive tried building panda on termux. I started the build using python makepanda/makepanda.py --everything --target android-21 --no-tiff --installer --thread=4. The build proceeded for about 41 minutes, and it terminated with following error message. panda/src/glxdisplay/glxGraphicsPipe.h:23:10: fatal error: 'x11GraphicsPipe.h' file not found #include "x11GraphicsPipe.h"

I replaced #include x11GraphicsPipe.h with #include ../x11display/x11GraphicsPipe.h and then proceeded the build again, and after a while I got a similar error in another file.

I’ve looked at most of the errors that other people have, but it doesn’t seem like there are any errors like mine. Am I doing something wrong?

Is Panda added to your compilers path?

I don’t know what adding panda to my compilers path means. Sorry. I only ran a python script to start the build.

It means that your compiler doesn’t know where the .h files are located. You used an absolute path but the developers used relative paths in the files which are also compiled by the compiler. So you will have to tell the compiler where to look for the files.

Ah, I understood. Thank you. But can I ask how can I tell compiler to do that? (Sorry for too much questions. My experience with compilers is at a rudimentary level.)

Hi, welcome to the community, @INIXIE!

Please disregard @panda3dmastercoder’s comments. What is going on is that Panda thinks you’re trying to build with X11 support, but X11 support on Android doesn’t exist. I suggest adding --no-x11 to the makepanda command-line.

It’s works! Thank you so much.