从源码编译PaddlePaddle报错
Created by: weixing02
我按照官方网站提供的方法从源码编译,步骤如下:
git clone https://github.com/PaddlePaddle/Paddle.git
cd Paddle
docker build -t paddle:dev .
docker run -it -v $PWD:/paddle -e "WITH_GPU=OFF" -e "WITH_TESTING=OFF" paddle:dev /bin/bash
bash -x /paddle/paddle/scripts/docker/build.sh
在最后一步使用脚本build.sh编译paddlepaddle时总是报错:
[ 10%] Completed 'extern_mklml'
[ 10%] Built target extern_mklml
Scanning dependencies of target cblas
[ 10%] Building C object CMakeFiles/cblas.dir/cblas_dummy.c.o
[ 10%] Linking C static library libcblas.a
[ 10%] Built target cblas
fatal: unable to open /paddle/build/third_party/eigen3/src/extern_eigen3/.git/objects/pack/tmp_pack_iLbm8f: No such file or directory
fatal: index-pack failed
Cloning into 'extern_eigen3'...
fatal: unable to open /paddle/build/third_party/protobuf/src/extern_protobuf/.git/objects/pack/tmp_pack_X3kRSj: No such file or directory
fatal: index-pack failed
Cloning into 'extern_protobuf'...
-- Had to git clone more than once:
2 times.
Note: checking out '70661066beef694cadf6c304d0d07e0758825c10'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 7066106... Bug 1472: fix warning
[ 8%] No patch step for 'extern_eigen3'
[ 8%] No update step for 'extern_eigen3'
[ 8%] No configure step for 'extern_eigen3'
[ 8%] No build step for 'extern_eigen3'
[ 8%] No install step for 'extern_eigen3'
[ 8%] No test step for 'extern_eigen3'
[ 8%] Completed 'extern_eigen3'
[ 8%] Built target extern_eigen3
fatal: unable to open /paddle/build/third_party/protobuf/src/extern_protobuf/.git/objects/pack/tmp_pack_emfC1R: No such file or directory
fatal: index-pack failed
Cloning into 'extern_protobuf'...
fatal: unable to open /paddle/build/third_party/protobuf/src/extern_protobuf/.git/objects/pack/tmp_pack_WcnRRn: No such file or directory
fatal: index-pack failed
-- Had to git clone more than once:
3 times.
CMake Error at /paddle/build/third_party/protobuf/tmp/extern_protobuf-gitclone.cmake:40 (message):
Failed to clone repository: 'https://github.com/google/protobuf.git'
CMakeFiles/extern_protobuf.dir/build.make:89: recipe for target 'third_party/protobuf/src/extern_protobuf-stamp/extern_protobuf-download' failed
make[2]: *** [third_party/protobuf/src/extern_protobuf-stamp/extern_protobuf-download] Error 1
CMakeFiles/Makefile2:348: recipe for target 'CMakeFiles/extern_protobuf.dir/all' failed
make[1]: *** [CMakeFiles/extern_protobuf.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
并且尝试重新编译,有时会报其他错误如下:
Scanning dependencies of target device_tracer
[ 12%] Building CXX object paddle/fluid/memory/detail/CMakeFiles/system_allocator.dir/system_allocator.cc.o
[ 12%] Building CXX object paddle/fluid/recordio/CMakeFiles/chunk.dir/chunk.cc.o
[ 12%] Building CXX object paddle/fluid/platform/CMakeFiles/device_tracer.dir/device_tracer.cc.o
In file included from /paddle/paddle/fluid/framework/type_defs.h:23:0,
from /paddle/paddle/fluid/framework/attribute.h:24,
from /paddle/paddle/fluid/framework/op_desc.h:19,
from /paddle/paddle/fluid/framework/block_desc.h:23,
from /paddle/paddle/fluid/platform/device_tracer.cc:23:
/paddle/paddle/fluid/platform/variant.h:30:28: fatal error: boost/config.hpp: No such file or directory
compilation terminated.
paddle/fluid/platform/CMakeFiles/device_tracer.dir/build.make:62: recipe for target 'paddle/fluid/platform/CMakeFiles/device_tracer.dir/device_tracer.cc.o' failed
make[2]: *** [paddle/fluid/platform/CMakeFiles/device_tracer.dir/device_tracer.cc.o] Error 1
CMakeFiles/Makefile2:2741: recipe for target 'paddle/fluid/platform/CMakeFiles/device_tracer.dir/all' failed
make[1]: *** [paddle/fluid/platform/CMakeFiles/device_tracer.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 12%] Linking CXX static library libdynload_warpctc.a
cpplint: Checking source code style
Done processing warpctc.cc
Done processing /paddle/paddle/fluid/platform/dynload/warpctc.h
Total errors found: 0
[ 12%] Built target dynload_warpctc
[ 12%] Linking CXX static library libframework_proto.a
[ 12%] Built target framework_proto
[ 12%] Linking CXX static library libthreadpool.a
cpplint: Checking source code style
Done processing threadpool.cc
Done processing /paddle/paddle/fluid/framework/threadpool.h
Total errors found: 0
[ 12%] Built target threadpool
[ 12%] Linking CXX static library libsystem_allocator.a
cpplint: Checking source code style
Done processing system_allocator.cc
Done processing /paddle/paddle/fluid/memory/detail/system_allocator.h
Total errors found: 0
[ 12%] Built target system_allocator
[ 12%] Linking CXX static library libchunk.a
cpplint: Checking source code style
Done processing chunk.cc
Done processing /paddle/paddle/fluid/recordio/chunk.h
Total errors found: 0
[ 12%] Built target chunk
[ 12%] Linking CXX static library libpaddle_proto.a
[ 12%] Built target paddle_porto
在一周前通过这个方法成功编译过,但可能是这几天同步了https://github.com/PaddlePaddle/Paddle.git 最新代码,导致编译失败,请问是什么问题呢