Compiling SMILE in Matlab

The engine.
Post Reply
lib
Posts: 1
Joined: Thu Feb 22, 2018 3:01 pm

Compiling SMILE in Matlab

Post by lib » Thu Feb 22, 2018 3:11 pm

Hello,

I am using SMILE in a Matlab/Simulink model, which uses a so called
S-Function. When I compile the model, the error "SMILE INITERR 00" appears
recursively on the console, the program never finishes compiling and Matlab
crashes. I am using Matlab 2016a under Ubuntu 16.04.

Thanks.

shooltz[BayesFusion]
Site Admin
Posts: 1241
Joined: Mon Nov 26, 2007 5:51 pm

Re: Compiling SMILE in Matlab

Post by shooltz[BayesFusion] » Thu Feb 22, 2018 3:16 pm

SMILE relies on its private global C++ object to perform license initialization. The error you're getting (SMILE INITERR 00) indicates that the constructors of global objects in SMILE were not invoked on startup. It's probably caused by the compiler settings used to build the executable with your S-function.

shooltz[BayesFusion]
Site Admin
Posts: 1241
Joined: Mon Nov 26, 2007 5:51 pm

Re: Compiling SMILE in Matlab

Post by shooltz[BayesFusion] » Fri Apr 13, 2018 11:53 am

We have just received another report about SMILE INITERR 00. The problem was caused by a global DSL_network object, the constructor of which ran before licensing key was initialized. If you have global DSL_network in your program and want to keep it, please replace this:

Code: Select all

DSL_network n;

void someFunc1() { 
    // use n here
}
void someFunc2() { 
    // use n here
}
with this

Code: Select all

DSL_network& GeNetwork() {
    static DSL_network n;
    return n;
}

void someFunc1() { 
    // use GetNetwork here
}
void someFunc2() { 
    // use GetNetwork here
}
This ensures that DSL_network's constructor runs after the initialization of your SMILE licensing key.

Post Reply