Skip to content

Commit b4137c1

Browse files
committed
llama : add required tools check in build-xcframework.sh
1 parent cc9b517 commit b4137c1

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

build-xcframework.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ GGML_METAL_EMBED_LIBRARY=ON
1414
GGML_BLAS_DEFAULT=ON
1515
GGML_METAL_USE_BF16=ON
1616

17+
check_required_tool() {
18+
local tool=$1
19+
local install_message=$2
20+
21+
if ! command -v $tool &> /dev/null; then
22+
echo "Error: $tool is required but not found."
23+
echo "$install_message"
24+
exit 1
25+
fi
26+
}
27+
28+
echo "Checking for required tools..."
29+
check_required_tool "cmake" "Please install CMake (brew install cmake)"
30+
check_required_tool "xcodebuild" "Please install Xcode and Xcode Command Line Tools (xcode-select --install)"
31+
check_required_tool "libtool" "Please install libtool which should be available with Xcode Command Line Tools (CLT). Make sure Xcode CLT is installed (xcode-select --install)"
32+
1733
set -xe
1834

1935
rm -rf build-apple
@@ -204,5 +220,5 @@ xcodebuild -create-xcframework \
204220
-framework $(pwd)/build-visionos-sim/framework/llama.framework \
205221
-output $(pwd)/build-apple/llama.xcframework
206222

207-
# The generated framework can be found in build-ios/llama.xcframework and
223+
# The generated framework can be found in build-apple/llama.xcframework and
208224
# can be added to a projects "Frameworks, Libraries, and Embedded Content"

0 commit comments

Comments
 (0)