未能在ubuntu 15.04上构建caffe。

时间:2022-01-14 00:18:42

Having followed the steps to build caffe : http://caffe.berkeleyvision.org/installation.html#compilation , I meet the following error

遵循构建caffe的步骤:http://caffe.berkeleyvision.org/installes.html #编译,我遇到了以下错误。

:~/App/caffe$ make all

PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/layer_factory.cpp
In file included from ./include/caffe/common_layers.hpp:10:0,
                 from ./include/caffe/vision_layers.hpp:10,
                 from src/caffe/layer_factory.cpp:6:
./include/caffe/data_layers.hpp:9:18: fatal error: hdf5.h: Aucun fichier ou dossier de ce type
 #include "hdf5.h"
                  ^
compilation terminated.
Makefile:512: recipe for target '.build_release/src/caffe/layer_factory.o' failed
make: *** [.build_release/src/caffe/layer_factory.o] Error 1

I check the install of hdf5: libhdf5-dev is installed with apt-get:

我检查hdf5的安装:libhdf5-dev安装了apt-get:

sudo apt-get install libhdf5-dev
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
libhdf5-dev est déjà la plus récente version disponible

cuda7 is installed, opencv 3 ...

cuda7安装,opencv 3…

Thanks for advices

谢谢你的建议

2 个解决方案

#1


3  

The steps required to make it build on Ubuntu 15.04 and Debian 8.x can be found in this GitHub issue.

使它在Ubuntu 15.04和Debian 8上构建所需的步骤。在这个GitHub问题上可以找到x。

To summarise:

总结:

#!/bin/bash
# manipulate header path, before building caffe on debian jessie
# usage:
# 1. cd root of caffe
# 2. bash <this_script>
# 3. build

# transformations :
#  #include "hdf5/serial/hdf5.h" -> #include "hdf5/serial/hdf5.h"
#  #include "hdf5_hl.h" -> #include "hdf5/serial/hdf5_hl.h"

find . -type f -exec sed -i -e 's^"hdf5.h"^"hdf5/serial/hdf5.h"^g' -e 's^"hdf5_hl.h"^"hdf5/serial/hdf5_hl.h"^g' '{}' \;

Followed by

紧随其后的是

Modify INCLUDE_DIRS in Makefile.config

修改在Makefile.config INCLUDE_DIRS

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

And finally, make some simlinks to HD5

最后,对HD5做一些简单的链接。

cd /usr/lib/x86_64-linux-gnu
sudo ln -s libhdf5_serial.so.8.0.2 libhdf5.so
sudo ln -s libhdf5_serial_hl.so.8.0.2 libhdf5_hl.so

#2


1  

Maybe try installing the entire hdf5 package, not only the dev portion.

可能尝试安装整个hdf5包,而不仅仅是dev部分。

If that doesn't work, verify that you have the hdf5.h header on your system and check its path.

如果这不起作用,请验证是否有hdf5。h标头在你的系统上,检查它的路径。

You can check gcc's include path with the command [source]

您可以查看gcc的include路径和命令[源代码]

gcc -xc -E -v -

#1


3  

The steps required to make it build on Ubuntu 15.04 and Debian 8.x can be found in this GitHub issue.

使它在Ubuntu 15.04和Debian 8上构建所需的步骤。在这个GitHub问题上可以找到x。

To summarise:

总结:

#!/bin/bash
# manipulate header path, before building caffe on debian jessie
# usage:
# 1. cd root of caffe
# 2. bash <this_script>
# 3. build

# transformations :
#  #include "hdf5/serial/hdf5.h" -> #include "hdf5/serial/hdf5.h"
#  #include "hdf5_hl.h" -> #include "hdf5/serial/hdf5_hl.h"

find . -type f -exec sed -i -e 's^"hdf5.h"^"hdf5/serial/hdf5.h"^g' -e 's^"hdf5_hl.h"^"hdf5/serial/hdf5_hl.h"^g' '{}' \;

Followed by

紧随其后的是

Modify INCLUDE_DIRS in Makefile.config

修改在Makefile.config INCLUDE_DIRS

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

And finally, make some simlinks to HD5

最后,对HD5做一些简单的链接。

cd /usr/lib/x86_64-linux-gnu
sudo ln -s libhdf5_serial.so.8.0.2 libhdf5.so
sudo ln -s libhdf5_serial_hl.so.8.0.2 libhdf5_hl.so

#2


1  

Maybe try installing the entire hdf5 package, not only the dev portion.

可能尝试安装整个hdf5包,而不仅仅是dev部分。

If that doesn't work, verify that you have the hdf5.h header on your system and check its path.

如果这不起作用,请验证是否有hdf5。h标头在你的系统上,检查它的路径。

You can check gcc's include path with the command [source]

您可以查看gcc的include路径和命令[源代码]

gcc -xc -E -v -