Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation problems on MacOS #4300

Open
jasonkaplan79 opened this issue Dec 1, 2024 · 3 comments
Open

Installation problems on MacOS #4300

jasonkaplan79 opened this issue Dec 1, 2024 · 3 comments
Labels
bug Something isn't working unconfirmed

Comments

@jasonkaplan79
Copy link

I am trying to install this on my Mac. Here are my constraints:

  • Hardware: Macbook Pro, Apple M2 Max running MacOS Sonoma (CPU, no GPU)
  • I do not want to use Docker or any Virtual Machines

followed just these steps: https://localai.io/basics/build/index.html#example-build-on-mac:

  1. brew install abseil cmake go grpc protobuf protoc-gen-go protoc-gen-go-grpc python wget
  2. pip install --user grpcio-tools (or pip3 install --user grpcio-tools)
  3. Git clone https://github.com/mudler/LocalAI
  4. cd LocalAI
  5. make build
  6. make build fails:
  • brew install libomp
  • brew install gcc
  • export CC=gcc
  • export CXX=g++
  1. Reran: make build, and it still failed with this output:
[100%] Linking CXX executable ../../bin/grpc-server
ld: warning: ignoring duplicate libraries: '../../common/libcommon.a', '../../src/libllama.a'
[100%] Built target grpc-server
[ 66%] Built target ggml-base
[100%] Built target ggml-metal
cp llama.cpp/build/bin/grpc-server .
cp -rfv backend/cpp/llama-fallback/grpc-server backend-assets/grpc/llama-cpp-fallback
backend/cpp/llama-fallback/grpc-server -> backend-assets/grpc/llama-cpp-fallback
CGO_LDFLAGS=" -framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders" C_INCLUDE_PATH=/Users/jason/Code/ai/LocalAI/sources/go-llama.cpp LIBRARY_PATH=/Users/jason/Code/ai/LocalAI/sources/go-llama.cpp \
	go build -ldflags "-s -w -X "github.com/mudler/LocalAI/internal.Version=v2.23.0-136-g9c9359fc" -X "github.com/mudler/LocalAI/internal.Commit=9c9359fc9662648800b5d76c9f123f8b32b1e54e"" -tags "" -o backend-assets/grpc/llama-ggml ./backend/go/llm/llama-ggml/
# github.com/go-skynet/go-llama.cpp
binding.cpp:613:5: warning: deleting pointer to incomplete type 'llama_model' may cause undefined behavior [-Wdelete-incomplete]
sources/go-llama.cpp/llama.cpp/llama.h:70:12: note: forward declaration of 'llama_model'
# github.com/mudler/LocalAI/backend/go/llm/llama-ggml
ld: warning: ignoring duplicate libraries: '-lc++'
CGO_LDFLAGS=" -framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders  -lggml" C_INCLUDE_PATH="/Users/jason/Code/ai/LocalAI/sources/whisper.cpp/include:/Users/jason/Code/ai/LocalAI/sources/whisper.cpp/ggml/include" LIBRARY_PATH=/Users/jason/Code/ai/LocalAI/sources/whisper.cpp \
	go build -ldflags "-s -w -X "github.com/mudler/LocalAI/internal.Version=v2.23.0-136-g9c9359fc" -X "github.com/mudler/LocalAI/internal.Commit=9c9359fc9662648800b5d76c9f123f8b32b1e54e"" -tags "" -o backend-assets/grpc/whisper ./backend/go/transcribe/whisper
# github.com/mudler/LocalAI/backend/go/transcribe/whisper
/opt/homebrew/Cellar/go/1.23.3/libexec/pkg/tool/darwin_arm64/link: running gcc failed: exit status 1
/usr/bin/gcc -arch arm64 -Wl,-S -Wl,-x -o $WORK/b001/exe/a.out /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/go.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000000.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000001.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000002.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000003.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000004.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000005.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000006.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000007.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000008.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000009.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000010.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000011.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000012.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000013.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000014.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000015.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000016.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000017.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000018.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000019.o /var/folders/29/4v06_6lx71s9bqycx42mlkf80000gn/T/go-link-4002305325/000020.o -lresolv -framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders -lggml -lwhisper -lm -lstdc++ -fopenmp -framework Accelerate -framework Metal -framework Foundation -framework CoreGraphics -framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders -lggml -framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders -lggml -framework CoreFoundation -framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders -lggml -framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders -lggml -framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders -lggml -framework CoreFoundation -framework IOKit -framework CoreFoundation -framework Security
clang: error: unsupported option '-fopenmp'

make: *** [backend-assets/grpc/whisper] Error 1
@jasonkaplan79 jasonkaplan79 added bug Something isn't working unconfirmed labels Dec 1, 2024
@nonlinear
Copy link

I'm running the same issue, "[backend-assets/grpc/whisper] Error 1". I'm also on a mac (mac mini m4). I don't know what to make of it.

@ring2003
Copy link

ring2003 commented Dec 8, 2024

Same problem here. I solve this by:

brew install llvm
brew install lld
make build

https://stackoverflow.com/questions/43555410/enable-openmp-support-in-clang-in-mac-os-x-sierra-mojave

@xrce
Copy link

xrce commented Dec 18, 2024

Same problem here. I solve this by:

brew install llvm
brew install lld
make build

https://stackoverflow.com/questions/43555410/enable-openmp-support-in-clang-in-mac-os-x-sierra-mojave

Still error, you need to export CC and CXX after that:

export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++

https://stackoverflow.com/a/60043467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
None yet
Development

No branches or pull requests

4 participants