.oct files - keeping state across calls

Christophe Tournery christophe.tournery at illusonic.com
Tue Jul 14 03:45:36 CDT 2009


On Jul 13, 2009, at 11:41 PM, John W. Eaton wrote:

> On 13-Jul-2009, Christophe Tournery wrote:
>
> | Attached is an example .cpp file that can be compile with mkoctfile,
> | demonstrating the issue. I have included a simple makefile to  
> compile
> | it and create the necessary symlinks.
> |
> | The code tries to store handles to a library in a map. The key to  
> the
> | map is passed back to octave such that the "user" can choose on  
> which
> | instance of the library a function is called.
> |
> | Thanks for testing and I am curious to know if you guys think it  
> is a
> | bug in 3.2 or if it was "un-intentionally" working in 3.0.
> | Christophe Tournery
> |
> |
> | Testing in Octave 3.0.5:
> | ------------------------
> |
> | octave:1> h1 = mylib_init()
> | h1 = 0
> | octave:2> h2 = mylib_init()
> | h2 =  1
> | octave:3> mylib_destroy(h1)
> | octave:4> mylib_destroy(h2)
> |
> |
> | Testing in octave 3.2.0:
> | ------------------------
> |
> | octave:1> h1 = mylib_init()
> | h1 = 0
> | octave:2> h2 = mylib_init()
> | h2 =  1
> | octave:3> mylib_destroy(h1)
> | error: mylib_destroy: handle '0' does not exist!
> | octave:3> mylib_destroy(h2)
> | error: mylib_destroy: handle '1' does not exist!
>
> I can't duplicate this problem with Octave 3.2.0 on my system.
>
> jwe

Could it be an issue with my build from MacPorts then? (Mac OS X  
10.5.7, macports 1.710)
I see that the Portfile configures octave with:

configure.args      --enable-shared \
                     --enable-dl \
                     --disable-static \
                     --with-hdf5 \
                     --with-fftw \
                     --with-blas="-framework Accelerate" \
                     --enable-static \
                     --enable-readline \
                     --with-zlib \
                     --with-glpk \
                     --with-curl \
                     --with-lapack \
                     --with-umfpack \
                     --with-colamd \
                     --with-ccolamd \
                     --with-cholmod \
                     --with-cxsparse

Christophe


More information about the Help-octave mailing list