naibaf7 / caffe

Caffe: a fast open framework for deep learning. With OpenCL and CUDA support.
http://caffe.berkeleyvision.org/
Other
85 stars 20 forks source link

Android builds fail with H5Fis_hdf5 errors #62

Closed psyhtest closed 7 years ago

psyhtest commented 7 years ago

I observe two errors (coming from the same line) when building Caffe for Android (e.g. with ck install package:lib-caffe-bvlc-opencl-clblast-universal --target_os=android21-arm64):

src/caffe/net.cpp: In member function 'void caffe::Net<Dtype>::CopyTrainedLayersFrom(std::string)':^M
src/caffe/net.cpp:824:42: error: there are no arguments to 'H5Fis_hdf5' that depend on a template parameter, so a declaration of 'H5Fis_hdf5' must be available [-fpermissive]^M
   if (H5Fis_hdf5(trained_filename.c_str())) {^M
src/caffe/net.cpp: In instantiation of 'void caffe::Net<Dtype>::CopyTrainedLayersFrom(std::string) [with Dtype = float; std::string = std::basic_string<char>]':^M
src/caffe/net.cpp:1053:1:   required from here^M
src/caffe/net.cpp:824:42: error: 'H5Fis_hdf5' was not declared in this scope^M

As Android builds do not support HDF5, I suppose these changes must be excluded via appropriate macros.

Logs from two Ubuntu 16.04 machines:

psyhtest commented 7 years ago

The error comes from this upstream commit. I'll try to fix it.

psyhtest commented 7 years ago

@naibaf7 Thanks for merging!