Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
robertsdionne opened this issue Jul 4, 2015 · 20 comments

Comments

@robertsdionne
Copy link

No description provided.

@robertsdionne robertsdionne 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" Jul 4, 2015
@robertsdionne
Copy link
Author

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

@robertsdionne
Copy link
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
Copy link

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
Copy link
Author

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

@byshen
Copy link

byshen commented Nov 2, 2015

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
Copy link

It works!

@cuongduc
Copy link

cuongduc commented Feb 4, 2016

Thanks! It works for me

@minarc
Copy link

minarc commented Feb 5, 2016

I am on ubuntu 16.04 and it Works!

@hustc12
Copy link

hustc12 commented Feb 28, 2016

@byshen, it works for me, thanks!

@vatsal12117
Copy link

how to solve this issue on ubuntu 16.04?

@machisuke
Copy link

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

@han-qiu
Copy link

han-qiu commented Jun 28, 2016

Thank you!
It works for me.
Ubuntu 16.04

@ghost
Copy link

ghost commented Sep 17, 2016

Thank you, it worked! Ubuntu 16.04

@oggata
Copy link

oggata commented Dec 7, 2016

Thank you, it worked! Ubuntu 15.04

@dweekly
Copy link

dweekly commented Dec 20, 2016

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

@olypros
Copy link

olypros commented Feb 3, 2017

Its WORKS !!!!!

@manpowre
Copy link

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
Copy link

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
Copy link

@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
Copy link

@byshen it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests