Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
problem with libmwlapack.lib on r2007b

Subject: problem with libmwlapack.lib on r2007b

From: Dimitar Dimitrov

Date: 24 Jan, 2008 09:29:02

Message: 1 of 8

Hello,

I have the following problem when using mex with lcc on
Matlab r2007b (Windows XP):

I am using a function written in C and I can compile and
link it successfully on Matlab 7.1.0.246 (R14) SP 3, however
when I try the same thing on Matlab 7.5.0.342 (R2007b),
after linking with lcclnk I get an error that:
 
.text: undefined reference to '_dcopy'
.text: undefined reference to '_ddot'
.text: undefined reference to '_dtrsv'
.text: undefined reference to '_dgemv'
.text: undefined reference to '_dscal'
.text: undefined reference to '_drotg'
.text: undefined reference to '_drot'
.text: undefined reference to '_daxpy'
.text: undefined reference to '_dsymv'

My compilation options are:
mex -DOS_WIN -O myMEXfile.c file_code.c
"C:\MATLAB71\extern\lib\win32\lcc\libmwlapack.lib"

In the code I use the missing functions without the
under-bar "_" before the functions name, but strangely it
appears in the error.

And again there is no such problem with Matlab 7.1!!

Regards,
Dimitar

Subject: problem with libmwlapack.lib on r2007b

From: Dimitar Dimitrov

Date: 25 Jan, 2008 13:46:03

Message: 2 of 8

I have been trying to figure this one out yesterday (the
whole day), and I am really out of options. My best guess is
that this is a bug in the library shipped with Matlab r2007b.

Any help would be very much appreciated!

Thank you,
Dimitar



"Dimitar Dimitrov" <mail_mitko@example.com> wrote in message
<fn9lou$25l$1@fred.mathworks.com>...
> Hello,
>
> I have the following problem when using mex with lcc on
> Matlab r2007b (Windows XP):
>
> I am using a function written in C and I can compile and
> link it successfully on Matlab 7.1.0.246 (R14) SP 3, however
> when I try the same thing on Matlab 7.5.0.342 (R2007b),
> after linking with lcclnk I get an error that:
>
> .text: undefined reference to '_dcopy'
> .text: undefined reference to '_ddot'
> .text: undefined reference to '_dtrsv'
> .text: undefined reference to '_dgemv'
> .text: undefined reference to '_dscal'
> .text: undefined reference to '_drotg'
> .text: undefined reference to '_drot'
> .text: undefined reference to '_daxpy'
> .text: undefined reference to '_dsymv'
>
> My compilation options are:
> mex -DOS_WIN -O myMEXfile.c file_code.c
> "C:\MATLAB71\extern\lib\win32\lcc\libmwlapack.lib"
>
> In the code I use the missing functions without the
> under-bar "_" before the functions name, but strangely it
> appears in the error.
>
> And again there is no such problem with Matlab 7.1!!
>
> Regards,
> Dimitar
>

Subject: problem with libmwlapack.lib on r2007b

From: Michael Hosea

Date: 25 Jan, 2008 14:12:58

Message: 3 of 8

> "Dimitar Dimitrov" <mail_mitko@example.com> wrote in message
> <fn9lou$25l$1@fred.mathworks.com>...
>> My compilation options are:
>> mex -DOS_WIN -O myMEXfile.c file_code.c
>> "C:\MATLAB71\extern\lib\win32\lcc\libmwlapack.lib"

Is that the correct path to the R2007b libmwlapack.lib file on your system?
--
Mike

Subject: problem with libmwlapack.lib on r2007b

From: Dimitar Dimitrov

Date: 25 Jan, 2008 15:00:21

Message: 4 of 8

Hi Mike,
thank you for the post!

My path is correct.
In the makefile I am using:
' "' matlabroot '\extern\lib\win32\lcc\libmwlapack.lib"'

I am sorry for the path in my first post (I copied it from
the output in Matlab71).

Cheers,
Dimitar


"Michael Hosea" <mhosea@mathworks.com> wrote in message
<fncqpa$8hc$1@fred.mathworks.com>...
> > "Dimitar Dimitrov" <mail_mitko@example.com> wrote in message
> > <fn9lou$25l$1@fred.mathworks.com>...
> >> My compilation options are:
> >> mex -DOS_WIN -O myMEXfile.c file_code.c
> >> "C:\MATLAB71\extern\lib\win32\lcc\libmwlapack.lib"
>
> Is that the correct path to the R2007b libmwlapack.lib
file on your system?
> --
> Mike
>
>

Subject: problem with libmwlapack.lib on r2007b

From: Michael Hosea

Date: 25 Jan, 2008 15:32:20

Message: 5 of 8

Nothing to be sorry about, just a dead end. Actually, I should have paid
closer attention. Those are BLAS functions that aren't found. Try adding

' "' matlabroot '\extern\lib\win32\lcc\libmwblas.lib"'

--
Mike

