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

Error while 'make build' #781

Closed
Rybens92 opened this issue Jul 20, 2023 · 3 comments
Closed

Error while 'make build' #781

Rybens92 opened this issue Jul 20, 2023 · 3 comments
Assignees
Labels
area/build bug Something isn't working os/gnu-Linux

Comments

@Rybens92
Copy link

LocalAI version:

commit: 71ac331

Environment, CPU architecture, OS, and Version:

Linux nobara-pc 6.3.12-204.fsync.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 10 07:16:03 UTC 2023 x86_64 GNU/Linux

Describe the bug

Error while building LocalAI from newest commit to date.
As long as I see there's problem with coping some files needed for linking program(?)

To Reproduce

git clone https://github.com/go-skynet/LocalAI.git
cd LocalAI
make build

Expected behavior

program should finish building without any errors

Logs

[ 96%] Building CXX object CMakeFiles/llmodel.dir/llmodel.cpp.o
/usr/bin/c++ -DLIB_FILE_EXT=\".so\" -Dllmodel_EXPORTS -I/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/buildllm -O3 -DNDEBUG -std=gnu++20 -fPIC -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -MD -MT CMakeFiles/llmodel.dir/llmodel.cpp.o -MF CMakeFiles/llmodel.dir/llmodel.cpp.o.d -o CMakeFiles/llmodel.dir/llmodel.cpp.o -c /mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-backend/llmodel.cpp
[ 97%] Building CXX object CMakeFiles/llmodel.dir/llmodel_shared.cpp.o
/usr/bin/c++ -DLIB_FILE_EXT=\".so\" -Dllmodel_EXPORTS -I/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/buildllm -O3 -DNDEBUG -std=gnu++20 -fPIC -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -MD -MT CMakeFiles/llmodel.dir/llmodel_shared.cpp.o -MF CMakeFiles/llmodel.dir/llmodel_shared.cpp.o.d -o CMakeFiles/llmodel.dir/llmodel_shared.cpp.o -c /mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-backend/llmodel_shared.cpp
[ 98%] Building CXX object CMakeFiles/llmodel.dir/llmodel_c.cpp.o
/usr/bin/c++ -DLIB_FILE_EXT=\".so\" -Dllmodel_EXPORTS -I/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/buildllm -O3 -DNDEBUG -std=gnu++20 -fPIC -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -MD -MT CMakeFiles/llmodel.dir/llmodel_c.cpp.o -MF CMakeFiles/llmodel.dir/llmodel_c.cpp.o.d -o CMakeFiles/llmodel.dir/llmodel_c.cpp.o -c /mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-backend/llmodel_c.cpp
[100%] Linking CXX shared library libllmodel.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/llmodel.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O3 -DNDEBUG -shared -Wl,-soname,libllmodel.so.0 -o libllmodel.so.0.3.0 CMakeFiles/llmodel.dir/llmodel.cpp.o CMakeFiles/llmodel.dir/llmodel_shared.cpp.o CMakeFiles/llmodel.dir/llmodel_c.cpp.o 
/usr/bin/cmake -E cmake_symlink_library libllmodel.so.0.3.0 libllmodel.so.0 libllmodel.so
make[4]: Opuszczenie katalogu '/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/buildllm'
[100%] Built target llmodel
make[3]: Opuszczenie katalogu '/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/buildllm'
/usr/bin/cmake -E cmake_progress_start /mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/buildllm/CMakeFiles 0
make[2]: Opuszczenie katalogu '/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/buildllm'
cd buildllm && cp -rf CMakeFiles/llmodel.dir/llmodel_c.cpp.o ../llmodel_c.o
cd buildllm && cp -rf CMakeFiles/llmodel.dir/llmodel.cpp.o ../llmodel.o
ar src libgpt4all.a llmodel.o binding.o
make[1]: Opuszczenie katalogu '/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang'
mkdir -p backend-assets/gpt4all
cp: nie można wykonać stat na 'gpt4all/gpt4all-bindings/golang/buildllm/*.dylib': Nie ma takiego pliku ani katalogu
cp: nie można wykonać stat na 'gpt4all/gpt4all-bindings/golang/buildllm/*.dll': Nie ma takiego pliku ani katalogu
CGO_LDFLAGS="" C_INCLUDE_PATH=/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/ LIBRARY_PATH=/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/ \
go build -ldflags "-X "github.com/go-skynet/LocalAI/internal.Version=v1.21.0-10-g71ac331" -X "github.com/go-skynet/LocalAI/internal.Commit=71ac331f90d73bed0b90d83fd7bddc294c63bad2"" -tags "" -o backend-assets/grpc/gpt4all ./cmd/grpc/gpt4all/
# github.com/go-skynet/LocalAI/cmd/grpc/gpt4all
/usr/lib/golang/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/usr/bin/ld: /tmp/go-link-2929386047/000002.o: in function `llmodel_model_create2':
/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/../../gpt4all-backend/llmodel_c.cpp:32: undefined reference to `LLModel::construct(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/usr/bin/ld: /tmp/go-link-2929386047/000002.o: in function `llmodel_set_implementation_search_path':
/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/../../gpt4all-backend/llmodel_c.cpp:183: undefined reference to `LLModel::setImplementationsSearchPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /tmp/go-link-2929386047/000002.o: in function `llmodel_get_implementation_search_path':
/mnt/linux/AI/TuxMate/LocalAI/gpt4all/gpt4all-bindings/golang/../../gpt4all-backend/llmodel_c.cpp:188: undefined reference to `LLModel::implementationsSearchPath[abi:cxx11]()'
collect2: error: ld returned 1 exit status

make: *** [Makefile:379: backend-assets/grpc/gpt4all] Błąd 1

Additional context

@Rybens92 Rybens92 added the bug Something isn't working label Jul 20, 2023
@localai-bot
Copy link
Contributor

⚠️⚠️⚠️⚠️⚠️

Hi! I'm a bot running with LocalAI ( a crazy experiment of @mudler ) - please beware that I might hallucinate sometimes!

but.... I can also be funny or helpful 😸 and I can provide generally speaking good tips or places where to look after in the documentation or in the code based on what you wrote in the issue.

Don't engage in conversation with me,
I don't support (yet) replying!

⚠️⚠️⚠️⚠️⚠️

It seems like there is a issue with the LLModel implementation in the gpt4all-bindings/golang project. The error message indicates that there are undefined references to functions in the LLModel class, which suggests that the implementation of this class might be missing or incomplete.
To troubleshoot this issue, you can try the following steps:

  1. Check if the LLModel implementation is present in the gpt4all-bindings/golang project. If it is not, you might need to add the missing code or files to the project.
  2. Ensure that the LLModel class is properly defined and implemented in the gpt4all-bindings/golang project. You can check the source code for this project to verify that the class is defined correctly and that all necessary functions are implemented.
  3. Check if there are any missing dependencies or libraries that might be causing the issue. Ensure that all required dependencies are installed and linked properly in the project.
  4. If the issue persists, you can try rebuilding the project from scratch to ensure that all files and dependencies are correctly set up.

Sources:

@Aisuko
Copy link
Collaborator

Aisuko commented Jul 22, 2023

Hi, @Rybens92 thanks for your feedback. Have you tried to make clean all the bounding projects and make rebuild?

/usr/lib/golang/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
This error commonly occurs when the linker cannot find the necessary libraries or object files required for the compilation. So, please try the commands I show you above.

@Rybens92
Copy link
Author

@Aisuko Thank you for your reply. I already came to the solution before, indeed make clean helped. Although it was strange as I tried make build right after cloning the repo. The thread is suitable for closing. Thank you once again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build bug Something isn't working os/gnu-Linux
Projects
None yet
Development

No branches or pull requests

4 participants