help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: liboctave crash


From: Juan Pablo Carbajal
Subject: Re: liboctave crash
Date: Fri, 27 Jul 2012 18:53:42 +0200

On Fri, Jul 27, 2012 at 6:39 PM, Juan Pablo Carbajal
<address@hidden> wrote:
> On Fri, Jul 27, 2012 at 4:19 PM, bob <address@hidden> wrote:
>>
>> On Jul 27, 2012 7:35 PM, "Andy Buckle" <address@hidden> wrote:
>>>
>>>
>>>
>>> On 27 July 2012 14:58, Juan Pablo Carbajal <address@hidden> wrote:
>>>>
>>>> On Fri, Jul 27, 2012 at 1:38 PM, bob <address@hidden> wrote:
>>>> > Hi,
>>>> >
>>>> > I am trying to run this small code:
>>>> >
>>>> > #include <iostream>
>>>> > #include <octave/oct.h>
>>>> >
>>>> > using namespace std;
>>>> >
>>>> > int main()  {
>>>> >     ComplexMatrix A = ComplexMatrix(2,2);
>>>> >     return 0;
>>>> > }
>>>> >
>>>> > Using octave-3.6.2 (MinGW), I am able to build the file. But when I run
>>>> > it,
>>>> > I get a seg-fault:
>>>> >
>>>> > Program received signal SIGSEGV, Segmentation fault.
>>>> > In libstdc++-6!_ZNKSs7_M_dataEv () (C:\MinGW\bin\libstdc++-6.dll)
>>>> >
>>>> > Even using:
>>>> >
>>>> > mkoctfile --link-stand-alone <file>
>>>> >
>>>> > I get the same crash.
>>>> >
>>>> > System: WinXP SP2 (32bit), Core 2 Duo
>>>> >
>>>> > Any help ?
>>>> > --
>>>> > bob
>>>> >
>>>> > _______________________________________________
>>>> > Help-octave mailing list
>>>> > address@hidden
>>>> > https://mailman.cae.wisc.edu/listinfo/help-octave
>>>> >
>>>>
>>>> You have tu use the dynamically loaded function macro. This is an
>>>> example form the manual
>>>>
>>>> http://www.gnu.org/software/octave/doc/interpreter/Getting-Started-with-Oct_002dFiles.html
>>>>
>>>> #include <octave/oct.h>
>>>>
>>>>      DEFUN_DLD (helloworld, args, nargout,
>>>>        "Hello World Help String")
>>>>      {
>>>>        int nargin = args.length ();
>>>>        octave_stdout << "Hello World has " << nargin
>>>>              << " input arguments and "
>>>>              << nargout << " output arguments.\n";
>>>>        return octave_value_list ();
>>>>      }
>>>>
>>>>
>>>>
>>>> --
>>>> M. Sc. Juan Pablo Carbajal
>>>
>>>
>>> If an oct-file function is required, then you have to use the macro. It
>>> looks like bob is trying to create something to be called from outside
>>> Octave.
>>
>> Exactly. I am trying to create:
>>
>> 1. A standalone executable using octave functions.
>> 2. A DLL binary also using octave functions.
>>
>>>
>>> --
>>> /* andy buckle */
>
> Tried in Ubuntu 12.04 64bits
>
> $ mkoctfile --link-stand-alone -pthread  -L<path to liboctave> func.cc
> $ ./a.out
> ./a.out: error while loading shared libraries: liboctave.so.1: cannot
> open shared object file: No such file or directory
>
> Any clues why it doesn't run or how to fix it?
>
>
>
> --
> M. Sc. Juan Pablo Carbajal
> -----
> PhD Student
> University of Zürich
> http://ailab.ifi.uzh.ch/carbajal/

Thanks to: jwe.

In Ubuntu, definig the variable

export LD_LIBRARY_PATH=<path-to-liboctave.so.1>

Solves the problem and. Compiling with

mkoctfile --link-stand-alone -pthread func.cc

works perfectly and the program runs.

You crash may be windows related.



-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]