"Dimitar Dimitrov" <mail_mitko@example.com> wrote in message
news:fncti5$ic7$1@fred.mathworks.com...
> Hi Mike,
> thank you for the post!
>
> My path is correct.
> In the makefile I am using:
> ' "' matlabroot '\extern\lib\win32\lcc\libmwlapack.lib"'
>
> I am sorry for the path in my first post (I copied it from
> the output in Matlab71).
>
> Cheers,
> Dimitar
>
>
> "Michael Hosea" <mhosea@mathworks.com> wrote in message
> <fncqpa$8hc$1@fred.mathworks.com>...
>> > "Dimitar Dimitrov" <mail_mitko@example.com> wrote in message
>> > <fn9lou$25l$1@fred.mathworks.com>...
>> >> My compilation options are:
>> >> mex -DOS_WIN -O myMEXfile.c file_code.c
>> >> "C:\MATLAB71\extern\lib\win32\lcc\libmwlapack.lib"
>>
>> Is that the correct path to the R2007b libmwlapack.lib
> file on your system?
>> --
>> Mike
>>
>>
>

Subject: problem with libmwlapack.lib on r2007b

From: Dimitar Dimitrov

Date: 25 Jan, 2008 15:53:04

Message: 6 of 8

WOW you are right (Thank you)!
I added libmwblas.lib and it compiled successfully.
Actually I don't have a library libmwblas.lib in Matlab71.
It seems that in r2007b there is some library reorganization.

However, when I tried to execute the function I get the
following error:

??? Invalid MEX-file 'C:\optim\myMEXfile.mexw32': The
specified procedure could not be found.

No need to say that I don't get this error with in Matlab71!

Any suggestions?
Dimitar


> Nothing to be sorry about, just a dead end. Actually, I
should have paid
> closer attention. Those are BLAS functions that aren't
found. Try adding
>
> ' "' matlabroot '\extern\lib\win32\lcc\libmwblas.lib"'
>

Subject: problem with libmwlapack.lib on r2007b

From: Michael Hosea

Date: 25 Jan, 2008 16:40:12

Message: 7 of 8

No suggestions from me, anyway. We're going to need some help, perhaps from
people with more experience building mex files by hand.
--
Mike

"Dimitar Dimitrov" <mail_mitko@example.com> wrote in message
news:fnd0l0$85t$1@fred.mathworks.com...
> WOW you are right (Thank you)!
> I added libmwblas.lib and it compiled successfully.
> Actually I don't have a library libmwblas.lib in Matlab71.
> It seems that in r2007b there is some library reorganization.
>
> However, when I tried to execute the function I get the
> following error:
>
> ??? Invalid MEX-file 'C:\optim\myMEXfile.mexw32': The
> specified procedure could not be found.
>
> No need to say that I don't get this error with in Matlab71!
>
> Any suggestions?
> Dimitar
>
>
>> Nothing to be sorry about, just a dead end. Actually, I
> should have paid
>> closer attention. Those are BLAS functions that aren't
> found. Try adding
>>
>> ' "' matlabroot '\extern\lib\win32\lcc\libmwblas.lib"'
>>
>

Subject: problem with libmwlapack.lib on r2007b

From: Dimitar Dimitrov

Date: 25 Jan, 2008 17:02:01

Message: 8 of 8

Well, I found a related thread:
http://www.mathworks.de/matlabcentral/newsreader/view_thread/157816

So I did what is suggested there...
And after downloading and checking with
DependencyWalker (http://dependencywalker.com/)

I found out that all the DLL files that are used from
directories in "matlabroot" start with "C:\Matlab71", and I
expect them to be "C:Matlab2007b".

This probably comes from the fact that:
1. I remover my installation of Matlab71
2. Installed Matlab2007b
3. Installed again Matlab71 (because I had this compilation
error).

So probably the settings of the mex compiler (in r2007b)
were altered by the latter installation!

Probably I can reconfigure the mex options is some way!

Regards,
Dimitar


"Michael Hosea" <mhosea@mathworks.com> wrote in message
<fnd3dc$mfv$1@fred.mathworks.com>...
> No suggestions from me, anyway. We're going to need some
help, perhaps from
> people with more experience building mex files by hand.
> --
> Mike
>
> "Dimitar Dimitrov" <mail_mitko@example.com> wrote in message
> news:fnd0l0$85t$1@fred.mathworks.com...
> > WOW you are right (Thank you)!
> > I added libmwblas.lib and it compiled successfully.
> > Actually I don't have a library libmwblas.lib in Matlab71.
> > It seems that in r2007b there is some library
reorganization.
> >
> > However, when I tried to execute the function I get the
> > following error:
> >
> > ??? Invalid MEX-file 'C:\optim\myMEXfile.mexw32': The
> > specified procedure could not be found.
> >
> > No need to say that I don't get this error with in Matlab71!
> >
> > Any suggestions?
> > Dimitar
> >
> >
> >> Nothing to be sorry about, just a dead end. Actually, I
> > should have paid
> >> closer attention. Those are BLAS functions that aren't
> > found. Try adding
> >>
> >> ' "' matlabroot '\extern\lib\win32\lcc\libmwblas.lib"'
> >>
> >
>
>

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us