Octave for Android: Difference between revisions
(update with more choices) |
(Restructure Termux article for comprehension.) |
||
Line 1: | Line 1: | ||
== | == Termux == | ||
[https://termux.com Termux] is a Terminal Emulator for Android. You can install it from [https://play.google.com/store/apps/details?id=com.termux Play store] or [https://f-droid.org/repository/browse/?fdid=com.termux F-Droid]. | [https://termux.com Termux] is a Terminal Emulator for Android. You can install it from [https://play.google.com/store/apps/details?id=com.termux Play store] or [https://f-droid.org/repository/browse/?fdid=com.termux F-Droid]. | ||
=== Direct Octave installation === | |||
You can directly install Octave in Termux using the repository by [https://github.com/its-pointless/gcc_termux its-pointless]. | You can directly install Octave in Termux using the repository by [https://github.com/its-pointless/gcc_termux its-pointless]. | ||
< | <syntaxhighlight lang="shell"> | ||
wget https://its-pointless.github.io/setup-pointless-repo.sh | wget https://its-pointless.github.io/setup-pointless-repo.sh | ||
sh setup-pointless-repo.sh | sh setup-pointless-repo.sh | ||
apt install octave | apt install octave | ||
</ | </syntaxhighlight> | ||
However, graphics capabilities are not available | However, graphics capabilities are not available with this approach. | ||
== | === Via some Linux distribution === | ||
Inside Termux in Android, you can install a Linux distribution like Debian, Ubuntu, Arch or Alpine (this consumes less disk space). Octave can be installed as descried in [[Octave for GNU/Linux]] from the distribution's respective package manager. | |||
Several apps (e.g. [https://github.com/EXALAB/AnLinux-App Anlinux], [https://andronix.app/ Andronix]) are available to easily install the | To use Octave's graphical capabilities, the installation of a desktop environment and the usage of a VNC Server is required. (Please add more information how to do this here.) On many android devices, only the graphics toolkit "gnuplot" is known to work. Several apps (e.g. [https://github.com/EXALAB/AnLinux-App Anlinux], [https://andronix.app/ Andronix]) are available to easily install the Linux distribution of your choice, and setting up the desktop environment. | ||
== GNURoot Octave == | == GNURoot Octave == |
Revision as of 06:15, 2 November 2020
Termux
Termux is a Terminal Emulator for Android. You can install it from Play store or F-Droid.
Direct Octave installation
You can directly install Octave in Termux using the repository by its-pointless.
wget https://its-pointless.github.io/setup-pointless-repo.sh
sh setup-pointless-repo.sh
apt install octave
However, graphics capabilities are not available with this approach.
Via some Linux distribution
Inside Termux in Android, you can install a Linux distribution like Debian, Ubuntu, Arch or Alpine (this consumes less disk space). Octave can be installed as descried in Octave for GNU/Linux from the distribution's respective package manager.
To use Octave's graphical capabilities, the installation of a desktop environment and the usage of a VNC Server is required. (Please add more information how to do this here.) On many android devices, only the graphics toolkit "gnuplot" is known to work. Several apps (e.g. Anlinux, Andronix) are available to easily install the Linux distribution of your choice, and setting up the desktop environment.
GNURoot Octave
The Android app GNURoot Octave in the Google play store is built and maintained by Corbin Champion. However, note that these repositories have not been updated for several years. It is not part of the GNU Octave project. Thus please use the following GitHub pages for questions and bug reports:
The implementation has been done in close cooperation with the Octave developers and makes use of the Octave source code without essential changes. Thus, it is fully compatible with the versions of Octave on other platforms.
Some probably outdated build instructions for the older "octave4android" app:
Octave for Linux on Dex (Specific to certain Samsung Android devices)
Linux on Dex (LoD) is an application (beta testing status) that runs on some Samsung Android devices.
To build Octave on LoD, do the following. This assumes you have LoD working. If not, follow the instructions on the LoD website.
- Many of the packages that Octave needs are not in the default Ubuntu installation. You will need to install them using
sudo apt install <package>
. First, you need the compilers gcc, and gfortran. There are other packages that are essential to download: "libblas", "liblapack", "libatlas" and their development counterparts with the "-dev" extension. - Remove all "libopenblas" packages with
sudo apt remove libopenblas*
. The OpenBLAS library from the default Ubuntu distribution does not work with Octave. You have to remove it. For details see bug #56900. - Unpack the Octave source code and enter the directory. Create a build directory
mkdir my_build
, enter that directory and issue../configure
. This will start the configure script. Look at the output at the end of the configure process to see what packages are not found by the script. Many of these will be things you want/need in terms of functionality. You can search for the packages available using the command "apt search", and install the ones you want usingsudo apt install <package>
before compiling. If you want to install Octave in "my_build" be sure to issue../configure --prefix=`pwd`
from this directory. - In the my_build directory issue
make
andmake install
.
Now you should have a working installation in, e.g., /home/dextop/path_to/octave-5.1.0/my_build/.
Graphics:
- If you set the graphics toolbox to "gnuplot", Octave should generate plots correctly. If it does not, set the environment variable GNUTERM to x11. The default shell in LoD is bash, and you can either issue
export GNUTERM=x11
in the bash terminal or in your octave session issuing "setenv GNUTERM x11". You can also addsetenv GNUTERM x11
to your .octaverc file to do this automatically. - If you want to use Qt graphics it will take some work, and may or may not be possible. It has not been tested by anyone. You will need to download the package libandroid-shmem, get it working, and then recompile Octave linking to this library. There are more detailed instructions regarding the compilation on the github website.