Skip to content

Commit

Permalink
llama : add required tools check in build-xcframework.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
danbev committed Feb 25, 2025
1 parent cc9b517 commit b4137c1
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion build-xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ GGML_METAL_EMBED_LIBRARY=ON
GGML_BLAS_DEFAULT=ON
GGML_METAL_USE_BF16=ON

check_required_tool() {
local tool=$1
local install_message=$2

if ! command -v $tool &> /dev/null; then
echo "Error: $tool is required but not found."
echo "$install_message"
exit 1
fi
}

echo "Checking for required tools..."
check_required_tool "cmake" "Please install CMake (brew install cmake)"
check_required_tool "xcodebuild" "Please install Xcode and Xcode Command Line Tools (xcode-select --install)"
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)"

set -xe

rm -rf build-apple
Expand Down Expand Up @@ -204,5 +220,5 @@ xcodebuild -create-xcframework \
-framework $(pwd)/build-visionos-sim/framework/llama.framework \
-output $(pwd)/build-apple/llama.xcframework

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

0 comments on commit b4137c1

Please sign in to comment.