Chinese-LLaMA-Alpaca icon indicating copy to clipboard operation
Chinese-LLaMA-Alpaca copied to clipboard

本地快速部署-make编译报错

Open liutao841204 opened this issue 2 years ago • 4 comments

环境:centos7 amd64 资源:32C+64G 硬盘:200G python版本:3.11.3 gcc版本:11.3.0 make版本:3.82 cmake版本:3.26.3

Step 1: 克隆和编译llama.cpp 运行以下命令对llama.cpp项目进行编译,生成./main和./quantize二进制文件。 git clone https://github.com/ggerganov/llama.cpp cd llama.cpp 执行make时,报错:

llama.cpp:(.text.ZNSt6vectorIdSaIdEE17_M_realloc_insertIJRKdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT[ZNSt6vectorIdSaIdEE17_M_realloc_insertIJRKdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT]+0x143):对‘std::__throw_length_error(char const*)’未定义的引用 llama.o:在函数‘std::discrete_distribution::param_type::_M_initialize()’中: llama.cpp:(.text._ZNSt21discrete_distributionIiE10param_type13_M_initializeEv[_ZNSt21discrete_distributionIiE10param_type13_M_initializeEv]+0x189):对‘operator new(unsigned long)’未定义的引用 llama.cpp:(.text._ZNSt21discrete_distributionIiE10param_type13_M_initializeEv[_ZNSt21discrete_distributionIiE10param_type13_M_initializeEv]+0x2bf):对‘operator delete(void*)’未定义的引用 llama.cpp:(.text._ZNSt21discrete_distributionIiE10param_type13_M_initializeEv[_ZNSt21discrete_distributionIiE10param_type13_M_initializeEv]+0x320):对‘std::__throw_length_error(char const*)’未定义的引用 llama.o:(.data.rel.ro._ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x0):对‘vtable for __cxxabiv1::__class_type_info’未定义的引用 common.o:在函数‘int __gnu_cxx::__stoa<long, int, char, int>(long ()(char const, char**, int), char const*, char const*, unsigned long*, int) [clone .constprop.0]’中: common.cpp:(.text+0x62):对‘std::__throw_out_of_range(char const*)’未定义的引用 common.cpp:(.text+0x6e):对‘std::__throw_invalid_argument(char const*)’未定义的引用 common.o:在函数‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&) [clone .constprop.0]’中: common.cpp:(.text+0x12b):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)’未定义的引用 common.cpp:(.text+0x15e):对‘std::__throw_logic_error(char const*)’未定义的引用 common.o:在函数‘gpt_random_prompt[abi:cxx11](std::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul>&)’中: common.cpp:(.text+0x6bc):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)’未定义的引用 common.o:在函数‘llama_tokenize(llama_context*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool)’中: common.cpp:(.text+0x8aa):对‘operator new(unsigned long)’未定义的引用 common.cpp:(.text+0x9b2):对‘std::__throw_length_error(char const*)’未定义的引用 common.o:在函数‘gpt_params_parse(int, char**, gpt_params&)’中: common.cpp:(.text+0xa0a):对‘std::ios_base::ios_base()’未定义的引用 common.cpp:(.text+0xa11):对‘vtable for std::basic_ios<char, std::char_traits >’未定义的引用 common.cpp:(.text+0xa26):对‘VTT for std::basic_ifstream<char, std::char_traits >’未定义的引用 common.cpp:(.text+0xa8d):对‘std::basic_ios<char, std::char_traits >::init(std::basic_streambuf<char, std::char_traits >)’未定义的引用 common.cpp:(.text+0xa94):对‘vtable for std::basic_ifstream<char, std::char_traits >’未定义的引用 common.cpp:(.text+0xaaf):对‘vtable for std::basic_ifstream<char, std::char_traits >’未定义的引用 common.cpp:(.text+0xac8):对‘std::basic_filebuf<char, std::char_traits >::basic_filebuf()’未定义的引用 common.cpp:(.text+0xad3):对‘std::basic_ios<char, std::char_traits >::init(std::basic_streambuf<char, std::char_traits >)’未定义的引用 common.cpp:(.text+0xae7):对‘std::basic_filebuf<char, std::char_traits >::open(char const*, std::_Ios_Openmode)’未定义的引用 common.cpp:(.text+0xb06):对‘std::basic_ios<char, std::char_traits >::clear(std::_Ios_Iostate)’未定义的引用 common.cpp:(.text+0xbd9):对‘std::basic_istream<char, std::char_traits >& std::operator>><char, std::char_traits, std::allocator >(std::basic_istream<char, std::char_traits >&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&)’未定义的引用 common.cpp:(.text+0xde3):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0xe01):对‘std::basic_istream<char, std::char_traits >& std::operator>><char, std::char_traits, std::allocator >(std::basic_istream<char, std::char_traits >&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&)’未定义的引用 common.cpp:(.text+0xe4c):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0xe5e):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0xe7e):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0xe92):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0xea6):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0xeef):对‘std::thread::hardware_concurrency()’未定义的引用 common.cpp:(.text+0xf94):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)’未定义的引用 common.cpp:(.text+0x11c0):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0x1210):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)’未定义的引用 common.cpp:(.text+0x121f):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x123b):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x1257):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x13af):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0x13c9):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0x13dd):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0x13f1):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0x1405):对‘operator delete(void*)’未定义的引用 common.o:common.cpp:(.text+0x1419): 跟着更多未定义的参考到 operator delete(void*) common.o:在函数‘gpt_params_parse(int, char**, gpt_params&)’中: common.cpp:(.text+0x1420):对‘vtable for std::basic_ifstream<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x1438):对‘vtable for std::basic_ifstream<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x144b):对‘vtable for std::basic_filebuf<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x145c):对‘std::basic_filebuf<char, std::char_traits >::close()’未定义的引用 common.cpp:(.text+0x1469):对‘std::__basic_file::~__basic_file()’未定义的引用 common.cpp:(.text+0x1470):对‘vtable for std::basic_streambuf<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x1489):对‘std::locale::~locale()’未定义的引用 common.cpp:(.text+0x14b3):对‘vtable for std::basic_ios<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x14d0):对‘std::ios_base::~ios_base()’未定义的引用 common.cpp:(.text+0x154b):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)’未定义的引用 common.cpp:(.text+0x15ee):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0x162b):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)’未定义的引用 common.cpp:(.text+0x1698):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x16b4):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x16fc):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)’未定义的引用 common.cpp:(.text+0x174b):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)’未定义的引用 common.cpp:(.text+0x1813):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)’未定义的引用 common.cpp:(.text+0x1859):对‘std::thread::hardware_concurrency()’未定义的引用 common.cpp:(.text+0x188b):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)’未定义的引用 common.cpp:(.text+0x18d7):对‘std::basic_ios<char, std::char_traits >::clear(std::_Ios_Iostate)’未定义的引用 common.cpp:(.text+0x18f0):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x190c):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x194b):对‘std::ios_base::ios_base()’未定义的引用 common.cpp:(.text+0x1952):对‘vtable for std::basic_ios<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x19c7):对‘std::basic_ios<char, std::char_traits >::init(std::basic_streambuf<char, std::char_traits >)’未定义的引用 common.cpp:(.text+0x19ce):对‘vtable for std::basic_ifstream<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x19f6):对‘std::basic_filebuf<char, std::char_traits >::basic_filebuf()’未定义的引用 common.cpp:(.text+0x1a03):对‘std::basic_ios<char, std::char_traits >::init(std::basic_streambuf<char, std::char_traits >)’未定义的引用 common.cpp:(.text+0x1a13):对‘std::basic_filebuf<char, std::char_traits >::open(char const*, std::_Ios_Openmode)’未定义的引用 common.cpp:(.text+0x1a32):对‘std::basic_ios<char, std::char_traits >::clear(std::_Ios_Iostate)’未定义的引用 common.cpp:(.text+0x1b02):对‘vtable for std::basic_ifstream<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x1b18):对‘vtable for std::basic_ifstream<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x1b2b):对‘vtable for std::basic_filebuf<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x1b3c):对‘std::basic_filebuf<char, std::char_traits >::close()’未定义的引用 common.cpp:(.text+0x1b49):对‘std::__basic_file::~__basic_file()’未定义的引用 common.cpp:(.text+0x1b50):对‘vtable for std::basic_streambuf<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x1b69):对‘std::locale::~locale()’未定义的引用 common.cpp:(.text+0x1b93):对‘vtable for std::basic_ios<char, std::char_traits >’未定义的引用 common.cpp:(.text+0x1bb0):对‘std::ios_base::~ios_base()’未定义的引用 common.cpp:(.text+0x1bcc):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long)’未定义的引用 common.cpp:(.text+0x1bfe):对‘std::__throw_out_of_range(char const*)’未定义的引用 common.cpp:(.text+0x1c12):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x1c2e):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x1d4c):对‘std::__throw_invalid_argument(char const*)’未定义的引用 common.cpp:(.text+0x1d57):对‘std::basic_ios<char, std::char_traits >::clear(std::_Ios_Iostate)’未定义的引用 common.cpp:(.text+0x1d6b):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_erase(unsigned long, unsigned long)’未定义的引用 common.cpp:(.text+0x1dc8):对‘std::__throw_logic_error(char const*)’未定义的引用 common.cpp:(.text+0x1dd4):对‘std::__throw_out_of_range(char const*)’未定义的引用 common.cpp:(.text+0x1dfa):对‘std::basic_ifstream<char, std::char_traits >::~basic_ifstream()’未定义的引用 common.cpp:(.text+0x1e0b):对‘std::__throw_out_of_range(char const*)’未定义的引用 common.cpp:(.text+0x1e20):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x1e3c):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x1eab):对‘std::__throw_logic_error(char const*)’未定义的引用 common.cpp:(.text+0x1eb7):对‘std::__throw_logic_error(char const*)’未定义的引用 common.cpp:(.text+0x1ed6):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)’未定义的引用 common.cpp:(.text+0x1f1d):对‘std::__throw_logic_error(char const*)’未定义的引用 common.cpp:(.text+0x1f29):对‘std::__throw_logic_error(char const*)’未定义的引用 common.cpp:(.text+0x1f55):对‘std::__throw_invalid_argument(char const*)’未定义的引用 common.cpp:(.text+0x1f61):对‘std::__throw_invalid_argument(char const*)’未定义的引用 common.cpp:(.text+0x1fbe):对‘std::__throw_logic_error(char const*)’未定义的引用 common.cpp:(.text+0x1fd2):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x2045):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x205d):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x2086):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x210b):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.o:common.cpp:(.text+0x2190): 跟着更多未定义的参考到 std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const common.o:在函数‘gpt_params_parse(int, char**, gpt_params&)’中: common.cpp:(.text+0x22e3):对‘operator delete(void*)’未定义的引用 common.cpp:(.text+0x2318):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x2334):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x23a7):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x23f0):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.cpp:(.text+0x2408):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const’未定义的引用 common.o:common.cpp:(.text+0x2431): 跟着更多未定义的参考到 std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const common.o:在函数‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::assign(char const*) [clone .isra.0]’中: common.cpp:(.text+0xac):对‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)’未定义的引用 common.o:在函数‘llama_tokenize(llama_context*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool) [clone .cold]’中: common.cpp:(.text.unlikely+0x1d):对‘operator delete(void*)’未定义的引用 common.o:在函数‘gpt_params_parse(int, char**, gpt_params&) [clone .cold]’中: common.cpp:(.text.unlikely+0x47):对‘operator delete(void*)’未定义的引用 common.cpp:(.text.unlikely+0x72):对‘operator delete(void*)’未定义的引用 common.cpp:(.text.unlikely+0xb3):对‘operator delete(void*)’未定义的引用 common.cpp:(.text.unlikely+0xc7):对‘operator delete(void*)’未定义的引用 common.o:common.cpp:(.text.unlikely+0xdb): 跟着更多未定义的参考到 operator delete(void*) common.o:在函数‘gpt_params_parse(int, char**, gpt_params&) [clone .cold]’中: common.cpp:(.text.unlikely+0xe5):对‘std::basic_ifstream<char, std::char_traits >::~basic_ifstream()’未定义的引用 common.cpp:(.text.unlikely+0xff):对‘operator delete(void*)’未定义的引用 common.cpp:(.text.unlikely+0x113):对‘operator delete(void*)’未定义的引用 common.cpp:(.text.unlikely+0x127):对‘operator delete(void*)’未定义的引用 common.cpp:(.text.unlikely+0x13b):对‘operator delete(void*)’未定义的引用 common.cpp:(.text.unlikely+0x172):对‘operator delete(void*)’未定义的引用 common.o:common.cpp:(.text.unlikely+0x184): 跟着更多未定义的参考到 operator delete(void*) common.o:在函数‘gpt_params_parse(int, char**, gpt_params&) [clone .cold]’中: common.cpp:(.text.unlikely+0x1ac):对‘__cxa_begin_catch’未定义的引用 common.cpp:(.text.unlikely+0x1b1):对‘__cxa_end_catch’未定义的引用 common.cpp:(.text.unlikely+0x1c3):对‘std::basic_filebuf<char, std::char_traits >::~basic_filebuf()’未定义的引用 common.cpp:(.text.unlikely+0x1f7):对‘vtable for std::basic_ios<char, std::char_traits >’未定义的引用 common.cpp:(.text.unlikely+0x20d):对‘std::ios_base::~ios_base()’未定义的引用 common.cpp:(.text.unlikely+0x220):对‘std::basic_filebuf<char, std::char_traits >::~basic_filebuf()’未定义的引用 common.cpp:(.text.unlikely+0x251):对‘vtable for std::basic_ios<char, std::char_traits >’未定义的引用 common.cpp:(.text.unlikely+0x267):对‘std::ios_base::~ios_base()’未定义的引用 common.cpp:(.text.unlikely+0x281):对‘std::basic_ifstream<char, std::char_traits >::~basic_ifstream()’未定义的引用 common.cpp:(.text.unlikely+0x28e):对‘__cxa_begin_catch’未定义的引用 common.cpp:(.text.unlikely+0x293):对‘__cxa_end_catch’未定义的引用 common.cpp:(.text.unlikely+0x2b5):对‘operator delete(void*)’未定义的引用 common.o:在函数‘float __gnu_cxx::__stoa<float, float, char>(float ()(char const, char**), char const*, char const*, unsigned long*)’中: common.cpp:(.text.ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9[ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9]+0x6d):对‘std::__throw_out_of_range(char const*)’未定义的引用 common.cpp:(.text.ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9[ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9]+0x75):对‘std::__throw_invalid_argument(char const*)’未定义的引用 common.o:在函数‘std::vector<int, std::allocator >::_M_default_append(unsigned long)’中: common.cpp:(.text._ZNSt6vectorIiSaIiEE17_M_default_appendEm[_ZNSt6vectorIiSaIiEE17_M_default_appendEm]+0x161):对‘operator delete(void*)’未定义的引用 common.cpp:(.text._ZNSt6vectorIiSaIiEE17_M_default_appendEm[_ZNSt6vectorIiSaIiEE17_M_default_appendEm]+0x18b):对‘operator new(unsigned long)’未定义的引用 common.cpp:(.text._ZNSt6vectorIiSaIiEE17_M_default_appendEm[_ZNSt6vectorIiSaIiEE17_M_default_appendEm]+0x1ba):对‘std::__throw_length_error(char const*)’未定义的引用 collect2: 错误:ld 返回 1 make: *** [main] 错误 1

liutao841204 avatar Apr 12 '23 09:04 liutao841204

gcc版本的问题? 参考 #86 懒的话可以试试cmake

Sped0n0ld avatar Apr 13 '23 02:04 Sped0n0ld

cmake的指令是啥?

yyqin1991 avatar Apr 13 '23 03:04 yyqin1991

参考 https://github.com/ggerganov/llama.cpp#usage

Sped0n0ld avatar Apr 13 '23 04:04 Sped0n0ld

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your consideration.

github-actions[bot] avatar Apr 21 '23 00:04 github-actions[bot]

Closing the issue, since no updates observed. Feel free to re-open if you need any further assistance.

github-actions[bot] avatar May 13 '23 22:05 github-actions[bot]