[CMake] problem with FindBLAS.cmake looking for cblas_dgemm

Vardan Akopian vakopian+cmake at gmail.com
Thu Jul 16 05:45:04 EDT 2009


Hello,

I'm using cmake 2.6.2.
While trying to use the FindLAPACK module on a Linux system which has
ATLAS installed I stumbled upon a problem where the BLAS libraries
would not be found. By digging into FindBLAS.cmake I discovered that
when checking for the ATLAS libraries, the module tries to make sure
that the cblas_dgemm function is there and can be compiled within a
Fortran program. I find this a bit puzzling for a couple of reasons:
1) when compiled with GNU or Intel fortran (and I guess with most of
the other) compilers, the generated symbol would be cblas_dgemm_
(notice the underscore at the end). However the cblas library which
comes with ATLAS will have this symbol without the underscore, and
thus will not link.
2) why do we need to make sure cblas_dgemm function works? Isn't the
"cblas" part kind of an implementation detail? Why not just check for
dgemm function which is actually part of the BLAS interface?

Anyway, in my installation, the way FindBLAS.cmake is, it will fail
finding BLAS (and therefore LAPACK) that's provided by ATLAS. However,
by simply changing FindBLAS.cmake to look for the "dgemm" function
instead of "cblas_dgemm" everything works just fine.
Am I missing something? Wouldn't it be better to look for dgemm
instead of cblas_dgemm?

Thanks.
-Vardan


More information about the CMake mailing list