[PR #1982] [MERGED] Fix intel mac build #10746

Closed
opened 2026-04-12 23:09:27 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/1982
Author: @dhiltgen
Created: 1/13/2024
Status: Merged
Merged: 1/14/2024
Merged by: @dhiltgen

Base: mainHead: fix_intel_mac


📝 Commits (1)

📊 Changes

2 files changed (+4 additions, -1 deletions)

View changed files

📝 llm/dyn_ext_server.go (+1 -1)
📝 llm/generate/gen_darwin.sh (+3 -0)

📄 Description

Make sure we're building an x86 ext_server lib when cross-compiling

Prior to this fix, running the cross-compiled binary on an intel mac produced the following error:

2024/01/13 14:38:47 llm.go:66: not enough vram available, falling back to CPU only
2024/01/13 14:38:47 cpu_common.go:15: CPU has AVX
2024/01/13 14:38:47 dyn_ext_server.go:384: Updating LD_LIBRARY_PATH to /var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal:
loading /var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal/libext_server.so library
2024/01/13 14:38:47 llm.go:151: Failed to load dynamic library /var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal/libext_server.so  Unable to load dynamic library: Unable to load dynamic server library: dlopen(/var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal/libext_server.so, 2): no suitable image found.  Did find:
	/var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal/libext_server.so: mach-o, but wrong architecture
	/var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal/libext_server.so: stat() failed with errno=4
[GIN] 2024/01/13 - 14:38:47 | 500 |  416.860287ms |       127.0.0.1 | POST     "/api/chat"

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/1982 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 1/13/2024 **Status:** ✅ Merged **Merged:** 1/14/2024 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `fix_intel_mac` --- ### 📝 Commits (1) - [`2ecb247`](https://github.com/ollama/ollama/commit/2ecb2472769ba0bb364aeeb109659750ad8153ce) Fix intel mac build ### 📊 Changes **2 files changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `llm/dyn_ext_server.go` (+1 -1) 📝 `llm/generate/gen_darwin.sh` (+3 -0) </details> ### 📄 Description Make sure we're building an x86 ext_server lib when cross-compiling Prior to this fix, running the cross-compiled binary on an intel mac produced the following error: ``` 2024/01/13 14:38:47 llm.go:66: not enough vram available, falling back to CPU only 2024/01/13 14:38:47 cpu_common.go:15: CPU has AVX 2024/01/13 14:38:47 dyn_ext_server.go:384: Updating LD_LIBRARY_PATH to /var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal: loading /var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal/libext_server.so library 2024/01/13 14:38:47 llm.go:151: Failed to load dynamic library /var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal/libext_server.so Unable to load dynamic library: Unable to load dynamic server library: dlopen(/var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal/libext_server.so, 2): no suitable image found. Did find: /var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal/libext_server.so: mach-o, but wrong architecture /var/folders/z8/jy4xc40953n1tfs96m6gnzkr0000gn/T/ollama2093980092/metal/libext_server.so: stat() failed with errno=4 [GIN] 2024/01/13 - 14:38:47 | 500 | 416.860287ms | 127.0.0.1 | POST "/api/chat" ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-12 23:09:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#10746