[GH-ISSUE #2260] Unable to rebuild Ollama due to llm/payload_linux.go:7:12: pattern llama.cpp/build/linux/*/*/lib/*.so*: no matching files found #27057

Closed
opened 2026-04-22 03:57:57 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @Solomin0 on GitHub (Jan 29, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2260

I am following the developer instructions.
Started by "git clone ollama"
I have go, cmake, and gcc.
I was able to sucessfully run "go generate ./"
"go build ." failed and gave me this error

root@9a44dfc68b7a:/workspace/a2/ollama# go build .
llm/payload_linux.go:7:12: pattern llama.cpp/build/linux/*/*/lib/*.so*: no matching files found
root@9a44dfc68b7a:/workspace/a2/ollama#

What do I need to change or what can I do? I have no experience with go so a point in the right direction to start would even be helpful.
My main goal is only to change the timeout function of ollama so if there is another way to do that please let me know.

Originally created by @Solomin0 on GitHub (Jan 29, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2260 I am following the developer instructions. Started by "git clone [ollama](https://github.com/ollama/ollama.git)" I have go, cmake, and gcc. I was able to sucessfully run "go generate ./" "go build ." failed and gave me this error ```root@9a44dfc68b7a:/workspace/a2/ollama# go generate ./ root@9a44dfc68b7a:/workspace/a2/ollama# go build . llm/payload_linux.go:7:12: pattern llama.cpp/build/linux/*/*/lib/*.so*: no matching files found root@9a44dfc68b7a:/workspace/a2/ollama# ``` What do I need to change or what can I do? I have no experience with go so a point in the right direction to start would even be helpful. My main goal is only to change the timeout function of ollama so if there is another way to do that please let me know.
Author
Owner

@remy415 commented on GitHub (Jan 31, 2024):

@Solomin0

From the ollama root folder:

go generate ./...
go build .

Please review the developers guide referenced on the Ollama README.md
https://github.com/ollama/ollama/blob/main/docs/development.md

Edit: I forgot the generate files clone the llama.cpp repo

<!-- gh-comment-id:1918169451 --> @remy415 commented on GitHub (Jan 31, 2024): @Solomin0 From the ollama root folder: ``` go generate ./... go build . ``` Please review the developers guide referenced on the Ollama README.md https://github.com/ollama/ollama/blob/main/docs/development.md Edit: I forgot the generate files clone the llama.cpp repo
Author
Owner

@jukofyork commented on GitHub (Jan 31, 2024):

It's possible you need to use a newer version of Go.

I'm running Debian 12 and the packaged Go was too old...

It's not hard to:

https://www.digitalocean.com/community/tutorials/how-to-install-go-on-debian-10

You just need to change to get the latest Go tar, etc. The guide isn't really Debian specific either as you can just installed it in your home folder, etc and then make sure the environment variables point to the downloaded version (or even symlink the Go binary).

<!-- gh-comment-id:1919127408 --> @jukofyork commented on GitHub (Jan 31, 2024): It's possible you need to use a newer version of Go. I'm running Debian 12 and the packaged Go was too old... It's not hard to: https://www.digitalocean.com/community/tutorials/how-to-install-go-on-debian-10 You just need to change to get the latest Go tar, etc. The guide isn't really Debian specific either as you can just installed it in your home folder, etc and then make sure the environment variables point to the downloaded version (or even symlink the Go binary).
Author
Owner

@jukofyork commented on GitHub (Jan 31, 2024):

One thing to add is that just using:

go generate ./...
go build .

and then copying or symlinking the new Ollama executable isn't enough to change the running Ollama and you need to be sure to restart the Ollama service - I spend 3 days trying to work out why none of the changes I was making when recompiling made any difference!

<!-- gh-comment-id:1919132232 --> @jukofyork commented on GitHub (Jan 31, 2024): One thing to add is that just using: ``` go generate ./... go build . ``` and then copying or symlinking the new Ollama executable isn't enough to change the running Ollama and you need to be sure to restart the Ollama service - I spend 3 days trying to work out why none of the changes I was making when recompiling made any difference!
Author
Owner

@remy415 commented on GitHub (Jan 31, 2024):

oh I need to read the op better, sorry about that.

Try running the clone on ollama again but include the recursive flag.

git clone --depth=1 --recursive https://github.com/ollama/ollama.git

Edit: I forgot how to read

<!-- gh-comment-id:1919134256 --> @remy415 commented on GitHub (Jan 31, 2024): oh I need to read the op better, sorry about that. Try running the clone on ollama again but include the recursive flag. git clone --depth=1 --recursive https://github.com/ollama/ollama.git Edit: I forgot how to read
Author
Owner

@jukofyork commented on GitHub (Jan 31, 2024):

That’s possible too, I’m just saying that particular error message is because the llama.cpp repo wasn’t cloned because either the recursive flag wasn’t used or go generate ./… wasn’t run. The go generate scripts will pull the llama.cpp repo and fix this error.

Ah sorry, you are correct - I'm typing in my phone and didn't see the long line that said lllama.cpp in it! :)

<!-- gh-comment-id:1919137636 --> @jukofyork commented on GitHub (Jan 31, 2024): > That’s possible too, I’m just saying that particular error message is because the llama.cpp repo wasn’t cloned because either the recursive flag wasn’t used or go generate ./… wasn’t run. The go generate scripts will pull the llama.cpp repo and fix this error. Ah sorry, you are correct - I'm typing in my phone and didn't see the long line that said lllama.cpp in it! :)
Author
Owner

@remy415 commented on GitHub (Jan 31, 2024):

I was able to sucessfully run "go generate ./"

Oh I missed this too. The command is
go generate ./…

you need to include the three dots “./…”

<!-- gh-comment-id:1919141341 --> @remy415 commented on GitHub (Jan 31, 2024): > I was able to sucessfully run "go generate ./" Oh I missed this too. The command is `go generate ./…` you need to include the three dots “./…”
Author
Owner

@remy415 commented on GitHub (Jan 31, 2024):

One thing to add is that just using:

go generate ./...
go build .

and then copying or symlinking the new Ollama executable isn't enough to change the running Ollama and you need to be sure to restart the Ollama service - I spend 3 days trying to work out why none of the changes I was making when recompiling made any difference!

Oh definitely make sure you shut down the service first and remove the old binary.

Also ensure you run “go clean” from the ollama directory if you’ve tried to build before to remove cached artifacts

<!-- gh-comment-id:1919144500 --> @remy415 commented on GitHub (Jan 31, 2024): > One thing to add is that just using: > > ``` > go generate ./... > go build . > ``` > > and then copying or symlinking the new Ollama executable isn't enough to change the running Ollama and you need to be sure to restart the Ollama service - I spend 3 days trying to work out why none of the changes I was making when recompiling made any difference! Oh definitely make sure you shut down the service first and remove the old binary. Also ensure you run “go clean” from the ollama directory if you’ve tried to build before to remove cached artifacts
Author
Owner

@bmizerany commented on GitHub (Mar 11, 2024):

@Solomin0 Looks like this issue is fixed in the latest release. Please let us know if you run into any other issues.

<!-- gh-comment-id:1989199136 --> @bmizerany commented on GitHub (Mar 11, 2024): @Solomin0 Looks like this issue is fixed in the latest release. Please let us know if you run into any other issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#27057