help-octave
[Top][All Lists]
Advanced

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

Re: Error while running octave from C++


From: Philip Nienhuis
Subject: Re: Error while running octave from C++
Date: Fri, 16 May 2014 11:42:36 -0700 (PDT)

soestra wrote
> Hi,
> 
> I got a rather strange problem while trying to run an octave (3.6.2)
> function from a C++ program.
> The C++ program loads plugins on runtime as shared objects (*.so). From
> one of those plugins I call an octave function via
> 
> out = feval (function, input, 1);
> 
> which requires the intialization of octave earlier:
> 
> string_vector argv (2);
> argv(0) = "embedded";
> argv(1) = "-q";
> octave_main (2, argv.c_str_vec (), 1);
> 
> However, while running the program I get the following error:
> 
> invalid argument: d1mach(-2305825417027649535)
> fatal: lo_ieee_init: floating point format is not IEEE!  Maybe DLAMCH is
> miscompiled, or you are using some strange system without IEEE floating
> point math?
> 
> I've been searching for a while now and it seems that people had a similar
> problem with installing octave in an older version, but I couldn't find
> any solution to my problem yet.
> It seems to be connected to the fact that I load it at runtime as shared
> object, because a standalone version of the program (created with
> mkoctfile) works fine. Does somebody know how to make it run as a shared
> object?

You're running quite an old version of Octave. Time for an upgrade?

Anyway the error you get looks like the ones I got due to a miscompiled
lapack, caused by too aggressive compiler optimization (only for 2 modules).
Actually it could be a fault of your distro (like it was for mine at the
time).

>From the top of my head (it must be > 2-3 years ago):
You'd need to rebuild dlamch (and slamch) w/o any (or maybe just light)
optimization. IIRC I just d/led lapack, built the entire lib (with all
default optimization options), and then recompiled dlamch and slamch
individually w/o optimization. Then I swapped it into the newly built static
lib using ar. There's a trick to morph the static lib into a dynamic one
that I forgot but google will help you there. Next then is replacing the
system-supplied lapack with the one you just built.

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Error-while-running-octave-from-C-tp4664113p4664115.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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