@@ -13,6 +13,9 @@ Specifies the BLAS accelerator, supported values are: "OpenBLAS", "CUDA", "OFF"
13
13
. PARAMETER version
14
14
Specifies a llama.cpp commit or tag to checkout a specific version.
15
15
16
+ . PARAMETER target
17
+ Specifies CMake build targets to compile a specific subset of the llama.cpp project.
18
+
16
19
. EXAMPLE
17
20
.\rebuild_llama.cpp.ps1
18
21
@@ -21,6 +24,9 @@ Specifies a llama.cpp commit or tag to checkout a specific version.
21
24
22
25
. EXAMPLE
23
26
.\rebuild_llama.cpp.ps1 -blasAccelerator "CUDA" -version "master-4e7464e"
27
+
28
+ . EXAMPLE
29
+ .\rebuild_llama.cpp.ps1 -target "llama-server llama-cli"
24
30
#>
25
31
26
32
Param (
@@ -29,7 +35,10 @@ Param (
29
35
$blasAccelerator ,
30
36
31
37
[String ]
32
- $version
38
+ $version ,
39
+
40
+ [String ]
41
+ $target = " default"
33
42
)
34
43
35
44
$stopwatch = [System.Diagnostics.Stopwatch ]::startNew()
@@ -66,9 +75,10 @@ if (!$blasAccelerator) {
66
75
}
67
76
}
68
77
69
- Write-Host " Building llama.cpp..." - ForegroundColor " Yellow"
78
+ Write-Host " Building the llama.cpp project ..." - ForegroundColor " Yellow"
70
79
Write-Host " Version: ${version} " - ForegroundColor " DarkYellow"
71
80
Write-Host " BLAS accelerator: ${blasAccelerator} " - ForegroundColor " DarkYellow"
81
+ Write-Host " Target: ${target} " - ForegroundColor " DarkYellow"
72
82
73
83
$openBLASVersion = " 0.3.26"
74
84
@@ -140,6 +150,8 @@ New-Item -Path "./vendor/llama.cpp" -Name "build" -ItemType "directory"
140
150
141
151
Set-Location - Path " ./vendor/llama.cpp/build"
142
152
153
+ Write-Host " [CMake] Configuring and generating project..." - ForegroundColor " Yellow"
154
+
143
155
switch ($blasAccelerator ) {
144
156
145
157
" OpenBLAS" {
@@ -161,10 +173,13 @@ switch ($blasAccelerator) {
161
173
}
162
174
}
163
175
176
+ Write-Host " [CMake] Building project targets '${target} '..." - ForegroundColor " Yellow"
177
+
164
178
cmake `
165
179
-- build . `
166
180
-- config Release `
167
- -- parallel (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
181
+ -- parallel (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors `
182
+ -- target " ${target} "
168
183
169
184
Copy-Item - Path " ../../OpenBLAS/bin/libopenblas.dll" - Destination " ./bin/Release/libopenblas.dll"
170
185
0 commit comments