Thread Subject: BLAS and LAPACK lib locations

Subject: BLAS and LAPACK lib locations

From: James Tursa

Date: 2 Oct, 2009 07:54:02

Message: 1 of 9

On a PC the BLAS and LAPACK libraries are located in directories as follows:

For Microsoft Visual C, 32-bit:
C:\Program Files\MATLAB\R2007a\extern\lib\win32\microsoft\

For lcc compiler, 32-bit:
C:\Program Files\MATLAB\R2007a\extern\lib\win32\lcc\

The file names are libmwblas.lib and libmwlapack.lib.

I am trying to write a self-building mex routine that will automatically link up with the appropriate BLAS library. For Windows I can easily do this because I know what the directories are (e.g. above). Can someone out there with a Linux box look and see where these files are located? I am interested in both 32-bit and 64-bit computers. That way I can put the info in my self-building routine so that it will work for these machines. I don't have access to a Linux box or I would do it myself. Thanks.

James Tursa

Subject: BLAS and LAPACK lib locations

From: Sebastiaan

Date: 2 Oct, 2009 09:06:03

Message: 2 of 9

64 bit: $MATLABROOT/bin/glnxa64/
32 bit: $MATLABROOT/bin/glnx86/

Library names are libmwblas.so and libmwlapack.so.

The $MATLABROOT can differ between systems. I like to install it to /opt/matlab/2009b/ for 2009b version, but Matlab defaults to /usr/local/matlab I believe. So you probably have to ask the user for the Matlab path to use (or just try different locations first).

Now some curiosity from my side: what are the differences between libraries in extern\lib\win32\microsoft, extern\lib\win32\lcc and bin\win32 ? Looks a bit chaotic to me...

Sebastiaan


"James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <ha4biq$mef$1@fred.mathworks.com>...
> On a PC the BLAS and LAPACK libraries are located in directories as follows:
>
> For Microsoft Visual C, 32-bit:
> C:\Program Files\MATLAB\R2007a\extern\lib\win32\microsoft\
>
> For lcc compiler, 32-bit:
> C:\Program Files\MATLAB\R2007a\extern\lib\win32\lcc\
>
> The file names are libmwblas.lib and libmwlapack.lib.
>
> I am trying to write a self-building mex routine that will automatically link up with the appropriate BLAS library. For Windows I can easily do this because I know what the directories are (e.g. above). Can someone out there with a Linux box look and see where these files are located? I am interested in both 32-bit and 64-bit computers. That way I can put the info in my self-building routine so that it will work for these machines. I don't have access to a Linux box or I would do it myself. Thanks.
>
> James Tursa

Subject: BLAS and LAPACK lib locations

From: Tim Davis

Date: 3 Oct, 2009 21:34:01

Message: 3 of 9

"James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <ha4biq$mef$1@fred.mathworks.com>...
> On a PC the BLAS and LAPACK libraries are located in directories as follows:
>
> For Microsoft Visual C, 32-bit:
> C:\Program Files\MATLAB\R2007a\extern\lib\win32\microsoft\
>
> For lcc compiler, 32-bit:
> C:\Program Files\MATLAB\R2007a\extern\lib\win32\lcc\
>
> The file names are libmwblas.lib and libmwlapack.lib.
>
> I am trying to write a self-building mex routine that will automatically link up with the appropriate BLAS library. For Windows I can easily do this because I know what the directories are (e.g. above). Can someone out there with a Linux box look and see where these files are located? I am interested in both 32-bit and 64-bit computers. That way I can put the info in my self-building routine so that it will work for these machines. I don't have access to a Linux box or I would do it myself. Thanks.
>
> James Tursa

Take a look at umfpack_make.m and cholmod_make.m in SuiteSparse, on my web page (http://www.cise.ufl.edu/research/sparse). Those compile my sparse codes on Linux / Unix and PC's (but not the Mac; I'm tweaking it just now to do that). I have code in those m-files that connect to the BLAS and LAPACK for both Windows and Linux.

Subject: BLAS and LAPACK lib locations

From: James Tursa

Date: 5 Oct, 2009 07:32:02

Message: 4 of 9

"Sebastiaan " <s.breedveld@erasmusmc.REMOVE.BOO.BOO.nl> wrote in message <ha4fpr$jol$1@fred.mathworks.com>...
> 64 bit: $MATLABROOT/bin/glnxa64/
> 32 bit: $MATLABROOT/bin/glnx86/
>
> Library names are libmwblas.so and libmwlapack.so.
>
> The $MATLABROOT can differ between systems. I like to install it to /opt/matlab/2009b/ for 2009b version, but Matlab defaults to /usr/local/matlab I believe. So you probably have to ask the user for the Matlab path to use (or just try different locations first).
>
> Now some curiosity from my side: what are the differences between libraries in extern\lib\win32\microsoft, extern\lib\win32\lcc and bin\win32 ? Looks a bit chaotic to me...
>
> Sebastiaan

Thanks for the info. The differences between the microsoft and lcc versions, I *think*, are that the name mangling for the exported names is different. The lib directories contain object libraries that can be directly linked to during compilation (which is what I am trying to do), while the bin directory contains dll files that must be dynamically loaded during runtime.

James Tursa

Subject: BLAS and LAPACK lib locations

From: James Tursa

Date: 5 Oct, 2009 07:48:01

Message: 5 of 9

"Tim Davis" <davis@cise.ufl.edu> wrote in message <ha8g09$qe2$1@fred.mathworks.com>...
> "James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <ha4biq$mef$1@fred.mathworks.com>...
> > On a PC the BLAS and LAPACK libraries are located in directories as follows:
> >
> > For Microsoft Visual C, 32-bit:
> > C:\Program Files\MATLAB\R2007a\extern\lib\win32\microsoft\
> >
> > For lcc compiler, 32-bit:
> > C:\Program Files\MATLAB\R2007a\extern\lib\win32\lcc\
> >
> > The file names are libmwblas.lib and libmwlapack.lib.
> >
> > I am trying to write a self-building mex routine that will automatically link up with the appropriate BLAS library. For Windows I can easily do this because I know what the directories are (e.g. above). Can someone out there with a Linux box look and see where these files are located? I am interested in both 32-bit and 64-bit computers. That way I can put the info in my self-building routine so that it will work for these machines. I don't have access to a Linux box or I would do it myself. Thanks.
> >
> > James Tursa
>
> Take a look at umfpack_make.m and cholmod_make.m in SuiteSparse, on my web page (http://www.cise.ufl.edu/research/sparse). Those compile my sparse codes on Linux / Unix and PC's (but not the Mac; I'm tweaking it just now to do that). I have code in those m-files that connect to the BLAS and LAPACK for both Windows and Linux.

Thanks, Tim. I took a quick look and (not your fault) it doesn't look pretty. I will see if I can adapt some of the code to my purposes. At first I thought that linking to the BLAS library would be fairly straightforward, but as I get into it the task now looks anything *but* straightforward. Different libraries for lcc and microsoft ... older versions of MATLAB don't even seem to have an lcc version of the library ... I can't find any Borland specific version of the library in the Borland directory ... Same problem for the Watcom directory ... etc. etc. etc. Sooo .. I am not sure what to do there. Maybe everybody uses the microsoft versions except lcc? Looks like you have something called lcc_lib for older versions of MATLAB but I haven't determined what that is yet. An alias for the lcc\lib path snippet?

James Tursa

Subject: BLAS and LAPACK lib locations

From: Sebastien Paris

Date: 5 Oct, 2009 08:56:01

Message: 6 of 9

Hi James,

It's good idea to do a such snippet ... I'll use it.

Sebastien

"James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <hac8bh$1s7$1@fred.mathworks.com>...
> "Tim Davis" <davis@cise.ufl.edu> wrote in message <ha8g09$qe2$1@fred.mathworks.com>...
> > "James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <ha4biq$mef$1@fred.mathworks.com>...
> > > On a PC the BLAS and LAPACK libraries are located in directories as follows:
> > >
> > > For Microsoft Visual C, 32-bit:
> > > C:\Program Files\MATLAB\R2007a\extern\lib\win32\microsoft\
> > >
> > > For lcc compiler, 32-bit:
> > > C:\Program Files\MATLAB\R2007a\extern\lib\win32\lcc\
> > >
> > > The file names are libmwblas.lib and libmwlapack.lib.
> > >
> > > I am trying to write a self-building mex routine that will automatically link up with the appropriate BLAS library. For Windows I can easily do this because I know what the directories are (e.g. above). Can someone out there with a Linux box look and see where these files are located? I am interested in both 32-bit and 64-bit computers. That way I can put the info in my self-building routine so that it will work for these machines. I don't have access to a Linux box or I would do it myself. Thanks.
> > >
> > > James Tursa
> >
> > Take a look at umfpack_make.m and cholmod_make.m in SuiteSparse, on my web page (http://www.cise.ufl.edu/research/sparse). Those compile my sparse codes on Linux / Unix and PC's (but not the Mac; I'm tweaking it just now to do that). I have code in those m-files that connect to the BLAS and LAPACK for both Windows and Linux.
>
> Thanks, Tim. I took a quick look and (not your fault) it doesn't look pretty. I will see if I can adapt some of the code to my purposes. At first I thought that linking to the BLAS library would be fairly straightforward, but as I get into it the task now looks anything *but* straightforward. Different libraries for lcc and microsoft ... older versions of MATLAB don't even seem to have an lcc version of the library ... I can't find any Borland specific version of the library in the Borland directory ... Same problem for the Watcom directory ... etc. etc. etc. Sooo .. I am not sure what to do there. Maybe everybody uses the microsoft versions except lcc? Looks like you have something called lcc_lib for older versions of MATLAB but I haven't determined what that is yet. An alias for the lcc\lib path snippet?
>
> James Tursa

Subject: BLAS and LAPACK lib locations

From: ya

Date: 12 Nov, 2009 03:49:03

Message: 7 of 9

My matlab version is 7.4. For my reseaceh work, I need the files libmwblas.lib and libmwlapack.lib. However, I can not find these two files in the directory:C:\Program Files\MATLAB\R2007a\extern\lib\win32\lcc\. Absolutely, there is only one file:libmwlapack.lib. Can you help me with this proble? Thank you very much!!

Subject: BLAS and LAPACK lib locations

From: Jan Simon

Date: 12 Nov, 2009 09:14:02

Message: 8 of 9

Dear ya!

> My matlab version is 7.4. For my reseaceh work, I need the files libmwblas.lib and libmwlapack.lib. However, I can not find these two files in the directory:C:\Program Files\MATLAB\R2007a\extern\lib\win32\lcc\. Absolutely, there is only one file:libmwlapack.lib. Can you help me with this proble? Thank you very much!!

If I remember correctly, for older Matlab versions the BLAS was contained in the libmwlapack.lib. For compiling C-mex files, I have to add this lib only in Matlab 6.5, but libmxlapack and libmxblas for Matlab 7.7.
Please try this.

Good luck, Jan

Subject: BLAS and LAPACK lib locations

From: Steven Lord

Date: 12 Nov, 2009 15:04:13

Message: 9 of 9


"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message
news:hdgjkq$7rt$1@fred.mathworks.com...
> Dear ya!
>
>> My matlab version is 7.4. For my reseaceh work, I need the files
>> libmwblas.lib and libmwlapack.lib. However, I can not find these two
>> files in the directory:C:\Program
>> Files\MATLAB\R2007a\extern\lib\win32\lcc\. Absolutely, there is only one
>> file:libmwlapack.lib. Can you help me with this proble? Thank you very
>> much!!
>
> If I remember correctly, for older Matlab versions the BLAS was contained
> in the libmwlapack.lib. For compiling C-mex files, I have to add this lib
> only in Matlab 6.5, but libmxlapack and libmxblas for Matlab 7.7.
> Please try this.
>
> Good luck, Jan

Jan, you remember correctly. The libmwlapack.lib library was divided into
two libraries, libmwlapack.lib and libmwblas.lib, in MATLAB 7.5 (release
R2007b) as documented in the Release Notes for that release:

http://www.mathworks.com/access/helpdesk/help/techdoc/rn/bq9yg49-1.html

For previous releases, only libmwlapack.lib is present.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us at files@mathworks.com