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

树莓派4b armv7l 编译paddlelite报错 #10633

Open
daydayup0206 opened this issue Feb 26, 2025 · 3 comments
Open

树莓派4b armv7l 编译paddlelite报错 #10633

daydayup0206 opened this issue Feb 26, 2025 · 3 comments
Assignees

Comments

@daydayup0206
Copy link

  • 版本、环境信息:
       1)Paddle Lite 版本:请提供您的 Paddle Lite 版本号develop
       2)Host 环境:linux raspberrypi 5.10.11-v7l+ 2021 armv7l
       3)运行设备环境:树莓派4b
    2)本地编译:./lite/tools/build_linux.sh --arch=armv7hf --with_python=ON --with_cv=ON --with_extra=ON --with_log=ON

  • 问题描述:报错信息为:

[ 34%] Building CXX object lite/operators/CMakeFiles/ops.dir/op_params.cc.o
[ 34%] Linking CXX static library libops.a
[ 34%] Built target ops
make[1]: *** [CMakeFiles/Makefile2:411: lite/CMakeFiles/publish_inference.dir/rule
make: *** [Makefile:222: publish_inference] Error 2

怎么解决

@daydayup0206
Copy link
Author

我按照文档来做的

@daydayup0206
Copy link
Author

以下上cmakeerror.log文件的信息:(我让大模型看了,给出的好多方法也试了,没解决)

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_57a73/fast"
/usr/bin/make -f CMakeFiles/cmTC_57a73.dir/build.make CMakeFiles/cmTC_57a73.dir/build
make[1]: Entering directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_57a73.dir/CheckSymbolExists.c.o
/usr/bin/gcc -o CMakeFiles/cmTC_57a73.dir/CheckSymbolExists.c.o -c /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_57a73
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_57a73.dir/link.txt --verbose=1
/usr/bin/gcc -rdynamic CMakeFiles/cmTC_57a73.dir/CheckSymbolExists.c.o -o cmTC_57a73
/usr/bin/ld: CMakeFiles/cmTC_57a73.dir/CheckSymbolExists.c.o: in function main': CheckSymbolExists.c:(.text+0x38): undefined reference to pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_57a73.dir/build.make:98: cmTC_57a73] Error 1
make[1]: Leaving directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_57a73/fast] Error 2

File /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_c7374/fast"
/usr/bin/make -f CMakeFiles/cmTC_c7374.dir/build.make CMakeFiles/cmTC_c7374.dir/build
make[1]: Entering directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c7374.dir/CheckFunctionExists.c.o
/usr/bin/gcc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_c7374.dir/CheckFunctionExists.c.o -c /usr/local/share/cmake-3.10/Modules/CheckFunctionExists.c
Linking C executable cmTC_c7374
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c7374.dir/link.txt --verbose=1
/usr/bin/gcc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_c7374.dir/CheckFunctionExists.c.o -o cmTC_c7374 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_c7374.dir/build.make:98: cmTC_c7374] Error 1
make[1]: Leaving directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_c7374/fast] Error 2

Performing C++ SOURCE FILE Test FMA_FOUND failed with the following output:
Change Dir: /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_d523b/fast"
/usr/bin/make -f CMakeFiles/cmTC_d523b.dir/build.make CMakeFiles/cmTC_d523b.dir/build
make[1]: Entering directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_d523b.dir/src.cxx.o
/usr/bin/g++ -DFMA_FOUND -mfma -o CMakeFiles/cmTC_d523b.dir/src.cxx.o -c /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp/src.cxx
g++: error: unrecognized command line option '-mfma'
make[1]: *** [CMakeFiles/cmTC_d523b.dir/build.make:66: CMakeFiles/cmTC_d523b.dir/src.cxx.o] Error 1
make[1]: Leaving directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_d523b/fast] Error 2

Return value: 1
Source file was:

#include <immintrin.h>
int main()
{
__m256 _a = _mm256_set1_ps(1.f);
__m256 _b = _mm256_set1_ps(2.f);
__m256 _c = _mm256_set1_ps(3.f);
__m256 _res = _mm256_fmadd_ps(_a, _b, _c);
return 0;
}
Performing C++ SOURCE FILE Test MMX_FOUND failed with the following output:
Change Dir: /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_c67a7/fast"
/usr/bin/make -f CMakeFiles/cmTC_c67a7.dir/build.make CMakeFiles/cmTC_c67a7.dir/build
make[1]: Entering directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_c67a7.dir/src.cxx.o
/usr/bin/g++ -DMMX_FOUND -mmmx -o CMakeFiles/cmTC_c67a7.dir/src.cxx.o -c /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp/src.cxx
g++: error: unrecognized command line option '-mmmx'
make[1]: *** [CMakeFiles/cmTC_c67a7.dir/build.make:66: CMakeFiles/cmTC_c67a7.dir/src.cxx.o] Error 1
make[1]: Leaving directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_c67a7/fast] Error 2

Return value: 1
Source file was:

