Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 50 additions & 17 deletions ports/intel-mkl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,56 @@

set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

set(MKL_REQUIRED_VERSION "20200000")

set(ProgramFilesx86 "ProgramFiles(x86)")
set(INTEL_ROOT $ENV{${ProgramFilesx86}}/IntelSWTools/compilers_and_libraries/windows)
set(ONEMKL_ROOT $ENV{${ProgramFilesx86}}/Intel/oneAPI/mkl/latest)
if (VCPKG_TARGET_IS_WINDOWS)
set(MKL_REQUIRED_VERSION "20200000")
set(ProgramFilesx86 "ProgramFiles(x86)")
set(INTEL_ROOT $ENV{${ProgramFilesx86}}/IntelSWTools/compilers_and_libraries/windows)
set(ONEMKL_ROOT $ENV{${ProgramFilesx86}}/Intel/oneAPI/mkl/latest)

set(FAILURE_MESSAGE "Could not find MKL. Before continuing, please download and install MKL (${MKL_REQUIRED_VERSION} or higher) from:"
"\n https://registrationcenter.intel.com/en/products/download/3178/\n"
"\nAlso ensure vcpkg has been rebuilt with the latest version (v0.0.104 or later)")
else()
set(MKL_REQUIRED_VERSION "2020.0.000")
file(GLOB MKL_PATHS
"$ENV{MKLROOT}"
"${INTEL_ROOT}/mkl"
"${INTEL_ONEAPI_MKL_ROOT}"
"${ONEAPI_ROOT}/mkl"
"/opt/intel/compilers_and_libraries_*.*.*"
"/opt/intel/oneapi/mkl"
"/opt/intel/mkl"
)
foreach(MKL_PATH ${MKL_PATHS})
get_filename_component(CURRENT_VERSION ${MKL_PATH} NAME)
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+$" VERSION_NUM ${CURRENT_VERSION})
if (IS_DIRECTORY ${MKL_PATH} AND VERSION_NUM)
if (VERSION_NUM VERSION_GREATER_EQUAL ${MKL_REQUIRED_VERSION})
set(INTEL_ROOT ${MKL_PATH}/linux)
message("Fond Suitable version ${VERSION_NUM}")
break()
endif()
endif()
endforeach()

set(FAILURE_MESSAGE "Could not find MKL. Before continuing, please install MKL (${MKL_REQUIRED_VERSION} or higher) using the system package manager"
"See https://software.intel.com/content/www/us/en/develop/articles/installing-intel-free-libs-and-python-apt-repo.html"
"\nAlso ensure vcpkg has been rebuilt with the latest version (v0.0.104 or later)")
endif()

find_path(MKL_ROOT include/mkl.h
find_path(MKL_ROOT mkl.h
PATHS
$ENV{MKLROOT}
${INTEL_ROOT}/mkl
$ENV{ONEAPI_ROOT}/mkl/latest
${ONEMKL_ROOT}
$ENV{MKLROOT}/include
${INTEL_ROOT}/mkl/include
$ENV{ONEAPI_ROOT}/mkl/latest/include
${ONEMKL_ROOT}/include
/usr/include/mkl
DOC
"Folder contains MKL")
"Folder contains MKL"
)

if (MKL_ROOT STREQUAL "MKL_ROOT-NOTFOUND")
message(FATAL_ERROR "Could not find MKL. Before continuing, please download and install MKL (${MKL_REQUIRED_VERSION} or higher) from:"
"\n https://registrationcenter.intel.com/en/products/download/3178/\n"
"\nAlso ensure vcpkg has been rebuilt with the latest version (v0.0.104 or later)")
message(FATAL_ERROR ${FAILURE_MESSAGE})
endif()

