This is probably embarrassingly obvious =- having installed Octave 3.6.2 using app-get, I now need to install the control package for Octave. Normally I'd do this by downloading the package from sourceforge and then from inside Octave type> pkg install pkg install control-2.2.0.tar.gz
However when i do this I get a whole bunch of error messages probably because I'm not logged in as su or root.
So how do I login as su or root and then run Octave?
Raspbian- Octave - installing packages
24 posts
- Posts: 3
- Joined: Wed Dec 05, 2012 12:36 am
sudo octave
apparently!
apparently!
- Posts: 3
- Joined: Wed Dec 05, 2012 12:36 am
That worked for a few packages, but not the one I needed.
- Posts: 3
- Joined: Wed Dec 05, 2012 12:36 am
Matlab vector programming has caught at an astonishing rate. It's arguably the most widely used language in the engineering community, academic and industry - moreso than Python. The problem for home use is cost - the basic license runs at about $7,000 USD.
But for basic Matlab operations including vector math, GNU Octave is virtually the same and free. So greglocock, you are on to something very big here. I commend you for your effort. Some basic questions for you...
* Did you download octave from here: ftp://ftp.gnu.org/gnu/octave ?
* There are several 3.6.2 tar files; which one did you pick?
* How did you put the tar file on the R-Pi? From windows 7 to the SD card? Where on the SD card?
* From within R-Pi, precisely how did you untar octave? Command line or startx?
* Once installed in R-Pi, how do you run Octave?
* In Octave environment, were you able to communicate with the R-Pi input/output pins?
Thank you.
But for basic Matlab operations including vector math, GNU Octave is virtually the same and free. So greglocock, you are on to something very big here. I commend you for your effort. Some basic questions for you...
* Did you download octave from here: ftp://ftp.gnu.org/gnu/octave ?
* There are several 3.6.2 tar files; which one did you pick?
* How did you put the tar file on the R-Pi? From windows 7 to the SD card? Where on the SD card?
* From within R-Pi, precisely how did you untar octave? Command line or startx?
* Once installed in R-Pi, how do you run Octave?
* In Octave environment, were you able to communicate with the R-Pi input/output pins?
Thank you.
- Posts: 31
- Joined: Fri Mar 23, 2012 7:25 am
In general, if you install some packages like NaN or the Matlab export tools it can cause inconsistent behavior. Additionally, some forge packages are not compatible after v3.0.5.
I detail how to install octave 3.6 with stats packages here:
[url]
viewtopic.php?f=34&t=27348
[/url]
I would suggest doing a "apt-get --purge remove you selections", apt-get update, and then follow the package list & octave forge pkg list above...
Best of luck,
J
I detail how to install octave 3.6 with stats packages here:
[url]
viewtopic.php?f=34&t=27348
[/url]
I would suggest doing a "apt-get --purge remove you selections", apt-get update, and then follow the package list & octave forge pkg list above...
Best of luck,
J
- Posts: 10
- Joined: Mon Nov 12, 2012 10:22 pm
The maintainer already build the forge packages for you.
For example octave-control: http://archive.raspbian.org/raspbian/pool/main/o/octave-control/
So instead using "pkg -forge install ..." on a debian bases system you should use
Regards, Andy
For example octave-control: http://archive.raspbian.org/raspbian/pool/main/o/octave-control/
So instead using "pkg -forge install ..." on a debian bases system you should use
- Code: Select all
aptitude install octave-control
Regards, Andy
- Posts: 8
- Joined: Fri Jan 04, 2013 7:01 pm
Apt-get is the normal ideal way to handle the dependencies, but in this case there are packages for 3 different versions of octave with incompatibilities
.
Optionally, one could use the following to handle large dependency lists, and still use the up-to-date internal version matched octave pkgs:
Optionally, one could use the following to handle large dependency lists, and still use the up-to-date internal version matched octave pkgs:
- Code: Select all
apt-cache depends octave-gsl
- Posts: 10
- Joined: Mon Nov 12, 2012 10:22 pm
Joel_Mckay, Andy1978, have you interacted with the GPIO pins from Octave code?
- Posts: 31
- Joined: Fri Mar 23, 2012 7:25 am
Joel_Mckay wrote:Apt-get is the normal ideal way to handle the dependencies, but in this case there are packages for 3 different versions of octave with incompatibilities.
[/code]
Dear Joel_Mckay,
I've bought a RaspberryPi yesterday and installed octave 3.6.2-5 and octave-control 2.3.52 on Raspbian wheezy without any problems. I don't want to admonish you but please don't give false advice.
The debian maintainers should keep track of incompatibilities. If there is a problem then file a bug report on that package.
"pkg -forge install" installs the latest release on sourceforge but that is not necessarily compatible with the "octave core" version you will get via apt-get.
Best regards, Andy
- Posts: 8
- Joined: Fri Jan 04, 2013 7:01 pm
Andy1978, within Octave, have you interacted with the raspberry GPIO pins?
- Posts: 31
- Joined: Fri Mar 23, 2012 7:25 am
@Andy, thanks for the comment... but I wouldn't answer if I hadn't tried it myself.
Current repo for octave in wheezy is v3.6. And the octave "pkg" command uses the same compiler wrapper for custom octave C++ binary modules. Notably, randomvibe could create a custom module if the io permissions are unworkable.
You will see many messages similar to the following if you just use apt to install random octave deb packages.
You will find OLD incompatible packages are necessarily still available for legacy support, as many parts of octave were refactored in the January 2012 release. One could use octave3.2 which has INCOMPATIBLE library dependencies with octave 3.6. However, you are almost guaranteed that the installation will have problems (albeit documented ones since its an old version).
Next time, try actually installing the program before making uninformed comments.
Now watch me have more fun testing a working installation...

