在Ubuntu上构建Caffe:make无法找到Boost的包含文件

时间:2015-03-05 00:23:05

标签: ubuntu boost include caffe

我正在关注these instructions以安装和构建Caffe及其依赖项。我建造了Boost并在最后得到了这个:

The following directory should be added to compiler include paths:
   /home/ubuntu/Caffe/boost_1_57_0
The following directory should be added to linker library paths:
   /home/ubuntu/Caffe/boost_1_57_0/stage/lib

当我在caffe目录中运行make all时,我得到了这个:

CXX src/caffe/blob.cpp
In file included from ./include/caffe/blob.hpp:8:0,
             from src/caffe/blob.cpp:4:
./include/caffe/common.hpp:4:32: fatal error: boost/shared_ptr.hpp: No such file or directory
compilation terminated.
make: *** [.build_release/src/caffe/blob.o] Error 1

我需要修改它才能找到include(和lib)文件?特定的环境变量?在caffe的Makefile中设置?还有别的吗?

3 个答案:

答案 0 :(得分:9)

您机器上可能没有安装boost

 sudo apt-get install --no-install-recommends libboost-all-dev

答案 1 :(得分:3)

这对我有用:

cd /usr/include/boost/thread
sudo ln -s locks.hpp latch.hpp

答案 2 :(得分:1)

只需将您构建的boost文件夹(必须命名为" boost")复制到/usr/local/include/usr/include。然后再次运行make all