Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.37k stars 4.16k forks source link

fail to install on raspberry pi 4 with 32-bit Raspbian OS (armv7l) #3659

Open guchchcug opened 2 years ago

guchchcug commented 2 years ago

error log | 日志或报错信息 | ログ

/usr/bin/ld: ../src/libncnn.a(cpu.cpp.o): undefined reference to symbol 'dlopen@@GLIBC_2.4' /usr/bin/ld: /lib/arm-linux-gnueabihf/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[2]: [benchmark/CMakeFiles/benchncnn.dir/build.make:106; benchmark/benchncnn] Error 1 make[1]: [CMakeFiles/Makefile2:387: benchmark/CMakeFiles/benchncnn.dir/all] Error 2

context | 编译/运行环境 | バックグラウンド

Linux raspberrypi 5.10.103-v7l+ XXXXXXXXXXXX armv7l GNU/Linux cmake version 3.18.4

how to reproduce | 复现步骤 | 再現方法

  1. $ sudo apt-get update
  2. $ sudo apt-get upgrade
  3. $ sudo apt-get install cmake wget
  4. $ sudo apt-get install libprotobuf-dev protobuf-compiler
  5. $ git clone --depth=1 https://github.com/Tencent/ncnn.git
  6. $ cd ncnn
  7. $ mkdir build
  8. $ cd build
  9. $ cmake -D PI3=ON \ -D NCNN_DISABLE_RTTI=OFF \ -D CMAKE_EXE_LINKER_FLAGS=-ldl \ -D CMAKE_TOOLCHAIN_FILE=../toolchains/pi3.toolchain.cmake ..
  10. $ make -j4

more | 其他 | その他

Qengineering commented 2 years ago

I think you forgot the backslash character at the end of the cmake command. The correct format is

# build 32-bit ncnn
$ cmake -D PI3=ON \
-D NCNN_DISABLE_RTTI=OFF \
-D CMAKE_EXE_LINKER_FLAGS=-ldl \
-D CMAKE_TOOLCHAIN_FILE=../toolchains/pi3.toolchain.cmake ..

With the backslash at the end of every line. Or if you prefer one line $ cmake -DPI3=ON -DNCNN_DISABLE_RTTI=OFF -DCMAKE_EXE_LINKER_FLAGS=-ldl -DCMAKE_TOOLCHAIN_FILE=../toolchains/pi3.toolchain.cmake ..