environment: ubuntu16.04
compiler: gcc-5.4
command: sh ./tools/build.sh
error log:
-- The CXX compiler identification is GNU 5.4.0
-- The C compiler identification is GNU 5.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found OpenCV: /home/xxx/paddle-paddle-test/PaddleOCR/deploy/cpp_infer/third-party/opencv (found suitable version "4.5.3", minimum required is "4.5.3")
cmake cxx flags -g -o3 -fopenmp -std=c++11
cp: cannot create regular file '/usr/lib/libmklml_intel.so': Permission denied
-- Found Git: /usr/bin/git (found version "2.7.4")
default cmake for auto_log, no need to compile
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xxx/paddle-paddle-test/PaddleOCR/deploy/cpp_infer/build
[ 12%] Building CXX object CMakeFiles/ppocr.dir/src/main.cpp.o
/usr/bin/c++ -DUSE_MKL -I/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference/paddle/include -I/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference/third_party/install/protobuf/include -I/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference/third_party/install/glog/include -I/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference/third_party/install/gflags/include -I/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference/third_party/install/xxhash/include -I/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference/third_party/install/zlib/include -I/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference/third_party/boost -I/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference/third_party/eigen3 -I/home/xxx/data3_xxx_ln/paddle-paddle-test/PaddleOCR/deploy/cpp_infer -I/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference/third_party/install/mklml/include -I/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference/third_party/install/mkldnn/include -I/home/xxx/data3_xxx_ln/paddle-paddle-test/PaddleOCR/deploy/cpp_infer/build/third-party/extern_autolog-src -isystem /data3/xxx/paddle-paddle-test/PaddleOCR/deploy/cpp_infer/third-party/opencv/include/opencv4 -g -o3 -fopenmp -std=c++11 -std=gnu++11 -MD -MT CMakeFiles/ppocr.dir/src/main.cpp.o -MF CMakeFiles/ppocr.dir/src/main.cpp.o.d -o CMakeFiles/ppocr.dir/src/main.cpp.o -c /home/xxx/data3_xxx_ln/paddle-paddle-test/PaddleOCR/deploy/cpp_infer/src/main.cpp
cc1plus: fatal error: CMakeFiles/ppocr.dir/src/main.cpp.d: No such file or directory
compilation terminated.
CMakeFiles/ppocr.dir/build.make:75: recipe for target 'CMakeFiles/ppocr.dir/src/main.cpp.o' failed
make[2]: *** [CMakeFiles/ppocr.dir/src/main.cpp.o] Error 1
hurry, need help.
about CMakeLists.txt
only modified line 46
find_package(OpenCV 4.5.3 REQUIRED PATHS ${PROJECT_SOURCE_DIR}/third-party/opencv NO_DEFAULT_PATH)
about tool/build.sh
OPENCV_DIR=/home/xxx/data3_xxx_ln/paddle-paddle-test/PaddleOCR/deploy/cpp_infer/third-party/opencv
LIB_DIR=/home/xxx/data3_xxx_ln/paddle-paddle-test/paddle_inference
CUDA_LIB_DIR=/home/xxx/data3_xxx_ln/cuda-10.2+cudnn-8.0.3_lib64
CUDNN_LIB_DIR=/home/xxx/data3_xxx_ln/cuda-10.2+cudnn-8.0.3_lib64
BUILD_DIR=build
rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}
cd ${BUILD_DIR}
cmake .. \
-DPADDLE_LIB=${LIB_DIR} \
-DWITH_MKL=ON \
-DWITH_GPU=OFF \
-DWITH_STATIC_LIB=OFF \
-DWITH_TENSORRT=OFF \
-DOPENCV_DIR=${OPENCV_DIR} \
-DCUDNN_LIB=${CUDNN_LIB_DIR} \
-DCUDA_LIB=${CUDA_LIB_DIR} \
-DTENSORRT_DIR=${TENSORRT_DIR} \
make -j1 VERBOSE=1
6条答案
按热度按时间soat7uwm1#
Maybe you should check the directory permissions.
kqqjbcuj2#
Hi, the default compile mode is debug, when I comment and change code in the line 78 in CMakeLists.txt
old err dispearred, but when I recompiled the code, new err occurs (log below):
link failed ?
paddle-infer: https://paddle-inference-lib.bj.bcebos.com/2.0.2-gpu-cuda10.2-cudnn8-avx-mkl/paddle_inference.tgz
okay, paddle-infer only support dynamic lib, but I turn off the compilation option
WITH_STATIC_LIB
, so the err occurred.And, for opencv4+, ffmpeg lib is needed on Linux platform.
here is my finally CMakeLists.txt and the demo run successfully.
output log:
New questions:
1.What does the log text "Profiler is deactivated, and no profiling report will be generated." mean ?
0aydgbwb3#
(训练是在conda环境下,这里的部署也就没有在docker环境下)
编译PaddleOCR C++预测demo,运行
报错如下:
hof1towb4#
please replace the code (in the line 78 in CMakeLists.txt)
with
ie3xauqp5#
please replace the code (in the line 78 in CMakeLists.txt)
with
非常感谢,Thank you very much!
使用
成功了。
输出如下:
补充:没有在docker环境下:
build.sh
内容如下:ehxuflar6#
Hey, guys, I have met a runtime exiting problem when running cpp_infer/main.cpp on Win64 platform. Here is my CMakeLists.txt:
Here is tool/build.bat
env:
win10
cuda11+cudnn8
paddle-paddle-2.0.2 https://paddle-wheel.bj.bcebos.com/2.0.2/win-infer/trt_mkl/post11/paddle_inference.zip
tensorrt 7.2.3.4
opencv 4.5.3
running cmd & logs
any suggestions ?