andresy/torch — Issue #12: CMake cannot find MKL on 32 bit machines
Author: pflaquerre
Created: 2012-03-05 20:32:43+00:00
State: open

From /lib/TH/cmake/FindMKL.cmake:

```
CHECK_TYPE_SIZE("void*" SIZE_OF_VOIDP)
IF ("${SIZE_OF_VOIDP}" EQUAL 8)
SET(mklvers "em64t")
SET(iccvers "intel64")
SET(mkl64s "_lp64")
ELSE ("${SIZE_OF_VOIDP}" EQUAL 8)
SET(mklvers "32")
SET(iccvers "ia32")
SET(mkl64s)
ENDIF ("${SIZE_OF_VOIDP}" EQUAL 8)
```

which will give you an empty mkl64s on 32 bit machines. Further down in the same file, all calls to `CHECK_ALL_LIBRARIES` are wrapped around by `FOREACH(mkl64 ${mkl64s} "")` (except for really old mkl versions). CMake's Modules/FindBLAS.cmake seems to handle this properly, so it's just a matter of integrating their checks in.