Raspbian- Octave - installing packages


26 posts   Page 1 of 2   1, 2
by greglocock » Wed Dec 05, 2012 12:44 am
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?
Posts: 3
Joined: Wed Dec 05, 2012 12:36 am
by greglocock » Wed Dec 05, 2012 4:40 am
sudo octave

apparently!
Posts: 3
Joined: Wed Dec 05, 2012 12:36 am
by greglocock » Fri Dec 07, 2012 2:05 am
That worked for a few packages, but not the one I needed.
Posts: 3
Joined: Wed Dec 05, 2012 12:36 am
by randomvibe » Thu Jan 03, 2013 7:44 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.
Posts: 31
Joined: Fri Mar 23, 2012 7:25 am
by Joel_Mckay » Fri Jan 04, 2013 7:40 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

sim.jpg
sim.jpg (26.4 KiB) Viewed 5217 times
Posts: 14
Joined: Mon Nov 12, 2012 10:22 pm
by Andy1978 » Fri Jan 04, 2013 7:04 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
Code: Select all
aptitude install octave-control


Regards, Andy
Posts: 9
Joined: Fri Jan 04, 2013 7:01 pm
by Joel_Mckay » Sat Jan 05, 2013 2:27 am
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 :shock: .

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: 14
Joined: Mon Nov 12, 2012 10:22 pm
by randomvibe » Mon Jan 07, 2013 8:03 am
Joel_Mckay, Andy1978, have you interacted with the GPIO pins from Octave code?
Posts: 31
Joined: Fri Mar 23, 2012 7:25 am
by Andy1978 » Wed Jan 09, 2013 10:15 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 :shock: .
[/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: 9
Joined: Fri Jan 04, 2013 7:01 pm
by randomvibe » Wed Jan 09, 2013 9:12 pm
Andy1978, within Octave, have you interacted with the raspberry GPIO pins?
Posts: 31
Joined: Fri Mar 23, 2012 7:25 am
by Joel_Mckay » Thu Jan 10, 2013 5:04 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.
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.
:roll:

Now watch me have more fun testing a working installation...
:D :D :D :D :D :D :D :D :D :D :D :D
mesh.jpg
mesh.jpg (30.77 KiB) Viewed 5017 times
Posts: 14
Joined: Mon Nov 12, 2012 10:22 pm
by Andy1978 » Thu Jan 10, 2013 7:01 am
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: 9
Joined: Fri Jan 04, 2013 7:01 pm
by randomvibe » Thu Jan 10, 2013 6:16 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/
Posts: 31
Joined: Fri Mar 23, 2012 7:25 am
by Andy1978 » Thu Jan 10, 2013 10:40 pm
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: 9
Joined: Fri Jan 04, 2013 7:01 pm
by randomvibe » Thu Jan 10, 2013 11:12 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
by Joel_Mckay » Fri Jan 11, 2013 3:53 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... :D
Posts: 14
Joined: Mon Nov 12, 2012 10:22 pm
by Andy1978 » Mon Jan 14, 2013 3:40 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: 9
Joined: Fri Jan 04, 2013 7:01 pm
by randomvibe » Tue Jan 15, 2013 7:20 am
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
Posts: 31
Joined: Fri Mar 23, 2012 7:25 am
by randomvibe » Sun Jan 20, 2013 9:50 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
Anyway, I tried downloading your oct-gpio.tar.gz, but it appears to be empty. Is it still available? Thank you.
Posts: 31
Joined: Fri Mar 23, 2012 7:25 am
by Andy1978 » Tue Jan 22, 2013 3:59 pm
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: 9
Joined: Fri Jan 04, 2013 7:01 pm
by randomvibe » Fri Jan 25, 2013 7:18 am
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':
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
by Andy1978 » Sat Jan 26, 2013 8: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: 9
Joined: Fri Jan 04, 2013 7:01 pm
by Andy1978 » Sat Jan 26, 2013 8:30 am
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: 9
Joined: Fri Jan 04, 2013 7:01 pm
by randomvibe » Sun Jan 27, 2013 8:42 am
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
by minhdang » Sat Jun 21, 2014 11:41 am
Hello Andy1978, randomvibe,

I'm an Octave user as well, today I tried to get the octave wrapper for GPIO, however the file oct-gpio.tar.gz on tech-chat.de is missing at this time, so I was stopped after making the libbcm2835 (I've installed liboctave-dev, gotten the updated version bcm2836-1.36.tar.gz and installed it sucessfully).

Could you kindly upload the file oct-gpio.tar.gz again?

Thank you very much!
Posts: 1
Joined: Sat Jun 21, 2014 11:20 am