octave and NAG

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

octave and NAG

Gorazd Brumen
Hi,

Does anybody have experience with using octave and NAG fortran or c
libraries (NAG = numerical algorithms group)? Can he share his
experience with us?


Thanks a lot,
Gorazd


--
Gorazd Brumen
Mail: [hidden email]
WWW: http://valjhun.fmf.uni-lj.si/~brumen
PGP: Key at http://pgp.mit.edu, ID BCC93240



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: octave and NAG

Kevin H. Hobbs
On Tue, 2006-03-28 at 13:28 +0200, Gorazd Brumen wrote:

> Hi,
>
> Does anybody have experience with using octave and NAG fortran or c
> libraries (NAG = numerical algorithms group)? Can he share his
> experience with us?
>
>
> Thanks a lot,
> Gorazd
>
>
Depending on what you mean, Yes. I've had experience with octave and the
NAG C libraries. If you mean some Frankenstein build of octave with NAG
then, no I've only used them as separate projects.  When I used NAG I
was tormented by their documentation.  I switched to the GNU Science
Library ( GSL ) which does almost everything NAG does but also has
understandable documentation. Somehow combining octave and GSL seems
very sane, wrapper functions and such. Their both GPL at least.

signature.asc (198 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

octave and gsl

Gorazd Brumen
hi,

the reference to gsl was my next possibility. I compiled the following
script with mkoctfile

#include <octave/oct.h>
#include <math.h>
#include <gsl/gsl_sf_bessel.h>


DEFUN_DLD (gn, args,  , " gn function") {

  ColumnVector res (1);

  res(1) = gsl_sf_bessel_Jnu (2, 3);

  return octave_value ( res );

}


compile with mkoctfile gn.cc -lm -lgsl -lcblas
and it compiles ok. then when i run it in octave i get

*** glibc detected *** free(): invalid next size (fast): 0x08b8d140 ***
panic: Aborted -- stopping myself...
attempting to save variables to `octave-core'...
save to `octave-core' complete
Aborted


octave 2.1.72, ubuntulinux package.


can someone help me what i am doing wrong?

thank, g.


Kevin H. Hobbs wrote:

> On Tue, 2006-03-28 at 13:28 +0200, Gorazd Brumen wrote:
>
>>Hi,
>>
>>Does anybody have experience with using octave and NAG fortran or c
>>libraries (NAG = numerical algorithms group)? Can he share his
>>experience with us?
>>
>>
>>Thanks a lot,
>>Gorazd
>>
>>
>
>
> Depending on what you mean, Yes. I've had experience with octave and the
> NAG C libraries. If you mean some Frankenstein build of octave with NAG
> then, no I've only used them as separate projects.  When I used NAG I
> was tormented by their documentation.  I switched to the GNU Science
> Library ( GSL ) which does almost everything NAG does but also has
> understandable documentation. Somehow combining octave and GSL seems
> very sane, wrapper functions and such. Their both GPL at least.

--
Gorazd Brumen
Mail: [hidden email]
WWW: http://valjhun.fmf.uni-lj.si/~brumen
PGP: Key at http://pgp.mit.edu, ID BCC93240



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

octave and gsl

John W. Eaton-6
On 29-Mar-2006, Gorazd Brumen wrote:

| hi,
|
| the reference to gsl was my next possibility. I compiled the following
| script with mkoctfile
|
| #include <octave/oct.h>
| #include <math.h>
| #include <gsl/gsl_sf_bessel.h>
|
|
| DEFUN_DLD (gn, args,  , " gn function") {
|
|   ColumnVector res (1);
|
|   res(1) = gsl_sf_bessel_Jnu (2, 3);
|
|   return octave_value ( res );
|
| }
|
|
| compile with mkoctfile gn.cc -lm -lgsl -lcblas
| and it compiles ok. then when i run it in octave i get
|
| *** glibc detected *** free(): invalid next size (fast): 0x08b8d140 ***
| panic: Aborted -- stopping myself...
| attempting to save variables to `octave-core'...
| save to `octave-core' complete
| Aborted
|
|
| octave 2.1.72, ubuntulinux package.
|
|
| can someone help me what i am doing wrong?

Probably you want

  ColumnVector res (1);

  res(0) = gsl_sf_bessel_Jnu (2, 3);

since indexing for ColumnVector objects is 0-based.  Or, if you just
want to return a scalar value,

  return octave_value (gsl_sf_bessel_Jnu (2, 3));

(assuming gsl_sf_bessel_Jnu returns a double value).

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: octave and gsl

Stéfan van der Walt
In reply to this post by Gorazd Brumen
On Wed, Mar 29, 2006 at 09:06:12AM +0200, Gorazd Brumen wrote:
> DEFUN_DLD (gn, args,  , " gn function") {
>
>   ColumnVector res (1);
>
>   res(1) = gsl_sf_bessel_Jnu (2, 3);
>
>   return octave_value ( res );
>
> }

C uses 0-based indexing, so you should use

res(0) = ...

in the assignment.

Stéfan



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: octave and gsl

Paul Kienzle
In reply to this post by Gorazd Brumen

On Mar 29, 2006, at 2:06 AM, Gorazd Brumen wrote:

> the reference to gsl was my next possibility.

There is a GSL wrapper available in octave-forge.

- Paul



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: octave and gsl

Gorazd Brumen
hi paul,

sorry, dont quite get it what that means. can you direct me to the
web location?
could not find anything similar on o-f.


thanks a lot,
g.


Paul Kienzle wrote:

>
> On Mar 29, 2006, at 2:06 AM, Gorazd Brumen wrote:
>
>> the reference to gsl was my next possibility.
>
>
> There is a GSL wrapper available in octave-forge.
>
> - Paul
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
>
>

--
Gorazd Brumen
Mail: [hidden email]
WWW: http://valjhun.fmf.uni-lj.si/~brumen
PGP: Key at http://pgp.mit.edu, ID BCC93240



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: octave and gsl

Paul Kienzle
octave-forge/main/gsl provides a wrapper for much of the GSL.

In particular, buildgsl_sf.sh defines a wrapper for gsl_sf_bessel_Jnu
using the octave name bessel_Jnu.

- Paul

On Mar 29, 2006, at 8:08 AM, Gorazd Brumen wrote:

> hi paul,
>
> sorry, dont quite get it what that means. can you direct me to the
> web location?
> could not find anything similar on o-f.
>
>
> thanks a lot,
> g.
>
>
> Paul Kienzle wrote:
>>
>> On Mar 29, 2006, at 2:06 AM, Gorazd Brumen wrote:
>>
>>> the reference to gsl was my next possibility.
>>
>>
>> There is a GSL wrapper available in octave-forge.
>>
>> - Paul
>>
>>
>>
>> -------------------------------------------------------------
>> Octave is freely available under the terms of the GNU GPL.
>>
>> Octave's home on the web:  http://www.octave.org
>> How to fund new projects:  http://www.octave.org/funding.html
>> Subscription information:  http://www.octave.org/archive.html
>> -------------------------------------------------------------
>>
>>
>
> --
> Gorazd Brumen
> Mail: [hidden email]
> WWW: http://valjhun.fmf.uni-lj.si/~brumen
> PGP: Key at http://pgp.mit.edu, ID BCC93240
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
>



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: octave and gsl

James R. Phillips-2
--- Paul Kienzle wrote:

> octave-forge/main/gsl provides a wrapper for much of the GSL.
>
> In particular, buildgsl_sf.sh defines a wrapper for gsl_sf_bessel_Jnu
> using the octave name bessel_Jnu.
>
> - Paul
>
> On Mar 29, 2006, at 8:08 AM, Gorazd Brumen wrote:
>
> > hi paul,
> >
> > sorry, dont quite get it what that means. can you direct me to the
> > web location?
> > could not find anything similar on o-f.
> >
> >
> > thanks a lot,
> > g.
> >
> >
> > Paul Kienzle wrote:
> >>
> >> On Mar 29, 2006, at 2:06 AM, Gorazd Brumen wrote:
> >>
> >>> the reference to gsl was my next possibility.
> >>
> >>
> >> There is a GSL wrapper available in octave-forge.
> >>
> >> - Paul
> >>
> >>
> >
> > --
> > Gorazd Brumen
> > Mail: []
> > WWW: http://valjhun.fmf.uni-lj.si/~brumen
> > PGP: Key at http://pgp.mit.edu, ID BCC93240
> >
> >

The octave-forge gsl support should configure itself and install if you have
gsl installed prior to configuring octave-forge.  Basically, install octave,
install gsl, then configure/build/install octave-forge.  Works for me.

Jim Phillips



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------