Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem including svd, norm or qr in a win32 dll

45 views
Skip to first unread message

Tom Hall

unread,
Nov 1, 2008, 9:59:02 PM11/1/08
to
I have recently installed R2008b with the Matlab compiler. When creating win32 .dlls using mcc -B csharedlib:<dllname> <M-file>, everything works fine except that any call within an M-file to svd, qr, or norm (possibly any matfun?) does not work correctly from the .dll. Whenever a call to svd, qr or norm is encountered in the dll file, a dialog appears entitled "mllapack.dll" with the message "The specified procedure could not be found.".

Other standard built-in functions (e.g. abs, sqrt, strcmp,find, etc.) appear to work fine, and full libraries are OK as long as they don't use matfun functions (as far as I can tell so far). However, even a two-line function with no input or output like the one below fails when compiled into a .dll and accessed by an external program.

function test1()
input=[4 5 6; 6 7 8; 10 2 5];
test_out=svd(input);
return;

I'm just wondering if anyone else has run across this, and if so, if there's a solution? It could be a configuration on my computer, but I can't figure it out. I can't find any specific information in the documentation.

Thanks for any help / advice.

-Tom

Tom

unread,
Apr 17, 2010, 8:00:22 PM4/17/10
to
I just ran into the exact same problem. Were you able to solve this matter?

My code runs fine in Matlab but the compiled program crashes on that mllapack.dll message.

Quite frustrating...

Thanks,

Tom

Bruno Luong

unread,
Apr 18, 2010, 2:58:08 AM4/18/10
to
"Tom " <t_va...@yahoo.com> wrote in message <hqdi2m$rbo$1...@fred.mathworks.com>...

> I just ran into the exact same problem. Were you able to solve this matter?
>
> My code runs fine in Matlab but the compiled program crashes on that mllapack.dll message.
>

I have encountered very similar problem under 2006B window (we still use this old version for our commercial product).

In my case:
- The issue seems to appear only at the very first call to a ML built_in matrix function
- nothing crashes as long as the result will not be used by the program

Based on that, I make a nasty workaround:
- After initialization of my application, call a dummy DLL compiled function that in turn call ML QR, for example.
- Then call my other DLLs as normal

So far it works, but the "solution" is unsatisfied. I agree it's a pain.

Bruno

Tom

unread,
Apr 18, 2010, 11:35:05 AM4/18/10
to
Thanks for the tip.
But when I include a dummy function, as below, I get the "crash"and "mllapack.dll" message when the main program calls this function in the compiled program.

>function DummyFunction()


> input=[4 5 6; 6 7 8; 10 2 5];
> test_out=svd(input);
>return;

Even when I compile this simple function as stand alone, it crashes too.

When I use the dependency walker, I see that it finds and loads the mllapack.dll but that it calls an unknown function...

Any other ideas or tips are welcome.

Tom

unread,
Apr 20, 2010, 1:11:06 PM4/20/10
to
I found that the error comes from a dll version problem (as suspected)

an older "libmmd.dll" was present in windows/system32 directory.

the version that comes with the Matalb Runtime bin/win32 directory was not used.

Getting rid of the older version solved the problem.

I haven't figured out yet why it was there and why it doesn't get updated in the windows directory when installing the vcredist.

What a pain.

0 new messages