Skip to content

add HDF5_INCLUDE_DIR for compiled with Caffe#453

Closed
mylxiaoyi wants to merge 1 commit intoopencv:masterfrom
mylxiaoyi:myfeature
Closed

add HDF5_INCLUDE_DIR for compiled with Caffe#453
mylxiaoyi wants to merge 1 commit intoopencv:masterfrom
mylxiaoyi:myfeature

Conversation

@mylxiaoyi
Copy link
Copy Markdown

add HDF5_INCLUDE_DIR and HDF5_INCLUDE_LIBS to modules/cnn_3dobj/CMakeLists.txt for compile OpenCV with Caffe.

For Debian-based Linux Systems, HDF5_INCLUDE_DIR may be /usr/include/hdf5/serial or /usr/include/hdf5/openmpi. If Caffe is compiled with HD5, this may be a problem.

@vpisarev vpisarev assigned vpisarev and mshabunin and unassigned vpisarev Dec 10, 2015
@vpisarev
Copy link
Copy Markdown
Contributor

@mylxiaoyi, thanks! may I ask you (and @mshabunin) - what happends if Caffe is compiled without HDF5, i.e. Caffe is there, but HDF5 is not? will cnn_3dobj still compile?

@mshabunin
Copy link
Copy Markdown
Contributor

@vpisarev , this module is broken and should be fixed first. We does not build it on buildbot because it depends on caffe which is not installed on the buildslave.
Some of the problems:

  • some samples include wrong headers (example)
  • some samples probably depend on opencv_features2d and opencv_calib3d which are not added to the module dependencies, thus are not added to the samples dependencies (same example)
  • one of the source files is being rewritten during build process (cmake command)
  • one of the included caffe headers is obsolete (here)

AFAIK, caffe has switched to HDF5 format by default and probably can not be built without HDF5 library (BVLC/caffe#2836).

There are two build systems available for caffe: cmake and Makefile. There is a chance that cmake will be chosen as the default (and the only?) BS at some time (BVLC/caffe#3351). Maybe using standard cmake find_package for linking with caffe could be better choice.

@mylxiaoyi
Copy link
Copy Markdown
Author

@vpisarev , I test again, and find that caffe header file include/caffe/data_layers.hpp includes hdf5.h, so can not find hdf5.h when compiling and can not find libhdf5.so when linking.

I also noticed that the header files in caffe have been changed, so the error message now is opencv_contrib/modules/cnn_3dobj/include/opencv2/cnn_3dobj.hpp:68:35: fatal error: caffe/vision_layers.hpp: no such file or directory

@paroj
Copy link
Copy Markdown
Contributor

paroj commented Dec 8, 2016

using this version of caffe: BVLC/caffe#5019 with HDF5 enabled and compiled using the CMake build system, I did not have to add the above includes to opencv.

AFAIK @sovrasov compiled the module as well.

@mshabunin
Copy link
Copy Markdown
Contributor

@paroj , thank you!

@mshabunin mshabunin closed this Dec 8, 2016
allnes pushed a commit to allnes/opencv_contrib that referenced this pull request Jun 9, 2024
* Fixing ARM plugin tests

* Updated cmake options names

* Fixes
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

Successfully merging this pull request may close these issues.

4 participants