Using FindBLAS and FindLAPACK in CMake

I am a little confused by the usefulness

find_package (BLAS) and find_package (LAPACK) inside CMake.

It seems that depending on the provider found, different source code is needed. For example, mkl has

mkl.h and / or mkl_lapacke.h

but at least one other lapack implementation has a header called lapacke.h

so different headers are needed.

and also somatcopy for mkl is mkl_somatcopy, whereas other libraries clearly don't have the mkl_ prefix.

How do you reconcile this in general terms to work effectively with the find_package (LAPACK) tool?

Is there a standard header because it doesn't look like lapacke.h for the lapacke .. interface?

Finally, Accelerate is listed as an option, but Accelerate includes the equivalent LAPACK 3.2.1 features that skip the LAPACKE interface which is available in MKL and the current lapacke 3.5 netlib ..

+3


source to share


1 answer


So, the example I gave is an example of blas extension. The blas functions themselves are the same. The only problem is the different headers between mkl and other blas / lapack interfaces. As far as cmake is concerned, the mentioned find_package () routines are a bit out of place. I found it easier to find mkl, use it if found, otherwise fall back to findblas cmake routines, then I use add_definitions to define a preprocessor macro to change between mkl and other implementations ...



+1


source







All Articles