Caffe: Falha de compilação do Ubuntu 15.04 devido a "hdf5.h" em vez de "hdf5/serial/hdf5.h" e similarmente "hdf5_hl.h"

Criado em 4 jul. 2015  ·  20Comentários  ·  Fonte: BVLC/caffe

Comentários muito úteis

Uma solução um pouco mais simples:

diff --git a/Makefile.config.example b/Makefile.config.example
index a873502..88828cc 100644
--- a/Makefile.config.example
+++ b/Makefile.config.example
@@ -69,8 +69,8 @@ PYTHON_LIB := /usr/lib
 # WITH_PYTHON_LAYER := 1

 # Whatever else you find you need goes here.
-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/hdf5/serial/

 # If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
 # INCLUDE_DIRS += $(shell brew --prefix)/include

Todos 20 comentários

Da mesma forma, não foi possível encontrar libhdf5 ou libhdf5_hl, que estão localizados em /usr/lib/x86_64-linux-gnu/hdf5/serial/

diff --git a/Makefile.config.example b/Makefile.config.example
index a873502..33441b3 100644
--- a/Makefile.config.example
+++ b/Makefile.config.example
@@ -70,7 +70,7 @@ PYTHON_LIB := /usr/lib

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

 # If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
 # INCLUDE_DIRS += $(shell brew --prefix)/include
diff --git a/include/caffe/data_layers.hpp b/include/caffe/data_layers.hpp
index 3958cb7..2ccbaec 100644
--- a/include/caffe/data_layers.hpp
+++ b/include/caffe/data_layers.hpp
@@ -6,7 +6,7 @@
 #include <vector>

 #include "boost/scoped_ptr.hpp"
-#include "hdf5.h"
+#include "hdf5/serial/hdf5.h"

 #include "caffe/blob.hpp"
 #include "caffe/common.hpp"
diff --git a/include/caffe/util/io.hpp b/include/caffe/util/io.hpp
index 3a62c3c..f4363f0 100644
--- a/include/caffe/util/io.hpp
+++ b/include/caffe/util/io.hpp
@@ -5,8 +5,8 @@
 #include <string>

 #include "google/protobuf/message.h"
-#include "hdf5.h"
-#include "hdf5_hl.h"
+#include "hdf5/serial/hdf5.h"
+#include "hdf5/serial/hdf5_hl.h"

 #include "caffe/blob.hpp"
 #include "caffe/common.hpp"
diff --git a/src/caffe/layers/hdf5_data_layer.cpp b/src/caffe/layers/hdf5_data_layer.cpp
index 8a782f7..42890be 100644
--- a/src/caffe/layers/hdf5_data_layer.cpp
+++ b/src/caffe/layers/hdf5_data_layer.cpp
@@ -10,8 +10,8 @@ TODO:
 #include <string>
 #include <vector>

-#include "hdf5.h"
-#include "hdf5_hl.h"
+#include "hdf5/serial/hdf5.h"
+#include "hdf5/serial/hdf5_hl.h"
 #include "stdint.h"

 #include "caffe/data_layers.hpp"
diff --git a/src/caffe/layers/hdf5_data_layer.cu b/src/caffe/layers/hdf5_data_layer.cu
index 5e3e4ce..23bc02a 100644
--- a/src/caffe/layers/hdf5_data_layer.cu
+++ b/src/caffe/layers/hdf5_data_layer.cu
@@ -7,8 +7,8 @@ TODO:
 #include <string>
 #include <vector>

-#include "hdf5.h"
-#include "hdf5_hl.h"
+#include "hdf5/serial/hdf5.h"
+#include "hdf5/serial/hdf5_hl.h"

 #include "caffe/data_layers.hpp"
 #include "caffe/layer.hpp"
diff --git a/src/caffe/layers/hdf5_output_layer.cpp b/src/caffe/layers/hdf5_output_layer.cpp
index f63375c..0b57eb9 100644
--- a/src/caffe/layers/hdf5_output_layer.cpp
+++ b/src/caffe/layers/hdf5_output_layer.cpp
@@ -1,7 +1,7 @@
 #include <vector>

-#include "hdf5.h"
-#include "hdf5_hl.h"
+#include "hdf5/serial/hdf5.h"
+#include "hdf5/serial/hdf5_hl.h"

 #include "caffe/blob.hpp"
 #include "caffe/common.hpp"
diff --git a/src/caffe/layers/hdf5_output_layer.cu b/src/caffe/layers/hdf5_output_layer.cu
index ae497c3..ada682f 100644
--- a/src/caffe/layers/hdf5_output_layer.cu
+++ b/src/caffe/layers/hdf5_output_layer.cu
@@ -1,7 +1,7 @@
 #include <vector>

-#include "hdf5.h"
-#include "hdf5_hl.h"
+#include "hdf5/serial/hdf5.h"
+#include "hdf5/serial/hdf5_hl.h"

 #include "caffe/blob.hpp"
 #include "caffe/common.hpp"

Uma solução um pouco mais simples:

diff --git a/Makefile.config.example b/Makefile.config.example
index a873502..88828cc 100644
--- a/Makefile.config.example
+++ b/Makefile.config.example
@@ -69,8 +69,8 @@ PYTHON_LIB := /usr/lib
 # WITH_PYTHON_LAYER := 1

 # Whatever else you find you need goes here.
-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/hdf5/serial/

 # If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
 # INCLUDE_DIRS += $(shell brew --prefix)/include

Ah, obrigado! Como isso vai no Makefile.config e é específico da plataforma, fecharei este relatório.

apenas modifique o Makefile.config funciona para mim!
Muito obrigado :smile:

+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/hdf5/serial/

Funciona!

Obrigado! Funciona para mim

Estou no Ubuntu 16.04 e funciona!

@byshen , funciona para mim, obrigado!

como resolver esse problema no Ubuntu 16.04?

Funciona pra mim também. Obrigado.
A versão é Ubuntu 15.10

Obrigada!
Funciona para mim.
Ubuntu 16.04

Obrigado, funcionou! Ubuntu 16.04

Obrigado, funcionou! Ubuntu 15.04

Posso sugerir que adicionemos uma versão comentada do acima com uma nota "descomentar estes para instalar no Ubuntu"?

Funciona !!!!!

adicionando estes no Ubuntu 16.04 funciona:
+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/hdf5/serial/

Primeiro verifiquei se o caminho existe antes de adicioná-lo.

não funcionou para mim (Ubuntu 16.04)

LD -o .build_release/lib/libcaffe.so.1.0.0
/usr/bin/ld: não foi possível encontrar -lhdf5_serial_h
collect2: erro: ld retornou 1 status de saída
Makefile:573 : siga as instruções para o objetivo '.build_release/lib/libcaffe.so.1.0.0'
make: * [.build_release/lib/libcaffe.so.1.0.0] Erro 1

@GonzaBCCC você instalou o pacote libhdf5-dev ? no Ubuntu 17.04, isso realmente contém cabeçalhos hdf5-serial e de desenvolvimento, embora exista um pacote chamado libhdf5-serial-dev (contém apenas informações de direitos autorais e tal)

@byshen funciona

Esta página foi útil?
0 / 5 - 0 avaliações