1 # Due to the complexity involved, this package doesn't install MKL. It instead verifies that MKL is installed.
2 # Other packages can depend on this package to declare a dependency on MKL.
3 # If this package is installed, we assume that MKL is properly installed.
5 set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
7 set(MKL_REQUIRED_VERSION "20200000")
9 set(ProgramFilesx86 "ProgramFiles(x86)")
10 set(INTEL_ROOT $ENV{${ProgramFilesx86}}/IntelSWTools/compilers_and_libraries/windows)
12 find_path(MKL_ROOT include/mkl.h PATHS $ENV{MKLROOT} ${INTEL_ROOT}/mkl DOC "Folder contains MKL")
14 if (MKL_ROOT STREQUAL "MKL_ROOT-NOTFOUND")
15 message(FATAL_ERROR "Could not find MKL. Before continuing, please download and install MKL (${MKL_REQUIRED_VERSION} or higher) from:"
16 "\n https://registrationcenter.intel.com/en/products/download/3178/\n"
17 "\nAlso ensure vcpkg has been rebuilt with the latest version (v0.0.104 or later)")
20 # file(STRINGS ${MKL_ROOT}/include/mkl_version.h MKL_VERSION_DEFINITION REGEX "__INTEL_MKL((_MINOR)|(_UPDATE))?__")
21 # string(REGEX MATCHALL "([0-9]+)" MKL_VERSION ${MKL_VERSION_DEFINITION})
22 # list(GET MKL_VERSION 0 MKL_VERSION_MAJOR)
23 # list(GET MKL_VERSION 1 MKL_VERSION_MINOR)
24 # list(GET MKL_VERSION 2 MKL_VERSION_UPDATE)
26 file(STRINGS ${MKL_ROOT}/include/mkl_version.h MKL_VERSION_DEFINITION REGEX "INTEL_MKL_VERSION")
27 string(REGEX MATCH "([0-9]+)" MKL_VERSION ${MKL_VERSION_DEFINITION})
29 if (MKL_VERSION LESS MKL_REQUIRED_VERSION)
30 message(FATAL_ERROR "MKL ${MKL_VERSION} is found but ${MKL_REQUIRED_VERSION} is required. Please download and install a more recent version of MKL from:"
31 "\n https://registrationcenter.intel.com/en/products/download/3178/\n")