BLAS & LAPACK for Windows

BLAS and LAPACK from Netlib are the de facto libraries for linear algebra. For those interested in using BLAS and LAPACK on Windows platform, I have compiled them in 32bit and 64bit libraries by Intel® Fortran Compiler XE 13.1 and Visual Studio 2010.

I use LAPACK version 3.2.1, and the original patched makefiles can be downloaded from David Svoboda’s website. The source codes of LAPACK and BLAS packages are available from Netlib.

The 32 bit BLAS and LAPACK libraries downloading:

The 64 bit BLAS and LAPACK libraries downloading:

The modified Windows makefile can be downloaded from here:

Thanks David Svoboda for the original LAPACK Windows version.

Thanks Conrad Sanderson for the "/QaxSSSE3" suggestion, and the wonderful Armadillo C++ linear algebra library!

Updated with "/QaxCORE-AVX2", thanks Huijuan Li and Sigurður Freyr Hafstein for the tip!

The 32 bit BLAS and LAPACK libraries with "/QaxCORE-AVX2" downloading:
o debug version
o release version

The 64 bit BLAS and LAPACK libraries with "/QaxCORE-AVX2" downloading:
o debug version
o release version

评论

Hello Yili,

thank you very much for your BLAS/LAPACK libraries! I use them with Armadillo and they work pretty well.

I have compared the speed to the optimized BLAS/LAPACK version of ACML from AMD. Your package is up to 40% faster than ACML, which confuses me a bit. How you reach a performance, which is a lot better than an-already-optimized library?

I thought you have just compiled the netlib, which is pretty slow, as far as I had read in the internet.

And what does the "/QaxCORE-AVX2" option mean? Does it mean, that your LAPACK/BLAS lib is using multiple Cores?

I would appreciate, if you could help me out of my confusion!

Greetings from Berlin, Germany!
Niclas
Yili Zhao说…
Hi Niclas,
I think one factor is that I use Intel Fortran Compiler to compile them, and another factor is that I use compiler option "/QaxCORE-AVX2" which can generate Intel Advanced Vector Extensions 2 (Intel® AVX2), Intel® AVX, SSE4.2, SSE4.1, SSSE3, SSE3, SSE2, and SSE instructions for Intel® processors.
You may reference it here: http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/fortran/lin/copts/common_content/options_ref_new_opts.htm
Hello Yili,

I'am having some problems using the precompiled libraries in dev c++ (windows 7). I have given the libraries to my compiler (projects options > parameters > linker > add library or object) and also placed the .lib files in C:/Program Files (x86)/Dev-Cpp/MinGW64/lib and the .dll files in C:/Program Files (x86)/Dev-Cpp/MinGW64/bin. Yet when I compile c++ stops working/crashes when it has to calculate a determinant, inverse or diagonalise a matrix. After debugging I get the following backtrace:

dsyevd_()
arma::lapack::syevd(jobz = 0x22f95f "VÐü\"", uplo = 0x22f95e "UVÐü\"", n = 0x22f958, a = 0x6e4a40, lda = 0x22f958, w = 0x22fc50, work = 0x6e4b40, lwork = 0x22f954, iwork = 0x6e5080, liwork = 0x22f950, info = 0x22f94c) C:/Libraries cpp/include/include/armadillo_bits/lapack_wrapper.hpp 161
arma::auxlib::eig_sym_dc >(eigval = ..., eigvec = ..., X = ...) C:/Libraries cpp/include/include/armadillo_bits/auxlib_meat.hpp 1274
arma::eig_sym >(eigval = ..., eigvec = ..., X = ..., method = 0x49405c "dc", junk = 0x0) C:/Libraries cpp/include/include/armadillo_bits/fn_eig_sym.hpp 103
main() test diagonalization.cpp 16

The code I used is from the documentation of armadillo:

#include
#include
#include
#include
using namespace std;
using namespace arma;


int main(){
mat A = randu(5,5);
mat B = A.t()*A; // generate a symmetric matrix
B.print("B:");
vec eigval;
mat eigvec;
cout << 42;
eig_sym(eigval, eigvec, B);
}

It seems that I still have some linking errors using the precompiled libraries. But since I am inexperienced with these I have no idea what to do. Do I have to compile the libraries first or use/adapt the cmake files? And how do I do this?
Ahsan说…
Windows 7 support is over, but there's no doubt, As Windows 7 is the most recommended OS, Which through user can do almost all work without any problem, Where I recommend you to activate your OS being purchased its license code from ODosta Store
After OS activation, You can easily get windows 10 remote tech support to run all old programs and get windows 10 updates.
You can upgrade your existing OS to windows 10, But you can face some technical issues, So I recommend you to have clean installation of Windows 7 or Windows 10 and activate it using legal license.
Hello Yili,

Could you share the VS Project with me?

I cannot get rid of Intel Fortran Redistributable Library dependency.
Green Mary说…
Share with you a good site that you can get cheap product keys from there: www.vanskeys.com, all versions of windows keys and office keys can be found in that site.

此博客中的热门博文

Mac OS X 10.10安装深度学习框架Caffe教程

Some notes about building Caffe RC3 with Mac OS X 10.11.3, Anaconda, CUDA 7.5, cuDNN 4, Intel MKL and MATLAB R2015b