From 1ba7faacc8f2ea24dcec6f5edcd2d4478d414fcf Mon Sep 17 00:00:00 2001 From: Wolfgang Manousek Date: Tue, 10 Jan 2017 10:46:36 +0100 Subject: [PATCH] remove unused command line parameter, add AnacondaBasePath option --- Scripts/devInstall/Windows/DevInstall.ps1 | 31 ++++++++----------- .../devInstall/Windows/helper/Operations.ps1 | 13 ++++---- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Scripts/devInstall/Windows/DevInstall.ps1 b/Scripts/devInstall/Windows/DevInstall.ps1 index 31ea6c69d..2ceda00ac 100644 --- a/Scripts/devInstall/Windows/DevInstall.ps1 +++ b/Scripts/devInstall/Windows/DevInstall.ps1 @@ -18,21 +18,15 @@ .PARAMETER localCache This optional parameter can be used to specify the directory downloaded components will be stored in - .PARAMETER ServerLocation - This is an optional parameter. The script can install pre-compiled components, this parameter - specifies the location on a server where this componentents are downloaded from. - This is useful for a team environment to share the components which need to get compiled (Protobuf, Zlib, libzip) - - .PARAMETER CloneDirectory - By default the installer should be executed out of the \Scripts\devInstall\Windows directory. Out of this - location the installer computes the root directory of the CNTK clone. In the case the installer is in a different location, - the root directory of the CNTK clone can be specified using this parameter - -.EXAMPLE + .PARAMETER AnacondaBasePath + This is an optional parameter and can be used to specify an already installed Anaconda3 installation. + By default a version of Anaconda3 will be installed into [C:\local\Anaconda3-4.1.1-Windows-x86_64] + + .EXAMPLE installer.ps1 Run the installer and see what operations would be performed -.EXAMPLE + .EXAMPLE installer.ps1 -Execute Run the installer and install the development tools @@ -41,10 +35,12 @@ Run the installer, but don't install any GPU specific tools .EXAMPLE - installer.ps1 -Execute -NoGpu -CloneDirectory c:\repos\CNTKAlternate + installer.ps1 -Execute -NoGpu - Run the installer, but don't install any GPU specific tools .EXAMPLE + .\install.ps1 -Execute -AnacondaBasePath d:\mytools\Anaconda34 + + This will install Anaconda in the [d:\mytools\Anaconda34] directory, or reuse this Anaconda installation if the directory exists. #> @@ -54,8 +50,7 @@ Param( [parameter(Mandatory=$false)] [switch] $NoGpu, [parameter(Mandatory=$false)] [string] $localCache = "c:\installCacheCntk", [parameter(Mandatory=$false)] [string] $InstallLocation = "c:\local", - [parameter(Mandatory=$false)] [string] $ServerLocation, - [parameter(Mandatory=$false)] [string] $CloneDirectory) + [parameter(Mandatory=$false)] [string] $AnacondaBasePath = "C:\local\Anaconda3-4.1.1-Windows-x86_64") $roboCopyCmd = "robocopy.exe" $localDir = $InstallLocation @@ -139,8 +134,8 @@ Function main $operation += OpZlibVS15 -cache $localCache -targetFolder $localDir -repoDirectory $CloneDirectory $operation += OpZlibVS15Prebuild -cache $localCache -targetFolder $localDir $operation += OpOpenCV31 -cache $localCache -targetFolder $localDir - $operation += OpAnaconda3411 -cache $localCache -targetFolder $localDir - $operation += OpAnacondaEnv34 -targetFolder $localDir -repoDir $repositoryRootDir -repoName $reponame + $operation += OpAnaconda3411 -cache $localCache -AnacondaBasePath $AnacondaBasePath + $operation += OpAnacondaEnv34 -AnacondaBasePath $AnacondaBasePath -repoDir $repositoryRootDir -repoName $reponame $operationList = @() $operationList += (VerifyOperations $operation) diff --git a/Scripts/devInstall/Windows/helper/Operations.ps1 b/Scripts/devInstall/Windows/helper/Operations.ps1 index 342328dee..6484cd50c 100644 --- a/Scripts/devInstall/Windows/helper/Operations.ps1 +++ b/Scripts/devInstall/Windows/helper/Operations.ps1 @@ -1,10 +1,11 @@ function OpAnaconda3411( [parameter(Mandatory=$true)][string] $cache, - [parameter(Mandatory=$true)][string] $targetFolder) + [parameter(Mandatory=$true)][string] $AnacondaBasePath) { + $targetFolder = Split-Path $AnacondaBasePath -Parent + $prodSubDir = Split-Path $AnacondaBasePath -Leaf $prodName = "Anaconda3-4.1.1" $prodFile = "Anaconda3-4.1.1-Windows-x86_64.exe" - $prodSubDir = "Anaconda3-4.1.1-Windows-x86_64" $targetPath = join-path $targetFolder $prodSubDir $downloadSource = "https://repo.continuum.io/archive/Anaconda3-4.1.1-Windows-x86_64.exe" $downloadSize = 370055720 @@ -17,13 +18,13 @@ } function OpAnacondaEnv34( - [parameter(Mandatory=$true)][string] $targetFolder, + [parameter(Mandatory=$true)][string] $AnacondaBasePath, [parameter(Mandatory=$true)][string] $repoDir, [parameter(Mandatory=$true)][string] $reponame) { $prodName = "Python 3.4 Environment" - - $prodSubDir = "Anaconda3-4.1.1-Windows-x86_64" + $targetFolder = Split-Path $AnacondaBasePath -Parent + $prodSubDir = Split-Path $AnacondaBasePath -Leaf $targetPath = join-path $targetFolder $prodSubDir $envName = "cntkdev-py34" $envDir = "envs\$envName" @@ -128,7 +129,7 @@ function OpMSMPI70SDK( $downloadSource = "https://download.microsoft.com/download/D/7/B/D7BBA00F-71B7-436B-80BC-4D22F2EE9862/$remoteFilename"; $downloadSize = 2285568 - @( @{Name = "MSMPI SDK70 Installation"; ShortName = "CNTK"; VerifyInfo = "Checking for installed MSMPI 70 SDK"; ActionInfo = "Install MSMPI 70 SDK"; + @( @{Name = "MSMPI SDK70 Installation"; ShortName = "CNTK"; VerifyInfo = "Checking for installed MSMPI 70 SDK"; ActionInfo = "Installing MSMPI 70 SDK"; Verification = @( @{Function = "VerifyWinProductVersion"; Match = "^Microsoft MPI SDK \(\d+\."; Version = "7.0.12437.6"; MatchExact = $false } ); #Verification = @( @{Function = "VerifyWinProductExists"; Match = "^Microsoft MPI SDK \(\d+\."; Compare = "^Microsoft MPI SDK \(7\.0\.12437\.6\)"; MatchExact = $false } ); Download = @( @{Function = "Download"; Method = "WebRequest"; Source = $downloadSource; Destination = "$cache\$localFilename"; ExpectedSize = $downloadSize } );