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

error while building build_caffe.sh #76

Closed
gaurav16gupta opened this issue Oct 18, 2016 · 2 comments
Closed

error while building build_caffe.sh #76

gaurav16gupta opened this issue Oct 18, 2016 · 2 comments

Comments

@gaurav16gupta
Copy link

gaurav16gupta commented Oct 18, 2016

As there is not support using hdf5. How can build without it ?

In file included from /home/gaurav/deeplearning/caffe-android-lib/android_lib/opencv/sdk/native/jni/include/opencv2/core.hpp:52:0,
from /home/gaurav/deeplearning/caffe-android-lib/android_lib/opencv/sdk/native/jni/include/opencv2/core/core.hpp:48,
from /home/gaurav/deeplearning/caffe-android-lib/caffe/src/caffe/data_transformer.cpp:2:
/home/gaurav/deeplearning/caffe-android-lib/android_lib/opencv/sdk/native/jni/include/opencv2/core/cvdef.h:314:5: error: '__fp16' does not name a type
__fp16 h;
^
In file included from /home/gaurav/deeplearning/caffe-android-lib/caffe/src/caffe/solver.cpp:8:0:
/home/gaurav/deeplearning/caffe-android-lib/caffe/include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory
#include "hdf5.h"
^
compilation terminated.
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/solver.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/data_transformer.cpp.o] Error 1
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [all] Error 2

@gaurav16gupta gaurav16gupta changed the title error: '__fp16' does not name a type error while building build_caffe.sh Oct 18, 2016
@sh1r0
Copy link
Owner

sh1r0 commented Oct 18, 2016

Hi @stark123,
In my caffe fork, hdf5.h is used only with USE_HDF5 set, refer to https://github.com/sh1r0/caffe/blob/cmake_android/include/caffe/util/hdf5.hpp. If you would like to build your own caffe, you could refer to my commits and patch it by yourself. BTW, although I'm willing to help you, I have little time to deal with the issues, and I think you should provide more details (e.g., your setups, custom builds?) in your issues (i.e., #73, #74, and this one).
Thanks.

@sh1r0 sh1r0 closed this as completed Nov 1, 2016
@adityakamble49
Copy link

adityakamble49 commented Apr 26, 2018

@sh1r0 I am trying to build this with hdf5 support
getting include error for
#include "hdf5.h"

Scanning dependencies of target caffe_jni
[ 98%] Linking CXX executable cpp_classification/classification
[ 98%] Built target classification
[ 98%] Building CXX object android/CMakeFiles/caffe_jni.dir/caffe_jni.cpp.o
[100%] Building CXX object android/CMakeFiles/caffe_jni.dir/caffe_mobile.cpp.o
In file included from /home/aditya/workspace/caffe-android-lib/caffe/android/caffe_jni.cpp:19:0:
/home/aditya/workspace/caffe-android-lib/caffe/include/caffe/layers/hdf5_output_layer.hpp:4:18: fatal error: hdf5.h: No such file or directory
 #include "hdf5.h"
                  ^
compilation terminated.
android/CMakeFiles/caffe_jni.dir/build.make:62: recipe for target 'android/CMakeFiles/caffe_jni.dir/caffe_jni.cpp.o' failed
make[2]: *** [android/CMakeFiles/caffe_jni.dir/caffe_jni.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:1053: recipe for target 'android/CMakeFiles/caffe_jni.dir/all' failed
make[1]: *** [android/CMakeFiles/caffe_jni.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

I have checked out cmake_android branch

I have tried solution provided on this issue
can't find hdf5.h when build caffe

Created libhdf5.so and libhdf5_hl.so symlinks

caffe-android-lib $ ls -l /usr/lib/x86_64-linux-gnu/ | grep libhdf5
-rw-r--r--  1 root root  6075302 Apr  6  2016 libhdf5_cpp.a
lrwxrwxrwx  1 root root       21 Apr  6  2016 libhdf5_cpp.so -> libhdf5_cpp.so.11.0.0
lrwxrwxrwx  1 root root       21 Apr  6  2016 libhdf5_cpp.so.11 -> libhdf5_cpp.so.11.0.0
-rw-r--r--  1 root root   402080 Apr  6  2016 libhdf5_cpp.so.11.0.0
-rw-r--r--  1 root root    40108 Apr  6  2016 libhdf5_hl_cpp.a
lrwxrwxrwx  1 root root       24 Apr  6  2016 libhdf5_hl_cpp.so -> libhdf5_hl_cpp.so.11.0.0
lrwxrwxrwx  1 root root       24 Apr  6  2016 libhdf5_hl_cpp.so.11 -> libhdf5_hl_cpp.so.11.0.0
-rw-r--r--  1 root root    14688 Apr  6  2016 libhdf5_hl_cpp.so.11.0.0
lrwxrwxrwx  1 root root       27 Apr 26 16:34 libhdf5_hl.so -> libhdf5_serial_hl.so.10.0.2
-rw-r--r--  1 root root 19953086 Apr  6  2016 libhdf5_serial.a
-rw-r--r--  1 root root  1659560 Apr  6  2016 libhdf5_serial_fortran.a
lrwxrwxrwx  1 root root       32 Apr  6  2016 libhdf5_serial_fortran.so -> libhdf5_serial_fortran.so.10.0.2
lrwxrwxrwx  1 root root       32 Apr  6  2016 libhdf5_serial_fortran.so.10 -> libhdf5_serial_fortran.so.10.0.2
-rw-r--r--  1 root root   238408 Apr  6  2016 libhdf5_serial_fortran.so.10.0.2
-rw-r--r--  1 root root   878832 Apr  6  2016 libhdf5_serial_hl.a
-rw-r--r--  1 root root   515320 Apr  6  2016 libhdf5_serialhl_fortran.a
lrwxrwxrwx  1 root root       34 Apr  6  2016 libhdf5_serialhl_fortran.so -> libhdf5_serialhl_fortran.so.10.0.2
lrwxrwxrwx  1 root root       34 Apr  6  2016 libhdf5_serialhl_fortran.so.10 -> libhdf5_serialhl_fortran.so.10.0.2
-rw-r--r--  1 root root    80520 Apr  6  2016 libhdf5_serialhl_fortran.so.10.0.2
lrwxrwxrwx  1 root root       27 Apr  6  2016 libhdf5_serial_hl.so -> libhdf5_serial_hl.so.10.0.2
lrwxrwxrwx  1 root root       27 Apr  6  2016 libhdf5_serial_hl.so.10 -> libhdf5_serial_hl.so.10.0.2
-rw-r--r--  1 root root   126232 Apr  6  2016 libhdf5_serial_hl.so.10.0.2
-rw-r--r--  1 root root     3859 Apr  6  2016 libhdf5_serial.settings
lrwxrwxrwx  1 root root       24 Apr  6  2016 libhdf5_serial.so -> libhdf5_serial.so.10.1.0
lrwxrwxrwx  1 root root       24 Apr  6  2016 libhdf5_serial.so.10 -> libhdf5_serial.so.10.1.0
-rw-r--r--  1 root root  2734288 Apr  6  2016 libhdf5_serial.so.10.1.0
lrwxrwxrwx  1 root root       24 Apr 26 16:33 libhdf5.so -> libhdf5_serial.so.10.1.0

Added path for hdf5.h in caffe-android-lib/caffe/Makefile as follows

INCLUDE_DIRS := /usr/local/include /usr/include/hdf5/serial/
LIBRARY_DIRS := /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/ 

as it has header files for hdf5 which are need to build caffe

caffe-android-lib $ ls /usr/include/hdf5/serial/ | grep hdf
hdf5.h
hdf5_hl.h
hdf5.mod

Still getting include error for
#include "hdf5.h"

Am I missing something?

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

3 participants