mudler / LocalAI

:robot: The free, Open Source OpenAI alternative. Self-hosted, community-driven and local-first. Drop-in replacement for OpenAI running on consumer-grade hardware. No GPU required. Runs gguf, transformers, diffusers and many more models architectures. It allows to generate Text, Audio, Video, Images. Also with voice cloning capabilities.
https://localai.io
MIT License
21.75k stars 1.66k forks source link

Can't build from sources #1581

Closed mike-niemand closed 5 months ago

mike-niemand commented 5 months ago

Hi mudler,

Makefile 255 $(GOCMD) mod edit -replace github.com/nomic-ai/gpt4all/gpt4all-bindings/golang=$(CURDIR)/sources/gpt4all/gpt4all-bindings/golang

is 404

dionysius commented 5 months ago

Please provide more info about your environment, especially defined in the bug report template: https://github.com/mudler/LocalAI/blame/master/.github/ISSUE_TEMPLATE/bug_report.md

mike-niemand commented 5 months ago

Apologies:

v2.5.1

Ubuntu 22.04

Describe the bug Line 22 go.mod requires github.com/nomic-ai/gpt4all/gpt4all-bindings/golang

https://github.com/nomic-ai/gpt4all/gpt4all-bindings/golang

This is 404

To Reproduce Try and build from sources

dionysius commented 5 months ago

Line 22 go.mod requires github.com/nomic-ai/gpt4all/gpt4all-bindings/golang

Should get a rewrite directive in https://github.com/mudler/LocalAI/blob/v2.5.1/Makefile#L255. Something went wrong with the directive or the sources download

https://github.com/nomic-ai/gpt4all/gpt4all-bindings/golang

This is 404

Github adds the tree after the project name, the correct URL to check existence is https://github.com/nomic-ai/gpt4all/tree/main/gpt4all-bindings/golang. Golang is aware of that using go-get mechanism.

To Reproduce Try and build from sources

Please correctly clean your local copy of this repo and try again:

$ cd <yourLocalAIrepo>
$ git reset --hard && make clean && git clean -fdx
$ git checkout v2.5.1
$ make prepare-sources
$ go mod download -x

If above succeeds, issue is resolved and you can continue to make build

Otherwise post the results and please also provide:

Please use quoting blocks (triple backticks ```) for your output

mike-niemand commented 5 months ago

Thanks so much for your response. I got past that issue but am now faced with:

# google.golang.org/grpc /root/go/pkg/mod/google.golang.org/grpc@v1.59.0/server.go:2082:14: undefined: atomic.Int64 note: module requires Go 1.19

I'm running 1.21.6. I'll try revert to an older version.

dionysius commented 5 months ago

go 1.21 should be fine, there must be something else off in your go installation

mike-niemand commented 5 months ago

Thanks dionysius,

I spun up a complete new instance of Ubuntu 22.04 and installed go and ran:

apt install protobuf-compiler-grpc libgrpc-dev make cmake

Then tried make build.

This resulted in: https://github.com/mudler/LocalAI/issues/1579

I then spun up a new instance of Debian 12 and went through the process to end up with the same issue again:

go mod edit -replace github.com/nomic-ai/gpt4all/gpt4all-bindings/golang=/usr/local/apps/LocalAI/sources/gpt4all/gpt4all-bindings/golang make: go: No such file or directory make: *** [Makefile:255: replace] Error 127

dionysius commented 5 months ago

go: No such file or directory

means golang is not installed. Please follow the instructions for local build: https://localai.io/basics/build/index.html#locally

and apt install golang. (seems to be missing there)

Please convert this issue to a discussion (if possible). The issue is not related to localai so far.

mike-niemand commented 5 months ago

This is what it was. Thanks!!!