Please, give me some tips for a HIGH PERFORMANCE C library for linear algebra (matrix algebra, eigenvalues, eigenvectors etc.). Can be both open-source or closed-source.
Asked
Active
Viewed 3.1k times
14
-
1Who ever makes the effort to write a library like that and make it low perf? Shopping questions are off topic at SE. – Hans Passant Aug 29 '11 at 10:43
-
4GSL did. They made a very portable and wide functionality library, but they did not optimize it well both in multiplatform way and in platform-depended way. – osgx Aug 29 '11 at 10:48
3 Answers
16
EDIT Thanks to comments from osgx:
- CLAPACK is the library which uder the hood uses very high-performance BLAS library, as do other libraries, like ATLAS.
- GSL is a standalone C library, not as fast as any based on BLAS. However its performance is still quite good (not extremely good though) and is used quite often; mostly because of its portability.
I know both LAPACK and GSL and I can recommend both of them. LAPACK is very low-level library and GSL may be more comfortable to use, but speaking of good performance -- BLAS-based library it is.
-
1Of course, as well as decompositions, etc. See: http://www.netlib.org/lapack/lawn41/node111.html (and the rest of the documentation). – Archie Aug 29 '11 at 10:08
-
-
1Good BLAS library (basic matrix-matrix; vector-matrix; vector-vector operations), e.g. ATLAS or GotoBLAS or Intel MKL + some LAPACK, which uses BLAS (all BLAS libraries have the same interface). The GSL will not use the high-performance BLAS. – osgx Aug 29 '11 at 10:25
-
Actually LAPACK is based mostly on BLAS (level 3). I didn't use ATLAS, but as far as I know its performance is comparable to LAPACK. – Archie Aug 29 '11 at 10:33
-
So we have an agreement: any library based on BLAS is good for high-performance computing. GSL is higher-level standalone library, but still relevant for many cases (not all though). – Archie Aug 29 '11 at 10:42
-
Sorry, actually, gsl may link with external BLAS library (cblas function names). – osgx Aug 29 '11 at 11:00
-
And basing of LAPACK on BLAS is the reason why LAPACK need little tuning of code to perform very good. All tuning is done in Good BLAS Library; autotuning in Atlas; handwriting of 100s kilobyte of asm in GotoBLAS; pirating GotoBLAS asm in MKL. Some tuning also was in AMD's ACML. But the GSL's internal BLAS is not tuned. – osgx Aug 29 '11 at 11:06
5
ATLAS, maybe?
Edit: if you're open to C++, you should definitely check Eigen, it's a very neat library, and pretty fast too, according to the benchmarks.

static_rtti
- 53,760
- 47
- 136
- 192
0
Again if you are actually looking/open for modern C++ code, Armadillo is getting really hyped/popular. Also see their own benchmarking against IT++ and Newmat.

Yauhen Yakimovich
- 13,635
- 8
- 60
- 67