[cmake-developers] Is there an official FindMKL module?

Siebren Reker siebren.reker at gmail.com
Fri Aug 28 04:42:29 EDT 2015


Hi Tim,

On Thu, Aug 27, 2015 at 7:32 PM, Tim Gallagher <tim.gallagher at gatech.edu>
wrote:

> Hi Siebren,
>
> I tried to link statically and it did not work for me, similar errors as
> to what you are getting.
>

Ok, thank you for verifying


> The way the macro is supposed to work -- it checks for the MKL link tool
> and if it is available, it uses and provides the libraries needed. If it is
> unavailable (or throws errors or whatever else the case may be), then
> FindBLAS reverts back to the way it handles MKL currently.
>

Sound good to me.


> I have attached the module that provides the interface to the MKL command
> line tool as well as the changed FindBLAS module that uses it. Major caveat
> here -- I have not used these since 2012, with one of the Intel
> 12.something compilers and CMake 2.8. I did a quick diff on the FindBLAS in
> the current version and the CMake 2.8 version and there's only very minor
> changes that shouldn't affect this working. If it turns out this is useful
> and close to functional, then we can work on getting it current.
>

What you have sent feels 80% complete. It doesn't work out of the box, but
I could hack some small changes in to get some things working. I won't have
more time for this today, so here is what I've spotted so far, in case you
want to continue on this now.
- The calls to the macro (in FindBLAS.cmake) don't match with the macro
input in GetIntelMKLInfo, maybe you were adding additional parameters for
the mkl version and things such as integer representation, but hadn't
gotten around to adding them in the macro? Removing them from
FindBLAS.cmake allowed me to test further, but I can see that some more
inputs to the MKL command line tool need to be supported.
- The static flag was giving errors on the command line, an easy fix was to
use the same syntax as for the other flags:
         list(APPEND mkl_tool_opts "--linking=static")
- The stripping off of the additional libraries is very nice, but the regex
for the math library is overzealous: "-lm" matches all "-lmkl_intel_thread"
etc.
- The grouping of the static libraries results in them being parsed as
"static_flags", which leaves the final mkl_libs empty. Even though all
information has correctly been extracted, the macro then reports failure.
- I was not sure about the tool1 vs tool2 differences, was this also
intermediate work on getting the mkl_version information in?

I'll have more time to look at this next week, thanks for sharing this.

best,
Siebren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150828/feab4a05/attachment.html>


More information about the cmake-developers mailing list