samedi 30 mars 2013

Octave/Ubuntu: problems installing additional packages

This post started out as a question on SO, but as I finally found the answer, I though it might interest other people.

Consider the following situation: you need to do some function data-fitting, you don't {wan't to use / have access to} Matlab, and think that Octave might be an alternative.

First problem: your version of Octave on you current Ubuntu 12.04 is slightly outdated, and sudo apt-get install doesn't seem to have a more recent version.

You can upgrade using an unofficial ppa, as described on this page.


Then, Octave actually doesn't have data-fitting material. It is provided as additional packages (see here). And according to this page, it is the optim package that you need.

Once downloaded, running the following line in the Octave shell
pkg install optim-1.2.2.tar.gz
tells you that there are additional packages required (`miscellaneous`, `struct` and `general`). And at one point you might hit the following error (or something near), complaining about something called mkoctfile:

make: /usr/bin/mkoctfile: Command not found
    make: *** [__exit__.oct] Error 127
    'make' returned the following error: make: Entering directory `/tmp/oct-P11IKL/general/src'
    /usr/bin/mkoctfile __exit__.cc
    make: Leaving directory `/tmp/oct-P11IKL/general/src'
    error: called from `pkg>configure_make' in file /usr/share/octave/3.6.2/m/pkg/pkg.m         near line 1391, column 9
    error: called from:
    error:   /usr/share/octave/3.6.2/m/pkg/pkg.m at line 834, column 5
    error:   /usr/share/octave/3.6.2/m/pkg/pkg.m at line 383, column 9


If you search about this, you might find this question, where the answer (unaccepted) says that you should sudo apt-get install octave-signal

Don't ! Depending on your ppa settings, this might revert your Octave installation to 3.2, which is not desirable.

The solution requires to install the Octave development packages with :
sudo apt-get install octave-pkg-dev

Finally, It seems that installation of some (?) packages writes stuff in /usr/share/octave/, which can't be done by user (and 'sudo' can't be run from Octave 's shell).
So the easiest it to switch as root before starting Octave (with su), then install the packages, then quit Octave.



Aucun commentaire:

Enregistrer un commentaire