![我如何让#include "hdf5.h" 找到 hdf5.h?](https://linux22.com/image/1143486/%E6%88%91%E5%A6%82%E4%BD%95%E8%AE%A9%23include%20%22hdf5.h%22%20%E6%89%BE%E5%88%B0%20hdf5.h%EF%BC%9F.png)
目前,我正在尝试获取咖啡(这个:http://caffe.berkeleyvision.org/installation.html) 在我的 Ubuntu 16.04 机器上运行。当我尝试调用 make 时收到的错误是:
CXX src/caffe/layers/conv_layer.cpp
In file included from ./include/caffe/vision_layers.hpp:11:0,
from src/caffe/layers/conv_layer.cpp:3:
./include/caffe/data_layers.hpp:7:18: fatal error: hdf5.h: No such file or directory
compilation terminated.
Makefile:552: recipe for target '.build_release/src/caffe/layers/conv_layer.o' failed
make: *** [.build_release/src/caffe/layers/conv_layer.o] Error 1
我发现这个线程可以为某些人解决此问题:
https://stackoverflow.com/questions/24744969/installing-h5py-on-an-ubuntu-server
所以我在我的终端上尝试:
$ sudo apt-get install cython
$ sudo apt-get install libhdf5-dev
$ sudo apt-get install python-h5py
$ HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ pip install h5py
$ pip install h5py
但错误仍然存在。我确实发现这里有这个文件:
/usr/include/hdf5/serial/hdf5.h
我如何让 c++ 自动在此处找到文件?例如,在我使用 apt-get 安装 glog 后,它可以毫无问题地找到它,但 hdf5 似乎有所不同。有人知道为什么吗?