-
Notifications
You must be signed in to change notification settings - Fork 49
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
Build fails on aarch64 linux #3
Comments
Uh.. This is a tough one as I don't have a computer with ARM64 processor. If Llama does not compile at all, then there's not much I can do as it is needed as a submodule. Thanks for testing. Would be nice to get this working on aarch64 too. |
using llama.cpp cmake thanks for making this though kuvaus! :) |
If basic llama builds using regular make, that's good news! I don't think I have any processor specific code outside llama so it should work in principle. So yeah, its the CmakeLists.txt file that needs to get fixed. I found this on the web:
The problem is that I use static linking (so that people can just copy their binary to another computer without worry) but that seems to cause problems. Now, you could try dynamic linking. Change these in the main CmakeLists.txt set(BUILD_SHARED_LIBS ON FORCE)
#elseif(UNIX)
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++ -static") Or somehow disable outline-atomics. Maybe like this: set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++ -static -mno-outline-atomics") At the moment I have no other ideas...
Thanks! |
Applying only your suggested changes, I was able to build successfully.
Salute! |
That is great! Which one of the changes did you make? Or did you have to have both? I want to add this in the CMakeLists.txt in the next version: IF(UNIX)
IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
//changes here
ENDIF()
ENDIF() So it would build automatically in the future. |
I applied both. |
Thanks! I put them in the CMakeLists.txt. I hope it now just builds without errors if you clone the repo. |
v0.2.0 comes with big changes:
Also updates during past few versions:
Big thanks to everyone so far! You have been hugely helpful. :) |
After cloning recursively I inspected the cmake config with ccmake ..
Not having intel cpu, I disabled all *AVX
`
`
then reconfigured and generated new cmake files.
cmake --build . --parallel 2>&1> errors.txt /usr/bin/ld: CMakeFiles/chat.dir/chat.cpp.o: in function
parse_json_string(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)':chat.cpp:(.text+0x555c): undefined reference to
__aarch64_ldadd4_acq_rel' /usr/bin/ld: chat.cpp:(.text+0x556c): undefined reference to
__aarch64_ldadd4_acq_rel'/usr/bin/ld: CMakeFiles/chat.dir/chat.cpp.o: in function
std::__future_base::_Deferred_state<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_M_complete_async()': chat.cpp:(.text._ZNSt13__future_base15_Deferred_stateINSt6thread8_InvokerISt5tupleIJPFvvEEEEEvE17_M_complete_asyncEv[_ZNSt13__future_base15_Deferred_stateINSt6thread8_InvokerISt5tupleIJPFvvEEEEEvE17_M_complete_asyncEv]+0xe8): undefined reference to
__aarch64_swp4_rel'/usr/bin/ld: CMakeFiles/chat.dir/chat.cpp.o: in function
std::__cxx11::basic_regex<char, std::__cxx11::regex_traits<char> >::~basic_regex()': chat.cpp:(.text._ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEED2Ev[_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEED5Ev]+0x9c): undefined reference to
__aarch64_ldadd4_acq_rel'/usr/bin/ld: chat.cpp:(.text._ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEED2Ev[_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEED5Ev]+0xac): undefined reference to
__aarch64_ldadd4_acq_rel' /usr/bin/ld: CMakeFiles/chat.dir/chat.cpp.o: in function
std::__basic_future::wait() const':chat.cpp:(.text._ZNKSt14__basic_futureIvE4waitEv[_ZNKSt14__basic_futureIvE4waitEv]+0x40): undefined reference to
__aarch64_ldset4_relax' /usr/bin/ld: CMakeFiles/chat.dir/chat.cpp.o: in function
std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()':chat.cpp:(.text._ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv[_ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv]+0x8c): undefined reference to
__aarch64_ldadd4_acq_rel' /usr/bin/ld: chat.cpp:(.text._ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv[_ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv]+0x9c): undefined reference to
__aarch64_ldadd4_acq_rel'/usr/bin/ld: CMakeFiles/chat.dir/chat.cpp.o: in function
std::future<std::__invoke_result<std::decay<void (&)()>::type>::type> std::async<void (&)()>(std::launch, void (&)())': chat.cpp:(.text._ZSt5asyncIRFvvEJEESt6futureINSt15__invoke_resultINSt5decayIT_E4typeEJDpNS4_IT0_E4typeEEE4typeEESt6launchOS5_DpOS8_[_ZSt5asyncIRFvvEJEESt6futureINSt15__invoke_resultINSt5decayIT_E4typeEJDpNS4_IT0_E4typeEEE4typeEESt6launchOS5_DpOS8_]+0xb0): undefined reference to
__aarch64_ldadd4_acq_rel'/usr/bin/ld: chat.cpp:(.text.ZSt5asyncIRFvvEJEESt6futureINSt15__invoke_resultINSt5decayIT_E4typeEJDpNS4_IT0_E4typeEEE4typeEESt6launchOS5_DpOS8[ZSt5asyncIRFvvEJEESt6futureINSt15__invoke_resultINSt5decayIT_E4typeEJDpNS4_IT0_E4typeEEE4typeEESt6launchOS5_DpOS8]+0x1ac): undefined reference to
__aarch64_swp1_acq_rel' /usr/bin/ld: chat.cpp:(.text._ZSt5asyncIRFvvEJEESt6futureINSt15__invoke_resultINSt5decayIT_E4typeEJDpNS4_IT0_E4typeEEE4typeEESt6launchOS5_DpOS8_[_ZSt5asyncIRFvvEJEESt6futureINSt15__invoke_resultINSt5decayIT_E4typeEJDpNS4_IT0_E4typeEEE4typeEESt6launchOS5_DpOS8_]+0x234): undefined reference to
__aarch64_ldadd4_acq_rel'/usr/bin/ld: chat.cpp:(.text.ZSt5asyncIRFvvEJEESt6futureINSt15__invoke_resultINSt5decayIT_E4typeEJDpNS4_IT0_E4typeEEE4typeEESt6launchOS5_DpOS8[ZSt5asyncIRFvvEJEESt6futureINSt15__invoke_resultINSt5decayIT_E4typeEJDpNS4_IT0_E4typeEEE4typeEESt6launchOS5_DpOS8]+0x244): undefined reference to
__aarch64_ldadd4_acq_rel' ...
If anyone has ideas for getting it built on aarch64, please share. Thanks!
The text was updated successfully, but these errors were encountered: