Page 7 of 8

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Tue Jul 20, 2010 2:22 pm
by ChemPhys
I'm trying to build and install CLAPACK in MS Visual Studio 2010 using the CMAKE 2.8 by following the instructions given on the CLAPACK for Windows site. My build in CMAKE seems to run normally; however, when I try to install CLAPACK and go to its target directory, I just get the ALL_BUILD project file without the INSTALL file being in the directory and my RUN_TESTS project's name isn't in bold. I can run the ALL_BUILD file, but VS skips 6 files. Has this problem arisen before? MS seems to have really moved a lot of things around in VS 2010.

Thanks.

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Tue Jul 20, 2010 6:28 pm
by alekmmm
can someone explain a bit in further details in a how-to thread ??? thanks

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Fri Jul 23, 2010 2:23 pm
by graphicsRat
alekmmm wrote:can someone explain a bit in further details in a how-to thread ??? thanks


What exactly would you like to know?

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Tue Aug 10, 2010 4:52 am
by robertsmith632
Maybe I can try and retry until something works, but I am really short
on time, so if I could find directions or a no-src-but-many-docs
package, that would be great.

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Sat Aug 14, 2010 3:40 am
by graphicsRat
robertsmith632 wrote:Maybe I can try and retry until something works, but I am really short on time, so if I could find directions or a no-src-but-many-docs package, that would be great.

I am sorry but I have absolutely no idea of what you mean. What is a "no-src-but-many-docs package"?

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Wed Sep 29, 2010 6:28 pm
by dennisbk
Are there any instructions for building clapack as a DLL?

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Sun Oct 24, 2010 1:50 am
by psstions
Hello everybody,

I m a beginner in Lapack and I m actually trying to install GoToBlas on a visual studio environment. I followed all the steps you mentioned: I have installed Cygwin, and I launched the command make and I have my lib.a in my folder.
Unfortunately, I don t succeed in making the dll from the Visual Studio Prompt (when I use the command "make dll" in the folder exports)

Do you have any idea of the problem?

Thanks very much.
Psstion

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Wed Dec 08, 2010 6:34 pm
by AnthonyD
graphicsRat wrote:
Josselin wrote:My dll is compiled with msys.
I do a dll with my visual studio project.

Do you mean to say that you're creating a dll project in Visual Studio? (Note that compiling the GotoBLAS2 dll in MSYS is a different issue and must not be confused.)

If you are creating a dll project in Visual Studio, you may want to first try a writing small console application in order to test your GotoBLAS2 build.

Try the sample program here http://www.cs.rochester.edu/~bh/cs400/using_lapack.html

If you've (saved your file as *.cpp and are) compiling with C++, rename the prototypes
void dgesv_( )
void dgels_( )

in the above program to
extern "C" void dgesv_( )
extern "C" void dgels_( )

and don't forget to use the "Multithreaded-Debug (/MTd)" runtime library.

Josselin wrote:I use /MTd or MT but it doesn t work.

What exactly do you mean? What errors are you getting?

If you are creating a dll in visual studio, use the Multi-threaded Debug DLL (/MDd) runtime library.

I've got two visual studio projects in my solution file, both using LAPACK. The first one is a console application and therefore uses the "Multithreaded-Debug (/MTd)" runtime library while the second is dll (AutoDesk Maya Plugin) and therefore uses the Multi-threaded Debug DLL (/MDd) runtime library. Why? because dlls and console applications (debug or release) cannot link against the same version of the C or C++ runtime library.
See: http://www.davidlenihan.com/2008/01/choosing_the_correct_cc_runtim.html

Thank you for explanation

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Mon Mar 14, 2011 7:53 pm
by kristrdobbs
I'm with Anthony D. Thanks for the explanation graphicsRat. You are the man (or woman) hehe

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Sun Mar 27, 2011 1:46 pm
by pitoxu
Hello!

I have tried to compile LAPACK as DLL in Windows using the following procedure:
* Download most current version of LAPACK from Netlib and extract the sources
* Download almost all of the Mingw tools and extract the tools
* Copy dlamch.f and slamch.f from INSTALL directory SRC directory
*
Set path to have mingw binaries
o set PATH=c:\mingw\bin\;%PATH%
* Go to root directory of the extracted folder and compile using g77
*
First compile BLAS. –shared option is needed in order to functions to be exposed from the dll. -O generates optimised code. -o filename is the output file
o g77 –shared -o blas.dll BLAS\SRC\*.f –O
*
Compile LAPACK with BLAS dependency
o g77 –shared -o lapack.dll src\*.f blas.dll -O

and got this error:

“g77: installation problem, cannot exec `C:\MinGW\bin\\..\libexec\gcc\mingw32\3.4
.5\collect2.exe’: Invalid argument”

Anyone has and ideea?

Thank you!
John, tastatura laptop

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Tue Mar 29, 2011 4:43 am
by admin
-O is a O (letter O) or a 0 (zero) ?
It should be a -O0 (letter then zero) I guess...(level of optimization at zero)
just remove it, to see if it works.
julie

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Thu Apr 07, 2011 6:13 pm
by jmlopez
graphicsRat wrote:
flexo1234 wrote:But now if I compare the time it takes to do a matrix-vector multiplication with this optimized BLAS library and with Matlab, Matlab is still a bit faster. Is this normal? Did anyone else compare the speed between these?


Did you use the BLAS subroutines SGEMV and DGEMV (GotoBLAS implements both). They should outperform Matlab by many orders of magnitude. I would be very surprised if they didn't.


Sorry for getting into this thread, I don't even use a windows machine.

What caught my eye was that the routines sgemv and dgemv are faster than the matrix vector multiplication of matlab. Is that so?

Today a friend of mine was running some matlab code which was using 7 cores in a 12 core machine. I was wondering why matlab would be running in parallel and then it hit me. The matrix multiplication and other routines must be done in parallel.

In any case, I'm writing my friends code in C in order to avoid the many loops that the program has. Since I'm using the LAPACK library I guess it would be useful to know if the routines dgemm would actually outperform matlab. I haven't had much time to test this, but I guess what I want to know is:

Do the routines dgemv and dgemm run in parallel? If they are not, how different is it running the BLAS routine to coding my own loops in C to make the multiplication?

If I want to do A1 = B1*C1; A2 = B2*C2; A3 = B3*C3; ... ; AN = BN*CN given that all the matrices are n^n then I would It would be more efficient to take advantage of loop jamming as in the pseudo-code below:

Code: Select all
for i=1:n
    for j=1:n
        A1(i, j) = 0;
        A2(i, j) = 0;
         ...
        AN(i,j) = 0;
       for k=1:n
           A1(i, j)  =  A1(i, j)  + B1(i,k)*C1(k,i);
           A2(i, j)  =  A2(i, j)  + B2(i,k)*C2(k,i);
           ...
          AN(i, j)  =  AN(i, j)  + BN(i,k)*CN(k,i);
       end
    end
end


Now, if I were to code this using say pthreads then I could divide this matrix into sections so that each thread could take care the computation of a single entry. All I'm wondering is if the BLAS routine will be better than the one I wrote above. Forgive my pseudo-code, I may have made a mistake somewhere but I hope that you guys can get the idea. Anyway, does anyone think I should code my own matrix multiplication with pthreads in C in order to take advantage of a computer with multiple cores and the loop jamming as in the sample code above? Thanks

-Manuel

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Fri Apr 08, 2011 12:15 am
by Julien Langou
Do the routines dgemv and dgemm run in parallel? If they are not, how different is it running the BLAS routine to coding my own loops in C to make the multiplication?


The subroutines DGEMV and DGEMM present in the netlib lapack library are there mostly for completeness of the package and for reference for other implementations. (In particular the test suite is useful.) They are not parallel and are not meant to be much efficient.

When you use LAPACK and want performance, you need to use optimized BLAS libraries: http://www.netlib.org/lapack/faq.html#_are_optimized_blas_libraries_available_where_can_i_find_optimized_blas_libraries

1) Most of these libraries are multithreaded and run very fast in parallel with great speedup.You often needs to specify some environment variables to get the subroutine to run in parallel. (OMP_NUM_THREADS, VECLIB_MAXIMUM_THREADS, etc.)

2) Even with one thread, these libraries are way faster than the reference BLAS ones (the ones provided within LAPACK).

You would see great speedup with DGEMM.
DGEMV is somewhat harder to get efficient since the operation is bandwidth limited.
(So once you have saturated the bandwidth, you cannot do much.)

Julien

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Tue Nov 08, 2011 9:27 am
by goodtimes
thank you

Re: HOWTO LAPACK/CLAPACK for Windows

PostPosted: Sat May 05, 2012 4:45 am
by alexoneal10
Could anybody guide me, how do I build clapack as a DLL?