Octave for Android: Difference between revisions

From Octave
Jump to navigation Jump to search
(Marge article.)
Line 1: Line 1:
== Octave for Linux on Dex (Samsung Android devices) ==
== Octave for Linux on Dex (Samsung Android devices) ==


Linux on Dex (LoD) is an application that runs on some Android devices made by Samsung, including their smart phones and tablets. Check the Linux on Dex website https://www.linuxondex.com to see if your device is supported. Linux on Dex is still in beta testing, so the information below may change.  
[https://www.linuxondex.com/ 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.
To build Octave on LoD, do the following. This assumes you have LoD working. If not, follow the instructions on the LoD website.


1. 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.
# Many of the packages that Octave needs are not in the default Ubuntu installation. You will need to install them using <code>sudo apt install <package></code>. 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 <code>sudo apt remove libopenblas*</code>. The OpenBLAS library from the default Ubuntu distribution does not work with Octave. You have to remove it. For details see bug {{bug|56900}}.
# Unpack the Octave source code and enter the directory. Create a build directory <code>mkdir my_build</code>, enter that directory and issue <code>../configure</code>. 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 using <code>sudo apt install <package></code> before compiling. If you want to install Octave in "my_build" be sure to issue <code>../configure --prefix=`pwd`</code> from this directory.
# In the {{Path|my_build}} directory issue <code>make</code> and <code>make install</code>.


2. Remove all "libopenblas" packages with "sudo apt remove libopenblas*". The OpenBLAS library in the default Ubuntu distribution does not work with Octave. You have to remove it. See details here: https://savannah.gnu.org/bugs/?56900
Now you should have a working installation in, e.g., {{Path|/home/dextop/path_to/octave-5.1.0/my_build/}}.
 
3. Unpack the Octave source code and enter the directory. Make a 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 using "sudo apt install <package>" before compiling. If you want to install Octave in "my_build" be sure to issue "../configure --prefix=`pwd`" from this directory.
 
4. In the "my_build" directory issue "make" and "make install".
 
You should now have a working installation in, e.g., /home/dextop/path_to/octave-5.1.0/my_build/


Graphics:
Graphics:


1. 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 add "setenv GNUTERM x11" to your .octaverc file to do this automatically.
# 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 <code>export GNUTERM=x11</code> in the bash terminal or in your octave session issuing "setenv GNUTERM x11". You can also add <code>setenv GNUTERM x11</code> to your {{Path|.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 [https://github.com/termux/libandroid-shmem 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.
2. 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 from https://github.com/termux/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.


== Android app ==
== Android app ==

Revision as of 06:56, 23 October 2019

Octave for Linux on Dex (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.

  1. 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.
  2. 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.
  3. 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 using sudo apt install <package> before compiling. If you want to install Octave in "my_build" be sure to issue ../configure --prefix=`pwd` from this directory.
  4. In the my_build directory issue make and make install.

Now you should have a working installation in, e.g., /home/dextop/path_to/octave-5.1.0/my_build/.

Graphics:

  1. 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 add setenv GNUTERM x11 to your .octaverc file to do this automatically.
  2. 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.

Android app

The Android app Octave in Google play is built and maintained by Corbin Champion and not part of the GNU Octave project.

The source and some build instructions for the installer can be found here

This link might have some other, perhaps now outdated, build instructions:

You are offered a choice of downloading the app, for which a donation is requested, or you can download the full source and build your own version for free. This will require the Octave sources, Corbin's GitHub repository, and the Android SDK.

This implementation has been done in close cooperation with the Octave developers and makes use of the current Octave source essentially without any change. Thus, it is fully compatible with the versions of Octave on other platforms.