Skip to content

Ubuntu 15.04 compilation failure due to "hdf5.h" instead of "hdf5/serial/hdf5.h" and similarly "hdf5_hl.h" #2690

Closed
@robertsdionne

Description

@robertsdionne
No description provided.

Activity

changed the title [-]Ubuntu 15.05 compilation failure due to "hdf5.h" instead of "hdf5/serial/hdf5.h" and similarly "hdf5_hl.h"[/-] [+]Ubuntu 15.04 compilation failure due to "hdf5.h" instead of "hdf5/serial/hdf5.h" and similarly "hdf5_hl.h"[/+] on Jul 4, 2015
robertsdionne

robertsdionne commented on Jul 4, 2015

@robertsdionne
Author

Similarly, unable to find libhdf5 or libhdf5_hl, which are located at /usr/lib/x86_64-linux-gnu/hdf5/serial/

robertsdionne

robertsdionne commented on Jul 4, 2015

@robertsdionne
Author
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"
TheOpenSourceNinja

TheOpenSourceNinja commented on Jul 4, 2015

@TheOpenSourceNinja

A slightly simpler solution:

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
robertsdionne

robertsdionne commented on Jul 5, 2015

@robertsdionne
Author

Ah, thanks! As this goes in Makefile.config and is platform-specific, I'll close this report.

byshen

byshen commented on Nov 2, 2015

@byshen

just modify the Makefile.config works for me !
Thanks a lot 😄

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

datahack-ru

datahack-ru commented on Nov 26, 2015

@datahack-ru

It works!

cuongduc

cuongduc commented on Feb 4, 2016

@cuongduc

Thanks! It works for me

minarc

minarc commented on Feb 5, 2016

@minarc

I am on ubuntu 16.04 and it Works!

hustc12

hustc12 commented on Feb 28, 2016

@hustc12

@byshen, it works for me, thanks!

vatsal12117

vatsal12117 commented on Apr 27, 2016

@vatsal12117

how to solve this issue on ubuntu 16.04?

machisuke

machisuke commented on Jun 10, 2016

@machisuke

It works for me too. Thanks.
Version is ubuntu 15.10

han-qiu

han-qiu commented on Jun 28, 2016

@han-qiu

Thank you!
It works for me.
Ubuntu 16.04

ghost
oggata

oggata commented on Dec 7, 2016

@oggata

Thank you, it worked! Ubuntu 15.04

dweekly

dweekly commented on Dec 20, 2016

@dweekly

Can I suggest we add a commented out version of the above with a note "uncomment these to install on Ubuntu"?

olypros

olypros commented on Feb 3, 2017

@olypros

Its WORKS !!!!!

manpowre

manpowre commented on Jun 11, 2017

@manpowre

adding these in ubuntu 16.04 works:
+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/

I first verified the path exists before adding it.

GonzaBCCC

GonzaBCCC commented on Jun 14, 2017

@GonzaBCCC

did not work for me (Ubuntu 16.04)

LD -o .build_release/lib/libcaffe.so.1.0.0
/usr/bin/ld: cannot find -lhdf5_serial_h
collect2: error: ld returned 1 exit status
Makefile:573: fallo en las instrucciones para el objetivo '.build_release/lib/libcaffe.so.1.0.0'
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1

ysangkok

ysangkok commented on Jul 14, 2017

@ysangkok

@GonzaBCCC did you install the libhdf5-dev package? on Ubuntu 17.04, this actually contains hdf5-serial and development headers even though there is a package named libhdf5-serial-dev (it contains just copyright info and such)

yangyanglisjtu

yangyanglisjtu commented on Dec 26, 2017

@yangyanglisjtu

@byshen it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @robertsdionne@ysangkok@dweekly@oggata@hustc12

        Issue actions

          Ubuntu 15.04 compilation failure due to "hdf5.h" instead of "hdf5/serial/hdf5.h" and similarly "hdf5_hl.h" · Issue #2690 · BVLC/caffe