#include <mmintrin.h>
int main()
{
_mm_setzero_si64();
return 0;
}
Performing C++ SOURCE FILE Test SSE2_FOUND failed with the following output:
Change Dir: /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_f16c1/fast"
/usr/bin/make -f CMakeFiles/cmTC_f16c1.dir/build.make CMakeFiles/cmTC_f16c1.dir/build
make[1]: Entering directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_f16c1.dir/src.cxx.o
/usr/bin/g++ -DSSE2_FOUND -msse2 -o CMakeFiles/cmTC_f16c1.dir/src.cxx.o -c /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp/src.cxx
g++: error: unrecognized command line option '-msse2'
make[1]: *** [CMakeFiles/cmTC_f16c1.dir/build.make:66: CMakeFiles/cmTC_f16c1.dir/src.cxx.o] Error 1
make[1]: Leaving directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_f16c1/fast] Error 2

Return value: 1
Source file was:

#include <emmintrin.h>
int main()
{
_mm_setzero_si128();
return 0;
}
Performing C++ SOURCE FILE Test SSE3_FOUND failed with the following output:
Change Dir: /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_a1442/fast"
/usr/bin/make -f CMakeFiles/cmTC_a1442.dir/build.make CMakeFiles/cmTC_a1442.dir/build
make[1]: Entering directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_a1442.dir/src.cxx.o
/usr/bin/g++ -DSSE3_FOUND -msse3 -o CMakeFiles/cmTC_a1442.dir/src.cxx.o -c /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp/src.cxx
g++: error: unrecognized command line option '-msse3'
make[1]: *** [CMakeFiles/cmTC_a1442.dir/build.make:66: CMakeFiles/cmTC_a1442.dir/src.cxx.o] Error 1
make[1]: Leaving directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_a1442/fast] Error 2

Return value: 1
Source file was:

#include <pmmintrin.h>
int main()
{
__m128d a = _mm_set1_pd(6.28);
__m128d b = _mm_set1_pd(3.14);
__m128d result = _mm_addsub_pd(a, b);
result = _mm_movedup_pd(result);
return 0;
}
Performing C++ SOURCE FILE Test AVX_FOUND failed with the following output:
Change Dir: /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_9913b/fast"
/usr/bin/make -f CMakeFiles/cmTC_9913b.dir/build.make CMakeFiles/cmTC_9913b.dir/build
make[1]: Entering directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_9913b.dir/src.cxx.o
/usr/bin/g++ -DAVX_FOUND -mavx -o CMakeFiles/cmTC_9913b.dir/src.cxx.o -c /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp/src.cxx
g++: error: unrecognized command line option '-mavx'; did you mean '-marm'?
make[1]: *** [CMakeFiles/cmTC_9913b.dir/build.make:66: CMakeFiles/cmTC_9913b.dir/src.cxx.o] Error 1
make[1]: Leaving directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_9913b/fast] Error 2

Return value: 1
Source file was:

#include <immintrin.h>
int main()
{
__m256 a = _mm256_set_ps (-1.0f, 2.0f, -3.0f, 4.0f, -1.0f, 2.0f, -3.0f, 4.0f);
__m256 b = _mm256_set_ps (1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f);
__m256 result = _mm256_add_ps (a, b);
return 0;
}
Performing C++ SOURCE FILE Test AVX2_FOUND failed with the following output:
Change Dir: /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_55856/fast"
/usr/bin/make -f CMakeFiles/cmTC_55856.dir/build.make CMakeFiles/cmTC_55856.dir/build
make[1]: Entering directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_55856.dir/src.cxx.o
/usr/bin/g++ -DAVX2_FOUND -mavx2 -o CMakeFiles/cmTC_55856.dir/src.cxx.o -c /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp/src.cxx
g++: error: unrecognized command line option '-mavx2'
make[1]: *** [CMakeFiles/cmTC_55856.dir/build.make:66: CMakeFiles/cmTC_55856.dir/src.cxx.o] Error 1
make[1]: Leaving directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_55856/fast] Error 2

Return value: 1
Source file was:

#include <immintrin.h>
int main()
{
__m256i a = _mm256_set_epi32 (-1, 2, -3, 4, -1, 2, -3, 4);
__m256i result = _mm256_abs_epi32 (a);
return 0;
}
Performing C++ SOURCE FILE Test AVX512F_FOUND failed with the following output:
Change Dir: /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_bb95a/fast"
/usr/bin/make -f CMakeFiles/cmTC_bb95a.dir/build.make CMakeFiles/cmTC_bb95a.dir/build
make[1]: Entering directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_bb95a.dir/src.cxx.o
/usr/bin/g++ -DAVX512F_FOUND -mavx512f -o CMakeFiles/cmTC_bb95a.dir/src.cxx.o -c /home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp/src.cxx
g++: error: unrecognized command line option '-mavx512f'
make[1]: *** [CMakeFiles/cmTC_bb95a.dir/build.make:66: CMakeFiles/cmTC_bb95a.dir/src.cxx.o] Error 1
make[1]: Leaving directory '/home/pi/Downloads/Paddle-Lite/build.lite.linux.armv7hf.gcc/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_bb95a/fast] Error 2

Return value: 1
Source file was:

#include <immintrin.h>
int main()
{
__m512i a = _mm512_set_epi32 (-1, 2, -3, 4, -1, 2, -3, 4,
13, -5, 6, -7, 9, 2, -6, 3);
__m512i result = _mm512_abs_epi32 (a);
return 0;
}

@yulangz
Copy link
Collaborator

yulangz commented Feb 26, 2025

Image

Image
看看是不是这个 -lpthread 的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants