3

I am a bit confused by the utility of

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

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

mkl.h and/or mkl_lapacke.h

but at least one other implementation of lapack has a header which is just called lapacke.h

so different headers are needed.

and also somatcopy for mkl is mkl_somatcopy whereas other libraries clearly wont have the mkl_ prefix.

How do you reconcile this in a generic fashion as to make a tool such as find_package( LAPACK) work effectively?

Is there a standard header, because it doesn't appear to be lapacke.h for the lapacke interface..?

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

4

1 回答 1

1

好的,所以我给出的示例是 blas 扩展的示例。blas 函数本身都是一样的。唯一的问题是 mkl 和其他 blas/lapack 接口之间的不同标头。就 cmake 而言,提到的 find_package() 例程有点不合适。我发现搜索 mkl 最容易,如果找到就使用它,否则回退到 cmake 的 findblas 例程,然后我使用 add_definitions 定义一个预处理器宏以在 mkl 和其他实现之间进行更改...

于 2014-11-14T06:09:21.847 回答