Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.1k views
in Technique[技术] by (71.8m points)

树莓派respberry中cmake编译链接python2.7库不成功,求教

本人在树莓派pi3平台上,下载respberry 5.4 lite 编译一个github上的项目,该项目用cmake管理,目前看到 链接库阶段不成功。

请教如何调整cmake的链接库目录,或是怎样直接调整生成的makefile,用于连编

项目地址
https://github.com/psykulsk/RpiANC

是一个主动降噪的项目,源码用到了python2.7,matlab的一些库。
按原项目文档编译说明要求执行不成功

Build and run commands

Example:

   mkdir build && cd build
   cmake ../ && make all 

Main binary that does feedforward active noise control:

./ffANC 

Simple tests that show how LMS and FxLMS attenuate simulated noise on matplotlib plots:

./lmstest
./fxlmstest 

编译报错代码如下

build  CMakeCache.txt  CMakeFiles  cmake_install.cmake  CMakeLists.txt  docs  Headers  LICENSE  Mains  Makefile  MakefileBack  matplotlibcpp-license.txt  README.md  Scripts  Sources
pi@raspberrypi:~/RpiANC $ make
[  1%] Linking CXX executable fxlmstest
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function `matplotlibcpp::detail::_interpreter::_interpreter()':
fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x2c): undefined reference to `Py_SetProgramName'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x30): undefined reference to `Py_Initialize'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x38): undefined reference to `PyString_FromString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x48): undefined reference to `PyString_FromString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x58): undefined reference to `PyString_FromString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0xbc): undefined reference to `PyImport_Import'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x178): undefined reference to `PyObject_CallMethod'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x184): undefined reference to `PyImport_Import'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x214): undefined reference to `PyImport_Import'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x2a4): undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x2bc): undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x2d4): undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x2ec): undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x304): undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o:fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x31c): more undefined references to `PyObject_GetAttrString' follow
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function `matplotlibcpp::detail::_interpreter::_interpreter()':
fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x9e0): undefined reference to `PyTuple_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0xaf4): undefined reference to `PyFunction_Type'
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function `matplotlibcpp::detail::_interpreter::~_interpreter()':
fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterD2Ev[_ZN13matplotlibcpp6detail12_interpreterD5Ev]+0x10): undefined reference to `Py_Finalize'
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function `matplotlibcpp::subplot(long, long, long)':
fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x1c): undefined reference to `PyTuple_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x3c): undefined reference to `PyFloat_FromDouble'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x50): undefined reference to `PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x68): undefined reference to `PyFloat_FromDouble'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x7c): undefined reference to `PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x94): undefined reference to `PyFloat_FromDouble'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0xa8): undefined reference to `PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0xc4): undefined reference to `PyObject_CallObject'
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function `matplotlibcpp::title(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
fxlmstest.cpp:(.text._ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x20): undefined reference to `PyString_FromString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x30): undefined reference to `PyTuple_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x4c): undefined reference to `PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x68): undefined reference to `PyObject_CallObject'
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function `matplotlibcpp::show(bool)':
fxlmstest.cpp:(.text._ZN13matplotlibcpp4showEb[_ZN13matplotlibcpp4showEb]+0x40): undefined reference to `PyObject_CallObject'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4showEb[_ZN13matplotlibcpp4showEb]+0x50): undefined reference to `PyDict_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4showEb[_ZN13matplotlibcpp4showEb]+0x6c): undefined reference to `PyDict_SetItemString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4showEb[_ZN13matplotlibcpp4showEb]+0x94): undefined reference to `PyObject_Call'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4showEb[_ZN13matplotlibcpp4showEb]+0x17c): undefined reference to `_Py_ZeroStruct'
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function `bool matplotlibcpp::semilogy<float, float>(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x7c): undefined reference to `PyString_FromString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x8c): undefined reference to `PyTuple_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xa8): undefined reference to `PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xbc): undefined reference to `PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xd0): undefined reference to `PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xec): undefined reference to `PyObject_CallObject'
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function `bool matplotlibcpp::plot<float, float>(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x7c): undefined reference to `PyString_FromString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x8c): undefined reference to `PyTuple_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xa8): undefined reference to `PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xbc): undefined reference to `PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEE

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...