Current repo for octave in wheezy is v3.6. And the octave "pkg" command uses the same compiler wrapper for custom octave C++ binary modules. Notably, randomvibe could create a custom module if the io permissions are unworkable.
You will see many messages similar to the following if you just use apt to install random octave deb packages.
- Code: Select all
sudo apt-get install octave-headers
... octave3.2-headers : Depends: octave3.2 (= 3.2.4-12) ...
You will find OLD incompatible packages are necessarily still available for legacy support, as many parts of octave were refactored in the January 2012 release. One could use octave3.2 which has INCOMPATIBLE library dependencies with octave 3.6. However, you are almost guaranteed that the installation will have problems (albeit documented ones since its an old version).
Next time, try actually installing the program before making uninformed comments.
Now watch me have more fun testing a working installation...
- Posts: 10
- Joined: Mon Nov 12, 2012 10:22 pm
Joel_Mckay wrote: Current repo for octave in wheezy is v3.6.
3.6.2 as I wrote above
Joel_Mckay wrote:You will see many messages similar to the following if you just use apt to install random octave deb packages.
- Code: Select all
sudo apt-get install octave-headers
... octave3.2-headers : Depends: octave3.2 (= 3.2.4-12) ...
First: You should not try to install random packages.
Second: If you want to use mkoctfile to build some programs for liboctave 3.6, you should install liboctave-dev
The dependency above is correct. octave-headers was used for octave3.2.
- Code: Select all
sudo aptitude install liboctave-dev
Joel_Mckay wrote:One could use octave3.2 which has INCOMPATIBLE library dependencies with octave 3.6.
Sure, If they were compatible, why would maintainers provide both?
For me this is EOD
Regards Andy
- Posts: 8
- Joined: Fri Jan 04, 2013 7:01 pm
With all the "friendly" exchanges between Andy1978 and Joel_Mckay, they probably haven't found the time to answer this question: can a user interact with the raspberry GPIO pins from Octave? I take the snub as a tacit NO. That said, I think such a capability would be a powerful capability for current and future Raspberry Pi customers who are familiar with Matlab. According to the link below, a C library providing access to the GPIO pins exists. Is it possible to link that library to Octave?
http://www.open.com.au/mikem/bcm2835/
http://www.open.com.au/mikem/bcm2835/
- Posts: 31
- Joined: Fri Mar 23, 2012 7:25 am
randomvibe wrote:Joel_Mckay, Andy1978, have you interacted with the GPIO pins from Octave code?
Sure, you can use mkoctfile from liboctave-dev to build your wrapper around
http://www.open.com.au/mikem/bcm2835/. I only build a little test to toggle a GPIO from octave. If you are interested I'll upload it to the octave wiki.
Regards, Andy
- Posts: 8
- Joined: Fri Jan 04, 2013 7:01 pm
I only build a little test to toggle a GPIO from octave. If you are interested I'll upload it to the octave wiki.
Please do. Thank you.
- Posts: 31
- Joined: Fri Mar 23, 2012 7:25 am
@randomvibe
There are actually two ways to do this:
1. Create a loadable Octave C++ binary user lib. Andy seems quite knowledgeable in this area, and can likely offer guidance on how to avoid common issues.
2. Create a C++ program and use liboctave resources similar to this process:
You will need to "#include <octave/oct.h>" in gpiodemo.cpp for a pin access example:
http://elinux.org/RPi_Low-level_periphe ... _.28C.29_2
Compile:
g++ -c -I$(OCTAVE_INCLUDE) -I$(OCTAVE_INCLUDE)octave -o gpiodemo.o gpiodemo.cpp
Run octave linker:
mkoctfile --link-stand-alone -o gpiodemo gipodemo.o
Test local program:
sudo ./gpiodemo
@Andy, I would be interested if anyone has successfully installed these libs on the Pi yet. http://code.google.com/p/pmtk3/
they are pretty neat... peace dude... 
There are actually two ways to do this:
1. Create a loadable Octave C++ binary user lib. Andy seems quite knowledgeable in this area, and can likely offer guidance on how to avoid common issues.
2. Create a C++ program and use liboctave resources similar to this process:
You will need to "#include <octave/oct.h>" in gpiodemo.cpp for a pin access example:
http://elinux.org/RPi_Low-level_periphe ... _.28C.29_2
Compile:
g++ -c -I$(OCTAVE_INCLUDE) -I$(OCTAVE_INCLUDE)octave -o gpiodemo.o gpiodemo.cpp
Run octave linker:
mkoctfile --link-stand-alone -o gpiodemo gipodemo.o
Test local program:
sudo ./gpiodemo
@Andy, I would be interested if anyone has successfully installed these libs on the Pi yet. http://code.google.com/p/pmtk3/
- Posts: 10
- Joined: Mon Nov 12, 2012 10:22 pm
randomvibe wrote:I only build a little test to toggle a GPIO from octave. If you are interested I'll upload it to the octave wiki.
Please do. Thank you.
Hi randomvibe,
I just packed my little test: http://www.tech-chat.de/files/oct-gpio.tar.gz
untar it and have a look at README. It only implements init, close, set direction, set and clr.
If you are interested in contributing poste to the octave mailing list and we will define a convenient API to the libbcm2835. After this I think its possible to include the wrapper into a octave-forge package?
Regards, Andy
- Posts: 8
- Joined: Fri Jan 04, 2013 7:01 pm
Andy1978 - I am at a disadvantage of not being a Linux expert or C/C++ programmer or installer, etc. I think C/C++ is as horrible as radioactivity. My expertise is programming Matlab (and consequently Octave) related to dynamics for 16 years, so the best help I can offer is testing Octave on the R-Pi. I'll take a look at your *.tar file and see what I can do. Thank you for your interest in Octave - I think a microcontroller or single-board-computer programmable in Octave would be an enormous advantage over other systems. I'm raising awareness here:
http://forums.adafruit.com/viewtopic.php?f=8&t=35959
http://forums.adafruit.com/viewtopic.php?f=8&t=35959
- Posts: 31
- Joined: Fri Mar 23, 2012 7:25 am
Andy1978 - I was finally able to install Octave on my R-Pi. It functions beautifully, even the plotting functions work. I basically entered the following command per your suggestion:
- Code: Select all
sudo aptitude install liboctave-dev
- Posts: 31
- Joined: Fri Mar 23, 2012 7:25 am
randomvibe wrote:Anyway, I tried downloading your [b]oct-gpio.tar.gz, but it appears to be empty. Is it still available? Thank you.
Hi randomvibe.
I've checked the above link and can't see a problem. Its a valid gziped archive.
Try on your raspberry pi
- Code: Select all
wget http://www.tech-chat.de/files/oct-gpio.tar.gz
tar xzvf oct-gpio.tar.gz
cd oct-GPIO
make
- Posts: 8
- Joined: Fri Jan 04, 2013 7:01 pm
Andy1978 - This linux stuff is awkward. I'm use to installing on Windows. From the R-Pi, I was able to retrieve your files, but I had problems with 'make':
So I attempted to install 'mkoctfile' by installing octave--headers, but the following did not work:
Is there a straightforward way of installing mkoctfile? Thank you.
- Code: Select all
pi@raspberrypi ~/Scratch/oct-GPIO $ make
mkoctfile -v bcm2835oct.cpp -Wall -Wextra -lbcm2835 -o bcm2835.oct
make: mkoctfile: Command not found
make: *** [bcm2835.oct] Error 127
So I attempted to install 'mkoctfile' by installing octave--headers, but the following did not work:
- Code: Select all
pi@raspberrypi ~/Scratch/oct-GPIO $ sudo apt-get install octave-headers
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'octave3.2-headers' instead of 'octave-headers'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
octave3.2-headers : Depends: octave3.2 (= 3.2.4-12) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Is there a straightforward way of installing mkoctfile? Thank you.
- Posts: 31
- Joined: Fri Mar 23, 2012 7:25 am
As described on the wiki "liboctave-dev" and I've already explained in previous posts: Do not mess with octave3.2, in your case "octave-header"
- Posts: 8
- Joined: Fri Jan 04, 2013 7:01 pm
And rtfm, README:
14.1.2013 Andreas Weber
Oct wrapper v0.0.1 around libbcm2835
1.) install octave and liboctave-dev as described on
http://wiki.octave.org/Rasperry_Pi
2.) get and compile libbcm2835 from http://www.open.com.au/mikem/bcm2835/
$ wget http://www.open.com.au/mikem/bcm2835/bc ... .16.tar.gz
$ tar xzvf bcm2835-1.16.tar.gz
$ cd bcm2835-1.16/
$ ./configure
$ make
$ sudo make install
3.) compile the oct wrapper
$ make
4.) Test it
run octave as root
$ sudo octave
execute simple Test with GPIO 7 (lower right edge, see here http://elinux.org/RPi_Low-level_peripherals)
Attention: there is also a Revision2 which different GPIO layout
octave:1> test_bcm2835oct
- Posts: 8
- Joined: Fri Jan 04, 2013 7:01 pm
Andy1978 wrote:As described on the wiki "liboctave-dev" and I've already explained in previous posts: Do not mess with octave3.2, in your case "octave-header"
I think it's best to start from scratch and reformat my SD card. Thanks for the README and wiki instructions. I'll give it a go.
- Posts: 31
- Joined: Fri Mar 23, 2012 7:25 am