[Answering to my own posting once again]

> I started with the following minimal code executed from a Rhino plugin:
> ...
>   cl_boot(argc, argv);
>   cl_shutdown();
> ...
> But when loading the plugin I get the following error message:
> ...
>   Something has changed the FPU control settings.

In file 'ecl/src/gc-unstable/mach_dep.c' the FPU control word is changed with 'fldcw'.  
> But this seems to apply only in the case of Linux.  I have the problem with Windows...  
> I could not find any other place where the FPU control settings are changed.  

> Am I missing something?

Yes, I am:  ECL relies on the underlying operating system > The operating system is Windows > And here is the problem :)

The debugger indicates the dynamic load library mfc100ud.dll as the origin of the problem...

I also found a solution:

Rhino provides the macros ON_FPU_BeforeSloppyCall() and ON_FPU_AfterSloppyCall() for similar cases and wrapping the call to cl_boot(argc, argv) allows to get rid of the error message:

  ON_FPU_BeforeSloppyCall();
  cl_boot(argc, argv);
  ON_FPU_AfterSloppyCall();

I only dislike to qualify cl_boot() as "sloppy" rather than the underlying operating system.  But a comment will help :)

Here, for the case somebody else encounters a similar problem, the relevant page in the Rhino C++ SDK Knowledge Base:

  - FPU Issues
    http://wiki.mcneel.com/developer/sdksamples/fpusloppycall

By the way, is there some alternative to cl_boot(argc, argv) which allows to initialise ECL without providing argc and argv?

Sorry for the inconvenience,

Dietrich




On Fri, Apr 19, 2013 at 1:27 AM, Dietrich Bollmann <dietrich@formgames.org> wrote:
Hi again,


> I get the following error message:
> ...

>   Something has changed the FPU control settings.
> ...

> Any idea how I can avoid this?

In file 'ecl/src/gc-unstable/mach_dep.c' the FPU control word is changed with 'fldcw'.  But this seems to apply only in the case of Linux.  I have the problem with Windows...  I could not find any other place where the FPU control settings are changed.  Am I missing something?

Thanks,

Dietrich




On Thu, Apr 18, 2013 at 8:43 PM, Dietrich Bollmann <dietrich@formgames.org> wrote:
>
> Hi,
>
> I would like to integrate ECL into the 3D modelling software
> "Rhinoceros" (http://en.wikipedia.org/wiki/Rhino3D).
>
> I started with the following minimal code executed from a Rhino plugin:
>
>   char *argv[] = {"Rhinoceros", NULL};
>   int argc = sizeof(argv) / sizeof(char*) - 1;
>   cl_boot(argc, argv);
>   cl_shutdown();
>
> But when loading the plugin I get the following error message:
>
>   Rhinoceros 5.0 RHINO ERROR
>   File name: rhino3MathErrorHandling.cpp
>   Line number: 256
>   Function name: RhMathErrorCheck
>   Something has changed the FPU control settings.
>   See debugger output window for details.
>
> Any idea how I can avoid this?
>
> Thanks,
>
> Dietrich
>