2 rem ===============================================================================
3 rem Copyright 2018 Intel Corporation
5 rem Licensed under the Apache License, Version 2.0 (the "License");
6 rem you may not use this file except in compliance with the License.
7 rem You may obtain a copy of the License at
9 rem http://www.apache.org/licenses/LICENSE-2.0
11 rem Unless required by applicable law or agreed to in writing, software
12 rem distributed under the License is distributed on an "AS IS" BASIS,
13 rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 rem See the License for the specific language governing permissions and
15 rem limitations under the License.
16 rem ===============================================================================
18 rem req: PowerShell 3.0+
19 powershell.exe -command "if ($PSVersionTable.PSVersion.Major -ge 3) {exit 1} else {Write-Host \"The script requires PowerShell 3.0 or above (current version: $($PSVersionTable.PSVersion.Major).$($PSVersionTable.PSVersion.Minor))\"}" && goto Error_load
21 set MKLURLROOT=https://github.com/intel/mkl-dnn/releases/download/v0.18-rc/
22 set MKLVERSION=2019.0.3.20190125
24 set MKLPACKAGE=mklml_win_%MKLVERSION%
26 set MKLURL=%MKLURLROOT%%MKLPACKAGE%.zip
28 set DST=%~dp0..\external
30 set DST=%1\..\external
33 if not exist %DST% mkdir %DST%
35 if not exist "%DST%\%MKLPACKAGE%\license.txt" (
36 powershell.exe -command "if (Get-Command Invoke-WebRequest -errorAction SilentlyContinue){[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest %MKLURL% -OutFile %DST%\%MKLPACKAGE%.zip} else {exit 1}" && goto Unpack || goto Error_load
39 powershell.exe -command "if (Get-Command Add-Type -errorAction SilentlyContinue) {Add-Type -Assembly \"System.IO.Compression.FileSystem\"; try { [IO.Compression.zipfile]::ExtractToDirectory(\"%DST%\%MKLPACKAGE%.zip\", \"%DST%\")}catch{$_.exception ; exit 1}} else {exit 1}" && goto Exit || goto Error_unpack
42 echo prepare_mkl.bat : Error: Failed to load %MKLURL% to %DST%, try to load it manually
46 echo prepare_mkl.bat : Error: Failed to unpack %DST%\%MKLPACKAGE%.zip to %DST%, try unpack the archive manually
50 echo Downloaded and unpacked Intel^(R^) MKL small libraries to %DST%
53 echo Intel^(R^) MKL small libraries are already installed in %DST%