SMILE in Matlab

The engine.
Post Reply
frito
Posts: 32
Joined: Wed Dec 12, 2007 8:51 pm

SMILE in Matlab

Post by frito »

I have problems importing SMILE into Matlab.

Matlab gives the opportunity to import java classes or DLLs into Matlab but I failed in my attempts, I tried win and solaris, java and c source and binaries no luck.

Did anyone have luck with that?

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

Re: SMILE in Matlab

Post by shooltz[BayesFusion] »

frito wrote:Matlab gives the opportunity to import java classes or DLLs into Matlab but I failed in my attempts
The DLLs that Matlab can import must contain C-style functions to avoid name mangling. Can you post the .h file with prototypes of functions exported from your .DLL?
frito
Posts: 32
Joined: Wed Dec 12, 2007 8:51 pm

Re: SMILE in Matlab

Post by frito »

shooltz wrote:
frito wrote:Matlab gives the opportunity to import java classes or DLLs into Matlab but I failed in my attempts
The DLLs that Matlab can import must contain C-style functions to avoid name mangling. Can you post the .h file with prototypes of functions exported from your .DLL?

It's not my DLL's I tried to hook the whole SMILE framework to matlab using the provided header files...
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE in Matlab

Post by shooltz[BayesFusion] »

SMILE (the core C++ library) is distributed as static lib. Matlab needs the dynamic library, and the only DLLs we provide are smilenet.dll - the .NET wrapper and jsmile.dll - the native part of Java wrapper. Both of these DLLs are not compatible with Matlab.

What you need is your own .dll linked statically with smile library exposing the required functionality, as described here:
http://www.mathworks.com/access/helpdes ... 4dfi7.html
frito
Posts: 32
Joined: Wed Dec 12, 2007 8:51 pm

Re: SMILE in Matlab

Post by frito »

shooltz wrote:SMILE (the core C++ library) is distributed as static lib. Matlab needs the dynamic library, and the only DLLs we provide are smilenet.dll - the .NET wrapper and jsmile.dll - the native part of Java wrapper. Both of these DLLs are not compatible with Matlab.

What you need is your own .dll linked statically with smile library exposing the required functionality, as described here:
http://www.mathworks.com/access/helpdes ... 4dfi7.html

thx for the clarification.

I wanted to avoid C coding because I am much better at Matlab and dont have much time for development.

I dont know how libraries work in C++, is it possible for u to release DLLs that could be called from Matlab?

And what about your java classes I tried to load them to Matlab but with no luck either?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE in Matlab

Post by shooltz[BayesFusion] »

frito wrote:I dont know how libraries work in C++, is it possible for u to release DLLs that could be called from Matlab?
That's highly unlikely. Basically, we'd have to flatten the entire class hierarchy to expose SMILE functionality as C functions.

"How libraries work in C++" is pretty simple. To create your Matlab/SMILE interface you'd have to design a set of C functions exposing high-level functionality specific to your project, then implement them with SMILE calls. The entire package would be single native DLL linked statically with SMILE.

And what about your java classes I tried to load them to Matlab but with no luck either?
Hard to tell. Did you ensure that jsmile.dll was visible to JVM?
frito
Posts: 32
Joined: Wed Dec 12, 2007 8:51 pm

Re: SMILE in Matlab

Post by frito »

shooltz wrote:
frito wrote:I dont know how libraries work in C++, is it possible for u to release DLLs that could be called from Matlab?
That's highly unlikely. Basically, we'd have to flatten the entire class hierarchy to expose SMILE functionality as C functions.

"How libraries work in C++" is pretty simple. To create your Matlab/SMILE interface you'd have to design a set of C functions exposing high-level functionality specific to your project, then implement them with SMILE calls. The entire package would be single native DLL linked statically with SMILE.
:shock:
That means building kind of a custom wrapper(dunno if am using the jargon right)?
Dunno how to accomplish that thou.
shooltz wrote:
And what about your java classes I tried to load them to Matlab but with no luck either?
Hard to tell. Did you ensure that jsmile.dll was visible to JVM?
How do I check that?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE in Matlab

Post by shooltz[BayesFusion] »

That means building kind of a custom wrapper(dunno if am using the jargon right)?
Yes, the custom wrapper sounds right.
Dunno how to accomplish that thou.
That's simple: get a C++ compiler, SMILE binaries and Matlab docs, write some code and you're done :)
shooltz wrote: Hard to tell. Did you ensure that jsmile.dll was visible to JVM?
How do I check that?
Did Matlab produce any error messages? Where did you put the jsmile.dll file?
Post Reply