# file(STRINGS ${MKL_ROOT}/include/mkl_version.h MKL_VERSION_DEFINITION REGEX "__INTEL_MKL((_MINOR)|(_UPDATE))?__")
Expand All @@ -31,10 +62,12 @@ endif()
# list(GET MKL_VERSION 1 MKL_VERSION_MINOR)
# list(GET MKL_VERSION 2 MKL_VERSION_UPDATE)

file(STRINGS ${MKL_ROOT}/include/mkl_version.h MKL_VERSION_DEFINITION REGEX "INTEL_MKL_VERSION")
file(STRINGS "${MKL_ROOT}/mkl_version.h" MKL_VERSION_DEFINITION REGEX "INTEL_MKL_VERSION")
string(REGEX MATCH "([0-9]+)" MKL_VERSION ${MKL_VERSION_DEFINITION})

if (MKL_VERSION LESS MKL_REQUIRED_VERSION)
if (MKL_VERSION VERSION_LESS MKL_REQUIRED_VERSION)
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:"
"\n https://registrationcenter.intel.com/en/products/download/3178/\n")
"\n https://software.intel.com/content/www/us/en/develop/tools/oneapi/base-toolkit.html\n")
endif()

configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/mkl/vcpkg-cmake-wrapper.cmake" @ONLY)
3 changes: 3 additions & 0 deletions ports/intel-mkl/vcpkg-cmake-wrapper.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(MKL_INCLUDE_DIR "@MKL_ROOT@")

_find_package(MKL)
5 changes: 3 additions & 2 deletions ports/intel-mkl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "intel-mkl",
"version": "2020.0.0",
"port-version": 2,
"description": "Intel® Math Kernel Library (Intel® MKL) accelerates math processing routines, increases application performance, and reduces development time on Intel® processors. Due to the complexity involved, this package doesn't install MKL. It instead verifies that MKL is installed. Please download and install MKL from https://registrationcenter.intel.com/en/products/download/3178/ manually before using it in vcpkg."
"port-version": 3,
"description": "Intel® Math Kernel Library (Intel® MKL) accelerates math processing routines, increases application performance, and reduces development time on Intel® processors. Due to the complexity involved, this package doesn't install MKL. It instead verifies that MKL is installed. Please download and install MKL from https://registrationcenter.intel.com/en/products/download/3178/ manually before using it in vcpkg.",
"license": "Apache-2.0"
}
3 changes: 3 additions & 0 deletions scripts/azure-pipelines/linux/provision-image.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ APT_PACKAGES="$APT_PACKAGES haskell-stack"
## required by duktape
APT_PACKAGES="$APT_PACKAGES python-yaml"

# required by intel-mkl
APT_PACKAGES="$APT_PACKAGES intel-mkl"

## CUDA
APT_PACKAGES="$APT_PACKAGES cuda-compiler-11-6 cuda-libraries-dev-11-6 cuda-driver-dev-11-6 \
cuda-cudart-dev-11-6 libcublas-11-6 libcurand-dev-11-6 cuda-nvml-dev-11-6 libcudnn8-dev libnccl2 \
Expand Down
1 change: 0 additions & 1 deletion scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ ijg-libjpeg:x64-windows-static = skip
ijg-libjpeg:x86-windows = skip
intel-mkl:arm64-windows=fail
intel-mkl:arm-uwp=fail
intel-mkl:x64-linux=fail
intel-mkl:x64-osx=fail
intel-mkl:arm64-osx=fail
intel-mkl:x64-uwp=fail
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3098,7 +3098,7 @@
},
"intel-mkl": {
"baseline": "2020.0.0",
"port-version": 2
"port-version": 3
},
"intelrdfpmathlib": {
"baseline": "20U2",
Expand Down
5 changes: 5 additions & 0 deletions versions/i-/intel-mkl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "50abc44be806f0f8f752bf26cfd76d37c10827b4",
"version": "2020.0.0",
"port-version": 3
},
{
"git-tree": "f2d5b828df130d8b1106aa0c076eb9cb79e50ea9",
"version": "2020.0.0",
Expand Down