forked from amd/RyzenAI-SW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_dependencies.ps1
52 lines (45 loc) · 1.69 KB
/
build_dependencies.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Set script to stop on error
$ErrorActionPreference = "Stop"
# Check if $env:CONDA_PREFIX is set
if (-not $env:CONDA_PREFIX) {
Write-Host "Error: CONDA_PREFIX is not set."
exit 1
}
# Set the root directory for the dependency
$CWD = Split-Path -Parent $MyInvocation.MyCommand.Path
$AIERT_CMAKE_PATH = Join-Path $CWD "ext\aie-rt\driver\src"
$AIECTRL_CMAKE_PATH = Join-Path $CWD "ext\aie_controller"
$DD_CMAKE_PATH = Join-Path $CWD "ext\DynamicDispatch"
$env:XRT_DIR = Join-Path $CWD "third_party\xrt-ipu"
# Check if the directory exists
if (-not (Test-Path $AIERT_CMAKE_PATH)) {
Write-Host "Error: Directory $AIERT_CMAKE_PATH does not exist."
exit 1
}
if (-not (Test-Path $AIECTRL_CMAKE_PATH)) {
Write-Host "Error: Directory $AIECTRL_CMAKE_PATH does not exist."
exit 1
}
# Invoke cmake to build and install the dependency
try {
cmake -S $AIERT_CMAKE_PATH -B build_aiert -DXAIENGINE_BUILD_SHARED=OFF -DCMAKE_INSTALL_PREFIX=$env:CONDA_PREFIX
cmake --build build_aiert --target install --config Release
} catch {
Write-Host "Error: cmake build or installation failed."
exit 1
}
try {
cmake -S $AIECTRL_CMAKE_PATH -B build_aiectrl -DCMAKE_PREFIX_PATH=$env:CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$env:CONDA_PREFIX
cmake --build build_aiectrl --target install --config Release
} catch {
Write-Host "Error: cmake build or installation failed."
exit 1
}
try {
cmake -S $DD_CMAKE_PATH -B build_dd -DCMAKE_PREFIX_PATH=$env:CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$env:CONDA_PREFIX
cmake --build build_dd --target install --config Release
} catch {
Write-Host "Error: cmake build or installation failed."
exit 1
}
Write-Host "Build and installation completed successfully."