From f99db2d1ac7ec149c50980cb8f6a4ee9713ae048 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Sun, 20 Dec 2020 23:08:10 -0800 Subject: [PATCH 01/11] [intel-mkl] Support Linux --- ports/intel-mkl/CONTROL | 1 + ports/intel-mkl/portfile.cmake | 34 ++++++++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ports/intel-mkl/CONTROL b/ports/intel-mkl/CONTROL index 0286f25def9c10..d194f3fe9457cf 100644 --- a/ports/intel-mkl/CONTROL +++ b/ports/intel-mkl/CONTROL @@ -1,3 +1,4 @@ Source: intel-mkl Version: 2020.0.0 +Port-Version: 1 Description: Intel® Math Kernel Library (Intel® MKL) accelerates math processing routines, increases application performance, and reduces development time on Intel® processors. \ No newline at end of file diff --git a/ports/intel-mkl/portfile.cmake b/ports/intel-mkl/portfile.cmake index 4e656948ea961d..f62f3f2ac17ec9 100644 --- a/ports/intel-mkl/portfile.cmake +++ b/ports/intel-mkl/portfile.cmake @@ -4,17 +4,39 @@ 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) +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(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 /opt/intel/compilers_and_libraries_*.*.*) + 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 PATHS $ENV{MKLROOT} ${INTEL_ROOT}/mkl DOC "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))?__") From 967f60ad7bff8dd0d14ad2628b22af88ee253beb Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 11 Jan 2021 21:51:32 -0800 Subject: [PATCH 02/11] [intel-mkl] Support search from ENVs --- ports/intel-mkl/portfile.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ports/intel-mkl/portfile.cmake b/ports/intel-mkl/portfile.cmake index f62f3f2ac17ec9..fd4666230e98a8 100644 --- a/ports/intel-mkl/portfile.cmake +++ b/ports/intel-mkl/portfile.cmake @@ -4,7 +4,6 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - if (VCPKG_TARGET_IS_WINDOWS) set(MKL_REQUIRED_VERSION 20200000) set(ProgramFilesx86 "ProgramFiles(x86)") @@ -15,7 +14,7 @@ if (VCPKG_TARGET_IS_WINDOWS) "\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 /opt/intel/compilers_and_libraries_*.*.*) + file(GLOB MKL_PATHS "$ENV{MKLROOT}" "${INTEL_ROOT}/mkl" "${INTEL_ONEAPI_MKL_ROOT}" /opt/intel/compilers_and_libraries_*.*.*) 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}) @@ -48,7 +47,7 @@ endif() file(STRINGS ${MKL_ROOT}/include/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() From 419746c5ac6630900dc5da6ebf64c24a2f755d01 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 27 Oct 2021 19:58:27 -0700 Subject: [PATCH 03/11] Add more search path --- ports/intel-mkl/portfile.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/intel-mkl/portfile.cmake b/ports/intel-mkl/portfile.cmake index d1cd714021286a..097309d939b075 100644 --- a/ports/intel-mkl/portfile.cmake +++ b/ports/intel-mkl/portfile.cmake @@ -15,7 +15,13 @@ if (VCPKG_TARGET_IS_WINDOWS) "\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}" /opt/intel/compilers_and_libraries_*.*.*) + file(GLOB MKL_PATHS + "$ENV{MKLROOT}" + "${INTEL_ROOT}/mkl" + "${INTEL_ONEAPI_MKL_ROOT}" + "/opt/intel/compilers_and_libraries_*.*.*" + "/opt/intel/oneapi/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}) From 4d8da5ae659e042a9f2c36d27b159a95453fc522 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 27 Oct 2021 19:59:35 -0700 Subject: [PATCH 04/11] Add double quotes to the version string --- ports/intel-mkl/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/intel-mkl/portfile.cmake b/ports/intel-mkl/portfile.cmake index 097309d939b075..bdfbda02e35bba 100644 --- a/ports/intel-mkl/portfile.cmake +++ b/ports/intel-mkl/portfile.cmake @@ -14,7 +14,7 @@ if (VCPKG_TARGET_IS_WINDOWS) "\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) + set(MKL_REQUIRED_VERSION "2020.0.000") file(GLOB MKL_PATHS "$ENV{MKLROOT}" "${INTEL_ROOT}/mkl" From 8d50dd172569e581220e12b40e0a7eeaa3c1190a Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 24 Aug 2022 02:07:49 -0700 Subject: [PATCH 05/11] Add extra 2 paths on non-Windows --- ports/intel-mkl/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/intel-mkl/portfile.cmake b/ports/intel-mkl/portfile.cmake index bdfbda02e35bba..38c48953225ffe 100644 --- a/ports/intel-mkl/portfile.cmake +++ b/ports/intel-mkl/portfile.cmake @@ -19,8 +19,10 @@ else() "$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) From ac197bba0eb7578516b7e6c22e10798ee6eb4964 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 1 Sep 2022 16:57:43 -0700 Subject: [PATCH 06/11] fix in linux --- ports/intel-mkl/portfile.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/intel-mkl/portfile.cmake b/ports/intel-mkl/portfile.cmake index 38c48953225ffe..da9cbaef666cd4 100644 --- a/ports/intel-mkl/portfile.cmake +++ b/ports/intel-mkl/portfile.cmake @@ -41,12 +41,13 @@ else() "\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} + /usr/include/mkl DOC "Folder contains MKL" ) @@ -61,7 +62,7 @@ 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 VERSION_LESS MKL_REQUIRED_VERSION) From 6b0d24519c5782da38ca82122389abc3803ddf0f Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 1 Sep 2022 16:59:38 -0700 Subject: [PATCH 07/11] Add subpath include for non-apt --- ports/intel-mkl/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/intel-mkl/portfile.cmake b/ports/intel-mkl/portfile.cmake index da9cbaef666cd4..cbae4899d0a7f2 100644 --- a/ports/intel-mkl/portfile.cmake +++ b/ports/intel-mkl/portfile.cmake @@ -43,10 +43,10 @@ endif() 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" From deedd7f827964b9225ebc6a794200c557476af92 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 1 Sep 2022 17:03:45 -0700 Subject: [PATCH 08/11] Add apt package intel-mkl --- scripts/azure-pipelines/linux/provision-image.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/azure-pipelines/linux/provision-image.sh b/scripts/azure-pipelines/linux/provision-image.sh index ce25aa10d7a65c..01ec242f4d66ef 100755 --- a/scripts/azure-pipelines/linux/provision-image.sh +++ b/scripts/azure-pipelines/linux/provision-image.sh @@ -72,6 +72,9 @@ APT_PACKAGES="$APT_PACKAGES haskell-stack" # Additionally required/installed by Azure DevOps Scale Set Agents APT_PACKAGES="$APT_PACKAGES libkrb5-3 zlib1g libicu70" +# Additionally required by intel-mkl +APT_PACKAGES="$APT_PACKAGES intel-mkl" + apt-get -y install $APT_PACKAGES # Start up cudnn From ed75214a46146d2eed8607f4934898ac03bbd4c7 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 1 Sep 2022 17:04:16 -0700 Subject: [PATCH 09/11] update baseline --- scripts/ci.baseline.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index dfbf59cf95061c..3dd9227ea34afc 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -372,7 +372,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 From 1d5d54963b0dc97ff2e3ed184fb45de896603727 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 1 Sep 2022 18:54:47 -0700 Subject: [PATCH 10/11] Add wrapper --- ports/intel-mkl/portfile.cmake | 2 ++ ports/intel-mkl/vcpkg-cmake-wrapper.cmake.in | 3 +++ ports/intel-mkl/vcpkg.json | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 ports/intel-mkl/vcpkg-cmake-wrapper.cmake.in diff --git a/ports/intel-mkl/portfile.cmake b/ports/intel-mkl/portfile.cmake index cbae4899d0a7f2..67e6d982daaf7c 100644 --- a/ports/intel-mkl/portfile.cmake +++ b/ports/intel-mkl/portfile.cmake @@ -69,3 +69,5 @@ 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://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) diff --git a/ports/intel-mkl/vcpkg-cmake-wrapper.cmake.in b/ports/intel-mkl/vcpkg-cmake-wrapper.cmake.in new file mode 100644 index 00000000000000..5a776e9af0e0a7 --- /dev/null +++ b/ports/intel-mkl/vcpkg-cmake-wrapper.cmake.in @@ -0,0 +1,3 @@ +set(MKL_INCLUDE_DIR "@MKL_ROOT@") + +_find_package(MKL) diff --git a/ports/intel-mkl/vcpkg.json b/ports/intel-mkl/vcpkg.json index 3e592a9049ce5d..6c61d77a28080c 100644 --- a/ports/intel-mkl/vcpkg.json +++ b/ports/intel-mkl/vcpkg.json @@ -2,5 +2,6 @@ "name": "intel-mkl", "version": "2020.0.0", "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." + "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" } From 2aa12184610eada2ffddeead5c901897323eca36 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 1 Sep 2022 18:55:00 -0700 Subject: [PATCH 11/11] version --- versions/baseline.json | 2 +- versions/i-/intel-mkl.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 1d9424294af94a..31cb1d21a76370 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3058,7 +3058,7 @@ }, "intel-mkl": { "baseline": "2020.0.0", - "port-version": 2 + "port-version": 3 }, "intelrdfpmathlib": { "baseline": "20U2", diff --git a/versions/i-/intel-mkl.json b/versions/i-/intel-mkl.json index 1c5ffb0efe056e..20b117dab34858 100644 --- a/versions/i-/intel-mkl.json +++ b/versions/i-/intel-mkl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "50abc44be806f0f8f752bf26cfd76d37c10827b4", + "version": "2020.0.0", + "port-version": 3 + }, { "git-tree": "f2d5b828df130d8b1106aa0c076eb9cb79e50ea9", "version": "2020.0.0",