zoukankan      html  css  js  c++  java
  • caffe编译问题-src/caffe/net.cpp:8:18: fatal error: hdf5.h: No such file or directory compilation terminated.

    错误描述

    src/caffe/net.cpp:8:18: fatal error: hdf5.h: No such file or directory compilation terminated. Makefile:583: recipe for target '.build_release/src/caffe/net.o' failed make: *** [.build_release/src/caffe/net.o] Error 1

    操作过程

    step1:

    Makefile.config文件更改INCLUDE_DIRS和LIBRARY_DIRS的内容,添加/usr/include/hdf5/serial/ 到 INCLUDE_DIRS,也就是把下面第一行代码改为第二行代码。

    #INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
    #LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

    改为

    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

    step2:

    Makefile文件的LIBRARIES,把 hdf5_hl 和hdf5修改为hdf5_serial_hl 和 hdf5_serial,也就是把下面第一行代码改为第二行代码。

    #LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
    LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

    注意:如果按照上述步骤改过之后仍然出现同样的错误,那可能是hdf5的路径不匹配,需要locate寻找hdf5的路径,然后更改为所在系统的安装路径。

    这个错误表明,我们的hdf5.h这个头文件的路径没有被找到,如果你没有安装HDF5这个文件 ,那当然是找不到的。再者,就然你安装了这个文件也可能找不到,那么我们怎么办。我们用locate hdf5.h找到你安装的路径,然后在makefile.conf文件中相应指定就好了。

    参考

    1.caffe编译问题

    2.caffe编译hdf5问题

  • 相关阅读:
    远程过程调用RPC
    CAP原理
    2021/03/08阿里在线笔试问题总结
    水容器问题
    rand5生成rand3和rand7
    二维数组查找K(Go语言)
    判别IP为IPV4或者IPV6 (Go语言)
    路径总和(Go)
    合并K个升序链表(Go)
    delphi idhttp提交网址包含中文
  • 原文地址:https://www.cnblogs.com/happyamyhope/p/9205038.html
Copyright © 2011-2022 走看看