-
-
Notifications
You must be signed in to change notification settings - Fork 930
Expand file tree
/
Copy pathbuild-cpu.sh
More file actions
22 lines (18 loc) · 618 Bytes
/
Copy pathbuild-cpu.sh
File metadata and controls
22 lines (18 loc) · 618 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -xeuo pipefail
: "${RUNNER_OS:?RUNNER_OS must be set (Linux/Windows/macOS)}"
: "${RUNNER_ARCH:?RUNNER_ARCH must be set (X64/ARM64)}"
if [[ "${RUNNER_OS}" == "Windows" ]]; then
pip install cmake==3.30.9
else
pip install cmake==3.28.3
fi
if [ "${RUNNER_OS}" == "macOS" ] && [ "${RUNNER_ARCH}" == "ARM64" ]; then
cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCOMPUTE_BACKEND=cpu .
else
cmake -DCOMPUTE_BACKEND=cpu .
fi
cmake --build . --config Release
output_dir="output/${RUNNER_OS}/${RUNNER_ARCH}"
mkdir -p "${output_dir}"
(shopt -s nullglob && cp bitsandbytes/*.{so,dylib,dll} "${output_dir}")