question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Optimization for Termux?

See original GitHub issue
~ $ nuitka3 --version
Nuitka:WARNING: Cannot detect Linux
Nuitka:WARNING: distribution, this may prevent
Nuitka:WARNING: optimization.
1.2.7
Commercial: None
Python: 3.10.9 (main, Dec 11 2022, 16:28:02) [Clang 14.0.6 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0
Flavor: Unknown
Executable: /data/data/com.termux/files/usr/bin/python3.10
OS: Linux
Arch: aarch64
Distribution: Unknown None
~ $ nuitka3 fib.py
Nuitka:WARNING: Cannot detect Linux
Nuitka:WARNING: distribution, this may prevent
Nuitka:WARNING: optimization.
Nuitka-Options:INFO: Used command line options: fib.py
Nuitka-Options:WARNING: You did not specify to
Nuitka-Options:WARNING: follow or include
Nuitka-Options:WARNING: anything but main
Nuitka-Options:WARNING: program. Check options
Nuitka-Options:WARNING: and make sure that is
Nuitka-Options:WARNING: intended.
Nuitka:INFO: Starting Python compilation with Nuitka '1.2.7' on Python '3.10' commercial grade 'not installed'.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:WARNING: Cannot detect Linux
Nuitka:WARNING: distribution, this may prevent
Nuitka:WARNING: optimization.
Nuitka:INFO: Running C compilation via Scons.
Nuitka:WARNING: Cannot detect Linux
Nuitka:WARNING: distribution, this may prevent
Nuitka:WARNING: optimization.
Nuitka-Scons:INFO: Backend C compiler: gcc (gcc).
Nuitka-Scons:INFO: Backend linking program with 10 files (no progress information available).
Nuitka-Scons:WARNING: You are not using
Nuitka-Scons:WARNING: ccache.
Nuitka:INFO: Keeping build directory 'fib.build'.
Nuitka:INFO: Successfully created 'fib.bin'.
~ $

  • neofetch
~ $ neofetch
         -o          o-            u0_a478@localhost
          +hydNNNNdyh+             -----------------
        +mMMMMMMMMMMMMm+           OS: Android 11 aarch64
      `dMMm:NMMMMMMN:mMMd`         Host: OPPO PCKM00
      hMMMMMMMMMMMMMMMMMMh         Kernel: 4.14.180-perf+
  ..  yyyyyyyyyyyyyyyyyyyy  ..     Uptime: 12 days, 16 hours, 36 mins
.mMMm`MMMMMMMMMMMMMMMMMMMM`mMMm.   Packages: 217 (dpkg), 1 (pkg)
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:   Shell: bash 5.2.15
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:   CPU: Qualcomm SDM730G AIE (8) @ 1.804GHz
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:   Memory: 4409MiB / 7551MiB
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:
-MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM-
 +yy+ MMMMMMMMMMMMMMMMMMMM +yy+
      mMMMMMMMMMMMMMMMMMMm
      `/++MMMMh++hMMMM++/`
          MMMMo  oMMMM
          MMMMo  oMMMM
          oNMm-  -mMNs

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Dec 21, 2022

I enhanced the check, seems Android was not detected, please try again or use 1.3, the change is in there too.

This is part of the stable release 1.3 that I just made.

0reactions
anzhi0708commented, Dec 20, 2022

Hi, thanks for replying! Seems like still not working on my phone:

~ $ pip3.10 install -U --force-reinstall "https://github.com/Nuitka/Nuitka/archive/factory.zip"
Collecting https://github.com/Nuitka/Nuitka/archive/factory.zip
  Downloading https://github.com/Nuitka/Nuitka/archive/factory.zip
     / 6.2 MB 735.9 kB/s 0:00:08
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: Nuitka
  Building wheel for Nuitka (setup.py) ...done
  Created wheel for Nuitka: filename=Nuitka-1.3rc9-cp310-cp310-linux_aarch64.whl size=2713914 sha256=31531a45b9c4a8285c29537fc9e532a1d9da96bd81888619955ec73467c15cb5
  Stored in directory: /data/data/com.termux/files/usr/tmp/pip-ephem-wheel-cache-ybt3rw6o/wheels/12/88/12/96e4d1cdf9bcbea957e644c0a1e1ba5843c0143b1b03e240ed
Successfully built Nuitka
Installing collected packages: Nuitka
  Attempting uninstall: Nuitka
    Found existing installation: Nuitka 1.2.7
    Uninstalling Nuitka-1.2.7:
      Successfully uninstalled Nuitka-1.2.7
Successfully installed Nuitka-1.3rc9
~ $ ls
audios     downloads  local    temporary
documents  images     storage
~ $ cd temporary/
~/temporary $ ls
fib        fib.c    fib.ml     fib.py
fib.bin    fib.cmi  fib.o
fib.build  fib.cmx  fib.ocaml
~/temporary $ rm fib.bin fib.build/ -rf
~/temporary $ ls
fib    fib.cmi  fib.ml  fib.ocaml
fib.c  fib.cmx  fib.o   fib.py
~/temporary $ nuitka3 --version
Nuitka:WARNING: Cannot detect Linux
Nuitka:WARNING: distribution, this may
Nuitka:WARNING: prevent optimization.
1.3rc9
Commercial: None
Python: 3.10.9 (main, Dec 11 2022, 16:28:02) [Clang 14.0.6 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0
Flavor: Unknown
Executable: /data/data/com.termux/files/usr/bin/python3.10
OS: Linux
Arch: aarch64
Distribution: Unknown None
Version C compiler: /data/data/com.termux/files/usr/bin/gcc (gcc).
Nuitka:WARNING: Cannot detect Linux
Nuitka:WARNING: distribution, this may
Nuitka:WARNING: prevent optimization.
~/temporary $ nuitka3 fib.py
Nuitka-Options:INFO: Used command line options: fib.py
Nuitka:WARNING: Cannot detect Linux
Nuitka:WARNING: distribution, this may
Nuitka:WARNING: prevent optimization.
Nuitka-Options:WARNING: You did not specify
Nuitka-Options:WARNING: to follow or include
Nuitka-Options:WARNING: anything but main
Nuitka-Options:WARNING: program. Check
Nuitka-Options:WARNING: options and make
Nuitka-Options:WARNING: sure that is
Nuitka-Options:WARNING: intended.
Nuitka:INFO: Starting Python compilation with Nuitka '1.3rc9' on Python '3.10' commercial grade 'not installed'.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: gcc (gcc).
Nuitka:WARNING: Cannot detect Linux
Nuitka:WARNING: distribution, this may
Nuitka:WARNING: prevent optimization.
Nuitka-Scons:INFO: Backend linking program with 10 files (no progress information available).
Nuitka-Scons:WARNING: You are not using
Nuitka-Scons:WARNING: ccache.
Nuitka:INFO: Keeping build directory 'fib.build'.
Nuitka:INFO: Successfully created 'fib.bin'.
~/temporary $

And I tried to add the --standalone flag too (which made the compiling process significantly slower and the console output seems more complicated)

~/temporary $ nuitka3 fib.py --standalone
Nuitka-Options:INFO: Used command line options: fib.py --standalone
Nuitka:WARNING: Cannot detect Linux
Nuitka:WARNING: distribution, this may
Nuitka:WARNING: prevent optimization.
Nuitka:INFO: Starting Python compilation with Nuitka '1.3rc9' on Python '3.10' commercial grade 'not installed'.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: gcc (gcc).
Nuitka:WARNING: Cannot detect Linux
Nuitka:WARNING: distribution, this may
Nuitka:WARNING: prevent optimization.
Nuitka-Scons:INFO: Backend linking program with 10 files (no progress information available).
Nuitka-Scons:WARNING: You are not using
Nuitka-Scons:WARNING: ccache.
Nuitka:INFO: Keeping build directory 'fib.build'.
Nuitka:INFO: Successfully created 'fib.dist/fib'.
~/temporary $

By the way, I have both 3.11 and 3.10 installed so that’s why I had to specify pip3.10 and stuff. But I don’t think that’s the main problem here, or is it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Take Complete Control of Your Android Device with KITANA
Android is probably the most customizable OS in the world if you just ... To use KITANA, you will need a command line...
Read more >
Termux is, hands down, the best thing to happen to Android ...
Termux is, hands down, the best thing to happen to Android. It's still pretty problematic and incomplete as a productive shell tool.
Read more >
Android Performance Optimization
This document describes design of an APK caching solution for rapid installation of preloaded apps on a device that supports A/B partitions.
Read more >
Unleash the potential of your unrooted Android phone
Termux is an Android terminal emulator and Linux environment application that works directly with no rooting or setup required.
Read more >
Termux gets killed when heavy operations are run in Andronix
I assume it's because the process allocates too much resources and Android has it killed for performance, but I have no proof.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found