User avatar
linux1492
Posts: 5
Joined: Sat Nov 24, 2012 9:45 am
Location: EU - GERMANY
Contact: Website

additional Octave packages for RasPi?

Fri Dec 28, 2012 7:48 pm

Hi,

I guess it is commonly accepted knowledge that Octave (Matlab clone) is working on ARM CPUs. O.k. it does work on my Android phone and on my RasPi. But when starting to compile more interesting projects, where Octave is involved I faced troubles.

Actually, a simple matter such as including some Octave libs to a C++ code failed, because I did not manage to install the octave add-ons such as octave-headers or octave-dev or similar. APT tells me that it only has Reps to broken packages. So is there any package what I could install and how to do it if APT does not want to help me? From scratch? But from where.

To be precise I wish to include the following files into a c++ file:
oct.h
Matrix.h
ov.h
load-save.h
ls-mat5.h

I did of course try to cp those files and the one required by them just into one folder. Also that did not turn out working :?:

I would be happy if somebody could give me a lead. Thx.

mike

User avatar
Joel_Mckay
Posts: 295
Joined: Mon Nov 12, 2012 10:22 pm
Contact: Website

Re: additional Octave packages for RasPi?

Fri Jan 04, 2013 5:06 am

Install on any Debian squeeze distro...

Code: Select all

sudo apt-get install liboctave-dev swig lpr pstoedit epstool transfig svn2cl 
sudo apt-get install octave libiodbc2-dev graphicsmagick-dbg liblcms-utils octave-fixed
You need to run octave in a terminal, and be prepared to wait awhile...

Code: Select all

octave:1> pkg install -forge strings missing-functions general  linear-algebra  io financial  struct miscellaneous control optim gnuplot
After a long wait, it will have downloaded and installed the correct pkgs for your octave version (they may differ from the apt versions.)

The database wrapper pkg is still broken in the new 3.6 release.
However, almost all the libs will work iff the dependencies are present.

User avatar
linux1492
Posts: 5
Joined: Sat Nov 24, 2012 9:45 am
Location: EU - GERMANY
Contact: Website

Re: additional Octave packages for RasPi?

Sat Jan 05, 2013 5:29 pm

@Joel: Thank you. most of the stuff you was suggesting was working fine. But as usual there are some strange things happening ... when executing the package installation within Octave most seem to work, but there are plenty of errors reported. See below:
octave:1> pkg install -forge strings missing-functions general linear-algebra io financial struct miscellaneous control optim gnuplot
dbleGSVD.cc: In member function ‘octave_idx_type GSVD::init(const Matrix&, const Matrix&, GSVD::type)’:
dbleGSVD.cc:190:31: warning: ‘Array<T>::Array(octave_idx_type, const T&) [with T = double, octave_idx_type = int]’ is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:185) [-Wdeprecated-declarations]
dbleGSVD.cc:191:28: warning: ‘Array<T>::Array(octave_idx_type, const T&) [with T = double, octave_idx_type = int]’ is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:185) [-Wdeprecated-declarations]
dbleGSVD.cc:192:27: warning: ‘Array<T>::Array(octave_idx_type, const T&) [with T = double, octave_idx_type = int]’ is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:185) [-Wdeprecated-declarations]
dbleGSVD.cc:193:28: warning: ‘Array<T>::Array(octave_idx_type, const T&) [with T = int, octave_idx_type = int]’ is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:185) [-Wdeprecated-declarations]
CmplxGSVD.cc: In member function ‘octave_idx_type ComplexGSVD::init(const ComplexMatrix&, const ComplexMatrix&, GSVD::type)’:
CmplxGSVD.cc:194:33: warning: ‘Array<T>::Array(octave_idx_type, const T&) [with T = std::complex<double>, octave_idx_type = int]’ is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:185) [-Wdeprecated-declarations]
CmplxGSVD.cc:195:30: warning: ‘Array<T>::Array(octave_idx_type, const T&) [with T = double, octave_idx_type = int]’ is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:185) [-Wdeprecated-declarations]
CmplxGSVD.cc:196:29: warning: ‘Array<T>::Array(octave_idx_type, const T&) [with T = double, octave_idx_type = int]’ is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:185) [-Wdeprecated-declarations]
CmplxGSVD.cc:197:31: warning: ‘Array<T>::Array(octave_idx_type, const T&) [with T = double, octave_idx_type = int]’ is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:185) [-Wdeprecated-declarations]
CmplxGSVD.cc:198:30: warning: ‘Array<T>::Array(octave_idx_type, const T&) [with T = int, octave_idx_type = int]’ is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:185) [-Wdeprecated-declarations]
pcregexp.cc:25:18: fatal error: pcre.h: No such file or directory
compilation terminated.
make: *** [pcregexp.oct] Error 1
'make' returned the following error: make: Entering directory `/tmp/oct-4LyszM/strings/src'
mkoctfile -Wall pcregexp.cc
make: Leaving directory `/tmp/oct-4LyszM/strings/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
I am not aware what is the reason for this final error. I might try to take a new SD-Card and set up the latest Debian and try once again. But since it takes really some time to do what you had proposed I drop this message already here.

BTW: My initial problem with the including the Octave libs to the C++ code was somehow working out. But only somehow because the same kind of error type with regards to some "arrays" as also displayed above are preventing my C++ code to be executed.

User avatar
Joel_Mckay
Posts: 295
Joined: Mon Nov 12, 2012 10:22 pm
Contact: Website

Re: additional Octave packages for RasPi?

Mon Jan 07, 2013 4:17 am

1.) Check which kernel and OS you are running:

Code: Select all

pi@hosts ~/> uname -a
Linux hosts 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux

pi@hosts ~/> cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 7.0 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="7.0"
VERSION="7.0 (wheezy)"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"
2.) Check which deb packages are already installed, as you may have to "apt-get --purge remove " old packages if the version is wrong, and remember to first "sudo apt-get clean; sudo apt-get update":

Code: Select all

pi@hosts ~/> dpkg --get-selections | grep octave
liboctave-dev                                   install
liboctave1:armhf                                install
octave                                          install
octave-common                                   install
octave-fixed                                    install

pi@hosts ~/>  dpkg --get-selections | grep libblas
libblas-dev                                     install
libblas3                                        install
libblas3gf                                      install

pi@hosts ~/> dpkg --get-selections | grep libarpack
libarchive12:armhf                              install
libarpack2                                      install

pi@hosts ~/> dpkg --get-selections | grep liblapack
liblapack-dev                                   install
liblapack3                                      install
liblapack3gf                                    install
3.) Install each octave pkg separately as root user to narrow problem scope (this normally should not be necessary, and is generally avoided for obvious reasons):

Code: Select all

pi@hosts ~/> sudo octave 
octave:0> pkg install -forge strings
octave:0> pkg install -forge missing-functions
octave:0> pkg install -forge general 
octave:0> pkg install -forge linear-algebra 
octave:0> pkg install -forge io
octave:0> pkg install -forge statistics  
octave:0> pkg install -forge financial 
octave:0> pkg install -forge struct
octave:0> pkg install -forge miscellaneous
octave:0> pkg install -forge control
octave:0> pkg install -forge optim
octave:0> pkg install -forge splines
octave:0> pkg install -forge gnuplot
4.) Fix the problem created in 3.) by changing group ownership to allow the "users" group members full read access to libs (but keep root admin ownership to prevent users accidentally damaging libs):

Code: Select all

sudo chown -hR root:users /usr/share/octave/
Best of luck,
:ugeek:

Return to “Other programming languages”