|
7 | 7 | The TensorFlow libraries are copied for Windows and Linux and it becomes |
8 | 8 | possible to bundle a meta-package containing them. |
9 | 9 |
|
10 | | -.PARAMETER CpuLibraries |
11 | | - Switch indicating if the script should download the CPU or GPU version of the |
| 10 | +.PARAMETER SkipCpuLibraries |
| 11 | + Setting this to true skips the downloading of the CPU version of the |
12 | 12 | TensorFlow libraries. |
13 | | - By default the GPU version of the libraries is downloaded. |
| 13 | + By default the CPU version of the libraries are downloaded and put in the |
| 14 | + relevant projects. |
| 15 | +
|
| 16 | +.PARAMETER SkipGpuLibraries |
| 17 | + Setting this to tru skips the downloading of the GPU version of the |
| 18 | + TensorFlow libraries. |
| 19 | + By default the GPU version of the libraries are downloaded and put in the |
| 20 | + releavant projects. |
14 | 21 |
|
15 | 22 | #> |
16 | 23 | param( |
17 | | - [switch] $CpuLibraries = $false |
| 24 | + [switch] $SkipCpuLibraries = $false, |
| 25 | + [switch] $SkipGpuLibraries = $false |
18 | 26 | ) |
19 | 27 |
|
20 | 28 | function Expand-TarGzFiles { |
@@ -128,22 +136,32 @@ function Copy-Archive { |
128 | 136 | } |
129 | 137 |
|
130 | 138 | $LinuxGpuArchive = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-1.14.0.tar.gz" |
| 139 | +$LinuxCpuArchive = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz" |
131 | 140 | $LinuxFiles = @(".\libtensorflow.tar", ".\lib\libtensorflow.so", ".\lib\libtensorflow.so.1", ".\lib\libtensorflow.so.1.14.0", ` |
132 | 141 | ".\lib\libtensorflow_framework.so", ".\lib\libtensorflow_framework.so.1", ".\lib\libtensorflow_framework.so.1.14.0") |
133 | 142 | $WindowsGpuArchive = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-windows-x86_64-1.14.0.zip" |
| 143 | +$WindowsCpuArchive = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-1.14.0.zip" |
134 | 144 | $WindowsFiles = @("lib\tensorflow.dll") |
135 | 145 | $PackagesDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "packages") |
136 | 146 |
|
137 | 147 |
|
138 | | -if (-not $CpuLibraries) { |
139 | | - $WindowsArchive = $WindowsGpuArchive |
140 | | - $LinuxArchive = $LinuxGpuArchive |
| 148 | +if (-not $SkipGpuLibraries) { |
| 149 | + $Archive = Copy-Archive -ArchiveUrl $WindowsGpuArchive -TargetDirectory $PackagesDirectory |
| 150 | + $TargetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "src", "runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist") |
| 151 | + Expand-ZipFiles $Archive $WindowsFiles $TargetDirectory |
| 152 | + |
| 153 | + $Archive = Copy-Archive -ArchiveUrl $LinuxGpuArchive -TargetDirectory $PackagesDirectory |
| 154 | + $TargetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "src", "runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist") |
| 155 | + Expand-TarGzFiles $Archive $LinuxFiles $TargetDirectory |
141 | 156 | } |
142 | 157 |
|
143 | | -$Archive = Copy-Archive -ArchiveUrl $WindowsArchive -TargetDirectory $PackagesDirectory |
144 | | -$TargetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "src", "runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist") |
145 | | -Expand-ZipFiles $Archive $WindowsFiles $TargetDirectory |
| 158 | +if (-not $SkipCpuLibraries) { |
| 159 | + $Archive = Copy-Archive -ArchiveUrl $WindowsCpuArchive -TargetDirectory $PackagesDirectory |
| 160 | + $TargetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "src", "runtime.win-x64.SciSharp.TensorFlow-Cpu.Redist") |
| 161 | + Expand-ZipFiles $Archive $WindowsFiles $TargetDirectory |
| 162 | + |
| 163 | + $Archive = Copy-Archive -ArchiveUrl $LinuxCpuArchive -TargetDirectory $PackagesDirectory |
| 164 | + $TargetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "src", "runtime.linux-x64.SciSharp.Tensorflow-Cpu.Redist") |
| 165 | + Expand-TarGzFiles $Archive $LinuxFiles $TargetDirectory |
| 166 | +} |
146 | 167 |
|
147 | | -$Archive = Copy-Archive -ArchiveUrl $LinuxArchive -TargetDirectory $PackagesDirectory |
148 | | -$TargetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "src", "runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist") |
149 | | -Expand-TarGzFiles $Archive $LinuxFiles $TargetDirectory |
|
0 commit comments