-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.sh
50 lines (41 loc) · 1.68 KB
/
build.sh
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
#!/bin/sh
####################################################################################################
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root for license information.
####################################################################################################
set -e
# Build script for the Accera Python package
ACCERA_ROOT=`pwd`
# Ensure that submodules are cloned
git submodule init
git submodule update
# Install dependencies
# Linux: apt get install pkg-config
pip install -r requirements.txt
cd external/vcpkg
./bootstrap-vcpkg.sh
./vcpkg install catch2 tomlplusplus --overlay-ports=../llvm
if [ -z "${LLVM_SETUP_VARIANT}" ] && [ -f "$ACCERA_ROOT/CMake/LLVMSetupConan.cmake" ]; then
echo Using LLVM from Conan
export LLVM_SETUP_VARIANT=Conan
else
echo Using LLVM from vcpkg
export LLVM_SETUP_VARIANT=Default
# Uncomment these lines below to build a debug version (will include release as well, due to vcpkg quirks)
# export LLVM_BUILD_TYPE=debug
# export VCPKG_KEEP_ENV_VARS=LLVM_BUILD_TYPE
# Install LLVM (takes a couple of hours and ~20GB of space)
./vcpkg install accera-llvm --overlay-ports=../llvm
fi
# Build the accera package
cd "$ACCERA_ROOT"
python setup.py build bdist_wheel
# Build the subpackages
cd "$ACCERA_ROOT/accera/python/compilers"
python setup.py build bdist_wheel -d "$ACCERA_ROOT/dist"
cd "$ACCERA_ROOT/accera/python/llvm"
python setup.py build bdist_wheel -d "$ACCERA_ROOT/dist"
cd "$ACCERA_ROOT/accera/python/gpu"
python setup.py build bdist_wheel -d "$ACCERA_ROOT/dist"
cd "$ACCERA_ROOT"
echo Complete. Packages are in the 'dist' folder.