Editing Octave in home directory

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
#REDIRECT [[Building]]
Installing in your home directory is a method to install GNU Octave next to your repository installation at the same time. This works with every Linux distribution and is especially for old Ubuntu LTS versions very useful!
 
One advantage is that you do not clutter your system by running ''sudo make install''.
Another advantage is that you can keep your Octave installation that is provided by your distribution.
 
== 1. Install dependencies ==
 
Take a look at [[Building for Linux systems]] and [[Building]].
 
General information you can gather from the `./configure` summary or read the {{Path|INSTALL.OCTAVE}} file that comes distributed with Octave.
 
== 2. Download Octave Sourcecode ==
 
Take a release from ftp.gnu.org, e.g. 3.8.0.
 
  wget ftp://ftp.gnu.org/gnu/octave/octave-3.8.0.tar.bz2
  tar xfvj octave-3.8.0.tar.bz2
  cd octave-3.8.0/
 
or clone current development branch
 
  hg clone http://hg.octave.org/octave/
  cd octave/
 
 
== 3. configure ==
 
Only if you want to install from mercurial ''(hg.octave.org)'', you have to do first:
./bootstrap
 
Now it's time to run ./configure with a prefix that points to a directory in your home directory. E.g., my username is ''maxpower'' and I want to install Octave to ''~/.octave38/''
./configure --prefix=/home/maxpower/.octave38/
 
Another way, if you intend to compile for yourself a lot of utilities, is to mirror the main /usr structure into your own dir:
./configure --prefix=${HOME}/usr
Pay attention to the configure summary at the end (See chapter 1).
 
== 4. make & make install ==
 
After you have successful configured octave without errors ''(warnings may be okay)'', you can run ''make''. If you have a dual core CPU, you can run make with two threads like that (increase -j number if you have more CPU cores).
make -j2
This may take now ~30-300 Minutes (depends on the speed of your cpu and the size of your RAM)
 
Feel free to run ''make check'' too.
 
When ''make -j2'' finished without errors, simply run '''without''' sudo/root permissions
make install
Octave will now be installed to /home/maxpower/.octave38/
 
 
== 5. create a smart bashrc entry ==
 
echo "alias octave38='~/.octave38/bin/octave'" >> ~/.bashrc
. ~/.bashrc # this will update your bashrc without doing logout and login!
 
If you simply enter ''octave'', you'll start your repository installation provided by your distribution. But when you enter ''octave38'', you'll start your new snappy octave version installed to your home directory.
 
== Uninstall ==
 
==== Method A ====
 
If you're still have the compiled source folder, just do ''make uninstall'' from it. And don't forget to remove the ''alias octave38'' entry in your ''~/.bashrc''.
 
==== Method B ====
 
Just delete (e.g. ''rm -rf ~/.octave38/'') the install folder and remove the ''alias octave38'' entry from your ''~/.bashrc''.
 
 
[[Category:Building]]
[[Category:Installation]]
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)