Дмитрий Рыбас on Mon, 22 Jul 2019 14:45:43 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Using pari/gp on Android


Well, there'is PariDroid app in Play Market.

I tried it and found it's not quite convinient to use (but easy to get).
There's no way to stop script, for example (pressing Ctrl-C), one has to abort whole app.
Input is not very convinient as well, previous-next works in some unpredictable way, no file operations (for example - save\load user functions).

So I tried (and succeded) another way.

There's Termux app in PlayMarket. It's "prefixed linux environment" for android.
I've managed to compile pari/gp right on device, and it runs just as in any other pari/gp in linux, with readline, GMP, read-write to files etc. 
It's possible to run multiple sessions in Termux, so it's possible to have multiple pari/gp instances (I use one for help, and another for scripting).

Compared to PariDroid, pari/gp runs under Termux a little bit faster (actually, some calculations I done about a year before, run significantly faster, but I couldn't reproduce them now).

Compilation takes about 30 minutes.

No root required for the device.

What I did is.
Install Termux from Play Market.
Use some convinient keyboard, I use "Hacker's keyboard"
In termux (thank's to Termux gihub: https://github.com/termux/termux-packages/issues/2694 ) :

# from suitable directory
pkg install clang libgmp-dev readline-dev ncurses-dev wget tar
wget https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-2.11.2.tar.gz
tar -xf pari-2.11.2.tar.gz
cd pari-2.11.2
./Configure --prefix=$PREFIX
make all
make install


I also have installed gp2c, just to try if it works -- it does. 

This is what pari/gp shows when started (I still use 2.11.0):

$ gp
                        GP/PARI CALCULATOR Version 2.11.0 (released)
                 armv7l running linux (arm/GMP-6.1.2 kernel) 32-bit version
            compiled: Jun 25 2019, clang version 8.0.0 (tags/RELEASE_800/final)
                                  threading engine: single
                       (readline v8.0 enabled, extended help enabled)

                           Copyright (C) 2000-2018 The PARI Group

PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY
WARRANTY WHATSOEVER.

Type ? for help, \q to quit.
Type ?17 for how to get moral (and possibly technical) support.

parisize = 4000000, primelimit = 500000
?


Regards,
Dmitry.