环境:Ubuntu16.04+caffe cannot find -lhdf5_hl

来源:互联网 发布:html实时数据页面设计 编辑:程序博客网 时间:2024/06/05 00:58

电脑上刚装的Ubuntu,配一下CPU版的caffe

参考:http://caffe.berkeleyvision.org/install_apt.html

一、安装一些依赖

1、

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compilersudo apt-get install --no-install-recommends libboost-all-dev

2、CPU版的可以跳过CUDA


3、sudo apt-get install libatlas-base-dev


4、python(可选),如果想用默认的python编译pycaffe的接口:apt-get install thepython-dev

5、

sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

二、编译参考:http://caffe.berkeleyvision.org/installation.html#compilation

1、

在git上直接下载caffe或者

下载caffe源码

sudo apt-get install git

git clone https://github.com/bvlc/caffe.git


2、cd caffe

cp Makefile.config.example Makefile.config


根据需要修改Makefile.config

make all


然后就出错了!!!!

/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:572: recipe for target '.build_release/lib/libcaffe.so.1.0.0' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
make: *** Waiting for unfinished jobs....


解决方法:在Makefile.config中添加:

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial


再make all -j8(-j8 加速的)

make test

make runtest


然后就配好了



原创粉丝点击