8

My purpose of using LAPACK is to calculate the cholesky of a matrix. I am programming in C/C++ in Fedora, but I am confused over which lapack to install - LAPACK with lapacke or clapack?

cyw
  • 163
  • 3
  • 11
  • 1
    Just a comment. There is no such language a C/C++. There is C and C++. They are not the same. Are you wanting to code in C or C++? – talonmies Jul 04 '11 at 07:05

1 Answers1

9

The basic difference between the two is the need for a Fortran compiler.

CLAPACK is basically just the reference NETLIB LAPACK routines passed through the old f2c converter, allowing the library to be compiled with a C compiler.

LAPACKE is an attempt (started by Intel IIRC) to define a formal C language interface for Fortran LAPACK libraries. It has the advantage that it is LAPACK implementation independent and will hide toolchain specific C to Fortran interoperability so that the programmer doesn't have to worry about them. LAPACKE also has the distinct advantage of working correctly with the C99 complex intrinsic type.

I would not expect a major performance difference between the two (the choice of BLAS dictates most of that), but I would probably favor LAPACKE + the LAPACK and BLAS implmementation of choice, if I were to start from scratch today.

talonmies
  • 70,661
  • 34
  • 192
  • 269
  • Thanks for your reply, talonmies. I am coding in a mixture of c and c++. I have been struggling in the installation of lapack. I have just installed Lapack 3.3.1 and Lapacke, but when i make lapack_testing, it complains '../../../lapack-3.3.1/lapack_LINUX.a(xerbla.o): In function `xerbla_': /trunk/lapack/lapack-3.3.1/SRC/xerbla.f:40: undefined reference to `_gfortran_st_write' Should I install Lapack 3.2.1 instead of 3.3.1? – cyw Jul 04 '11 at 08:08
  • [solved]. In the make.inc, I found out that i need to set LINKER=fortran, then make lapacke_testing runs without error. THanks@ – cyw Jul 04 '11 at 08:52
  • That is telling you that you are not linking the fortran standard library. You might find it easier to use the fortran compiler to link, and add the C or/or C++ standard libraries to the list of libraries you need to link. – talonmies Jul 04 '11 at 08:53
  • Additionally, clapack seems to be unmaintained: http://nicolas.limare.net/pro/notes/2014/10/31_cblas_clapack_lapacke/ – gaborous Jun 14 '17 at 10:46