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 »

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: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Compiling SMILE in Matlab

Post by shooltz[BayesFusion] »

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: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Compiling SMILE in Matlab

Post by shooltz[BayesFusion] »

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