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

fails to build due to missing H5cpp.h? #41

Open
atomoclast opened this issue Mar 21, 2017 · 33 comments
Open

fails to build due to missing H5cpp.h? #41

atomoclast opened this issue Mar 21, 2017 · 33 comments

Comments

@atomoclast
Copy link

atomoclast commented Mar 21, 2017

Hello all,

I'm trying to build these packages, but I'm getting an error on map_creator:

fatal error: H5Cpp.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/hdf5_dataset.dir/src/hdf5_dataset.cpp.o] Error 1
make[1]: *** [CMakeFiles/hdf5_dataset.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
cd /home/andrew/.../build/map_creator; catkin build --get-env map_creator | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
@jontromanab
Copy link
Contributor

Hello @atomoclast ,

Have you tried installing hdf5 by

sudo apt-get install libhdf5-dev

I just realized the hdf5 library should be mentioned in CMakeLists.txt as a dependency. It will be included in the next PR. For now, it should work. Please let me know.

@atomoclast
Copy link
Author

@jontromanab ,

Thank you for the prompt reply! I already have libhdf5-dev installed and it still fails for the same reason...

I am trying to build on ros kinetic on 16.04. That may be an issue?

@atomoclast
Copy link
Author

I did read on this page that you need the H5C++ library...
http://askubuntu.com/questions/702145/c-header-files-for-hdf5-are-missing
I tried to build and it still failed....

Gonna try and build it from source...because it could be a version issue. What version of hdf5 lib are you using?
https://support.hdfgroup.org/HDF5/release/obtainsrc.html#src

@atomoclast
Copy link
Author

So. I tried to build from source. The most recent release that is.

What version are you using? Gonna try and see if I can find the source for H5C++.

@jontromanab
Copy link
Contributor

my version is 1.8.11
But I think the issue is because of Ubuntu version
Have you tried to build any other program using hdf5 ??
may be take a .h5 file and run h5dump and see the results

@atomoclast
Copy link
Author

atomoclast commented Mar 22, 2017

I think openRAVE uses hdf5. In their source, they're importing header files.

The issue is that it needs the H5Cpp.h. Which i tried to apt-get with

sudo apt-get install libhdf5-cpp-11

Still not working. So it could be a version thing or something I need to build from source.

@jontromanab
Copy link
Contributor

Yes. Openrave uses hdf5. But that is hdf5py which can be installed separately.
Do you want me to write a sample code which uses hdf5cpp. You can run that and let me know if the sample program is also having problem.(it should be if it cannot find hdf5cpp)

Have you tried to build it from source?? Please try to build from source and let me know.

The most probable reason is that the ubuntu and ROS version. We have not imported reuleaux to ros kinetic yet. We are still in indigo. If you can import that you are most welcome.

@atomoclast
Copy link
Author

So. I just build it with no issue on an indigo/14.04 machine. I'll look into why it doesn't build and fix it, then get back to you!

@geoffreychiou
Copy link
Contributor

geoffreychiou commented Mar 22, 2017

@atomoclast, A few months back I managed to get it to build on Kinetic with these changes:
https://github.com/ros-industrial-consortium/reuleaux/pull/28/files
I don't know if it still works but you might want to start there.

It was through trial and error so you may not need all of those changes.

@atomoclast
Copy link
Author

@geoffreychiou

Looks like it's failing now. It did get farther, but still fails. I'm gonna look into it more. This is more of a side project right now between a few other priorities.

Anyways. The output I got is as follows:

Errors << map_creator:make /home/andrew/Development/openrave_ws/logs/map_creator/build.make.000.log CMakeFiles/create_reachability_map.dir/src/create_reachability_map.cpp.o: In function main':
create_reachability_map.cpp:(.text+0x288a): undefined reference to hdf5_dataset::Hdf5Dataset::Hdf5Dataset(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' create_reachability_map.cpp:(.text+0x28cd): undefined reference to hdf5_dataset::Hdf5Dataset::saveReachMapsToDataset(std::multimap<std::vector<double, std::allocator > const*, std::vector<double, std::allocator > const*, std::less<std::vector<double, std::allocator > const*>, std::allocator<std::pair<std::vector<double, std::allocator > const* const, std::vector<double, std::allocator > const*> > >&, std::map<std::vector<double, std::allocator > const*, double, std::less<std::vector<double, std::allocator > const*>, std::allocator<std::pair<std::vector<double, std::allocator > const* const, double> > >&, float)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/andrew/Development/openrave_ws/devel/.private/map_creator/lib/map_creator/create_reachability_map] Error 1
make[1]: *** [CMakeFiles/create_reachability_map.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/create_capability_map.dir/src/create_capability_map.cpp.o: In function main': create_capability_map.cpp:(.text+0x3676): undefined reference to hdf5_dataset::Hdf5Dataset::Hdf5Dataset(std::__cxx11::basic_string<char, std::char_traits, std::allocator >)'
create_capability_map.cpp:(.text+0x36a5): undefined reference to hdf5_dataset::Hdf5Dataset::saveCapMapsToDataset(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, float&)' collect2: error: ld returned 1 exit status make[2]: *** [/home/andrew/Development/openrave_ws/devel/.private/map_creator/lib/map_creator/create_capability_map] Error 1 make[1]: *** [CMakeFiles/create_capability_map.dir/all] Error 2 make: *** [all] Error 2

@geoffreychiou
Copy link
Contributor

Do you have a fork of the repo I could take a look at?

@atomoclast
Copy link
Author

atomoclast commented Mar 23, 2017

@geoffreychiou, I can make and push one, but all I did was take the current master branch and just update the cmake files and package.xmls with the changes you showed me.

My forked changes are here: https://github.com/atomoclast/reuleaux/tree/kinetic-devel

@willcbaker
Copy link

tried using h5c++ compiler https://github.com/willcbaker/reuleaux/tree/feature/kinetic-devel; aborted compilation after 3 hrs and no errors printed to screen

@geoffreychiou
Copy link
Contributor

@atomoclast, I believe you may have copied the files over directly instead of just pasting over the changes.

https://github.com/geoffreychiou/reuleaux/tree/kinetic-build
Here is my fork with the changes applied.

I was able to get your fork to build by adding hdf5_dataset to the target_link_libraries of create_reachability_map and create_capability_map in map_creator/CMakeLists.txt

Example:
Old:

target_link_libraries(create_reachability_map sphere_discretization kinematics -lhdf5 -lhdf5_cpp ${catkin_LIBRARIES})

target_link_libraries(create_capability_map sphere_discretization kinematics -lhdf5 -lhdf5_cpp ${catkin_LIBRARIES})

New:

target_link_libraries(create_reachability_map sphere_discretization kinematics -lhdf5 -lhdf5_cpp hdf5_dataset ${catkin_LIBRARIES})

target_link_libraries(create_capability_map sphere_discretization kinematics -lhdf5 -lhdf5_cpp hdf5_dataset ${catkin_LIBRARIES})

I have not tested if it actually runs correctly on kinetic.

@atomoclast
Copy link
Author

@geoffreychiou

I just tested it. Everything but base_placement plugin builds on my end.

The error message i got was:

Errors << base_placement_plugin:make /home/andrew/Development/openrave_ws/logs/base_placement_plugin/build.make.000.log /home/andrew/Development/openrave_ws/src/reuleaux/base_placement_plugin/include/base_placement_plugin/point_tree_item.h:30: Note: No relevant classes found. No output generated. /home/andrew/Development/openrave_ws/src/reuleaux/base_placement_plugin/src/widgets/base_placement_widget.ui: Warning: Z-order assignment: 'horizontalSpacer' is not a valid widget. /usr/bin/ld: cannot find -lhdf5_dataset /usr/bin/ld: cannot find -lhdf5_dataset /usr/bin/ld: cannot find -lsphere_discretization /usr/bin/ld: cannot find -lkinematics /usr/bin/ld: cannot find -lhdf5_dataset /usr/bin/ld: cannot find -lsphere_discretization /usr/bin/ld: cannot find -lkinematics collect2: error: ld returned 1 exit status make[2]: *** [/home/andrew/Development/openrave_ws/devel/.private/base_placement_plugin/lib/libbase_placement_plugin.so] Error 1 make[1]: *** [CMakeFiles/base_placement_plugin.dir/all] Error 2 make: *** [all] Error 2

@jontromanab
Copy link
Contributor

@atomoclast are your sphere_discretization, kinematics and hdf5_Dataset libraries properly built from map_creator package? Have tried creating any maps and visualizing them in rviz?

It looks I have to create a kinetic branch to replicate the problems. (It is fine in indigo so far)
I am installing kinetic now. May be can tell you the results by tomorrow.

@geoffreychiou
Copy link
Contributor

@atomoclast, Have you tried doing a clean build?

If you have, push your latest changes to your git and let me see if I can replicate.

@jontromanab
Copy link
Contributor

@atomoclast have you been able to solve the problem of running reuleaux on Kinetic yet. Please let me know. I have not been able to find any computer to install kinetic yet. All my work is in indigo and and can't update it now. But if you have not solved it I can borrow a computer and install kinetic there and reproduce your problems.

@atomoclast
Copy link
Author

Hi guys, sorry for the late reply. Let me look and see, then I'll let you guys know. I have it forked on my page right now. Will update in a few.

@atomoclast
Copy link
Author

atomoclast commented Apr 24, 2017

So. I made some changes to the package XML and CMakeLists.txt file, got really close. Seems like there's some issues with HDF5 or something related. I pushed my changes to my fork for you to look at. I can start to delve into some of the issues tomorrow maybe if you don't get a chance to look at it soon.

My fork and changes can be found: https://github.com/atomoclast/reuleaux/tree/kinetic-devel

[ 67%] Generating include/base_placement_plugin/moc_place_base.cxx
Scanning dependencies of target base_placement_plugin
[ 69%] Building CXX object reuleaux/base_placement_plugin/CMakeFiles/base_placement_plugin.dir/src/add_way_point.cpp.o
[ 70%] Building CXX object reuleaux/base_placement_plugin/CMakeFiles/base_placement_plugin.dir/src/point_tree_item.cpp.o
[ 72%] Building CXX object reuleaux/base_placement_plugin/CMakeFiles/base_placement_plugin.dir/src/point_tree_model.cpp.o
[ 74%] Linking CXX executable /home/andrew/Development/manip_ws/devel/lib/map_creator/create_capability_map
[ 75%] Linking CXX executable /home/andrew/Development/manip_ws/devel/lib/map_creator/create_inverse_reachability_map
[ 77%] Linking CXX executable /home/andrew/Development/manip_ws/devel/lib/map_creator/create_reachability_map
[ 79%] Building CXX object reuleaux/base_placement_plugin/CMakeFiles/base_placement_plugin.dir/src/widgets/base_placement_widget.cpp.o
[ 79%] Built target create_inverse_reachability_map
Scanning dependencies of target workspace_visualization
[ 80%] Building CXX object reuleaux/workspace_visualization/CMakeFiles/workspace_visualization.dir/src/reachability_map_visual.cpp.o
CMakeFiles/create_reachability_map.dir/src/create_reachability_map.cpp.o: In function `main':
create_reachability_map.cpp:(.text+0x288a): undefined reference to `hdf5_dataset::Hdf5Dataset::Hdf5Dataset(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
create_reachability_map.cpp:(.text+0x28cd): undefined reference to `hdf5_dataset::Hdf5Dataset::saveReachMapsToDataset(std::multimap<std::vector<double, std::allocator<double> > const*, std::vector<double, std::allocator<double> > const*, std::less<std::vector<double, std::allocator<double> > const*>, std::allocator<std::pair<std::vector<double, std::allocator<double> > const* const, std::vector<double, std::allocator<double> > const*> > >&, std::map<std::vector<double, std::allocator<double> > const*, double, std::less<std::vector<double, std::allocator<double> > const*>, std::allocator<std::pair<std::vector<double, std::allocator<double> > const* const, double> > >&, float)'
collect2: error: ld returned 1 exit status
reuleaux/map_creator/CMakeFiles/create_reachability_map.dir/build.make:326: recipe for target '/home/andrew/Development/manip_ws/devel/lib/map_creator/create_reachability_map' failed
make[2]: *** [/home/andrew/Development/manip_ws/devel/lib/map_creator/create_reachability_map] Error 1
CMakeFiles/Makefile2:2072: recipe for target 'reuleaux/map_creator/CMakeFiles/create_reachability_map.dir/all' failed
make[1]: *** [reuleaux/map_creator/CMakeFiles/create_reachability_map.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 82%] Building CXX object reuleaux/workspace_visualization/CMakeFiles/workspace_visualization.dir/src/reachability_map_display.cpp.o
CMakeFiles/create_capability_map.dir/src/create_capability_map.cpp.o: In function `main':
create_capability_map.cpp:(.text+0x3676): undefined reference to `hdf5_dataset::Hdf5Dataset::Hdf5Dataset(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
create_capability_map.cpp:(.text+0x36a5): undefined reference to `hdf5_dataset::Hdf5Dataset::saveCapMapsToDataset(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, float&)'
collect2: error: ld returned 1 exit status
reuleaux/map_creator/CMakeFiles/create_capability_map.dir/build.make:326: recipe for target '/home/andrew/Development/manip_ws/devel/lib/map_creator/create_capability_map' failed
make[2]: *** [/home/andrew/Development/manip_ws/devel/lib/map_creator/create_capability_map] Error 1
CMakeFiles/Makefile2:682: recipe for target 'reuleaux/map_creator/CMakeFiles/create_capability_map.dir/all' failed
make[1]: *** [reuleaux/map_creator/CMakeFiles/create_capability_map.dir/all] Error 2
[ 83%] Building CXX object reuleaux/workspace_visualization/CMakeFiles/workspace_visualization.dir/src/capability_map_visual.cpp.o
[ 85%] Building CXX object reuleaux/workspace_visualization/CMakeFiles/workspace_visualization.dir/src/capability_map_display.cpp.o
[ 87%] Building CXX object reuleaux/workspace_visualization/CMakeFiles/workspace_visualization.dir/workspace_visualization_automoc.cpp.o
[ 88%] Building CXX object reuleaux/base_placement_plugin/CMakeFiles/base_placement_plugin.dir/src/place_base.cpp.o
[ 90%] Building CXX object reuleaux/base_placement_plugin/CMakeFiles/base_placement_plugin.dir/include/base_placement_plugin/moc_add_way_point.cxx.o
[ 91%] Building CXX object reuleaux/base_placement_plugin/CMakeFiles/base_placement_plugin.dir/include/base_placement_plugin/moc_point_tree_item.cxx.o
[ 93%] Building CXX object reuleaux/base_placement_plugin/CMakeFiles/base_placement_plugin.dir/include/base_placement_plugin/moc_point_tree_model.cxx.o
[ 95%] Building CXX object reuleaux/base_placement_plugin/CMakeFiles/base_placement_plugin.dir/include/base_placement_plugin/widgets/moc_base_placement_widget.cxx.o
[ 96%] Linking CXX shared library /home/andrew/Development/manip_ws/devel/lib/libworkspace_visualization.so
[ 96%] Built target workspace_visualization
[ 98%] Building CXX object reuleaux/base_placement_plugin/CMakeFiles/base_placement_plugin.dir/include/base_placement_plugin/moc_place_base.cxx.o
[100%] Linking CXX shared library /home/andrew/Development/manip_ws/devel/lib/libbase_placement_plugin.so
[100%] Built target base_placement_plugin
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

@hemangchawla
Copy link

hemangchawla commented May 11, 2017

@atomoclast modify the link directories in the CMakeLists.txt to

link_directories("/usr/lib/x86_64-linux-gnu/hdf5/openmpi" "~/catkin_ws/devel/lib")

Not the best of ways, but that worked for me. The base_placement plugin compiles as well.

However when I add it in rviz panel, it crashes.

@jontromanab
Copy link
Contributor

jontromanab commented May 24, 2017

Hello @atomoclast @geoffreychiou @willcbaker @hemangchawla
Sorry for the delay in the solution. But here is the solution to run Reuleaux on Kinetic.

https://github.com/jontromanab/reuleaux/tree/kinetic-devel

I am not very familiar with Kinetic. So please test this on your systems, before I ask @akgoins to merge it in the main repository and please let me know about the results.

Thank you everybody for your patience.

@skohlbr
Copy link

skohlbr commented Nov 22, 2017

Just also ran into this on Kinetic. Will try the fork with the kinetic-devel branch posted by @jontromanab once I find some spare time. Anybody merged those changes with current master? :)

@jontromanab
Copy link
Contributor

@skohlbr please let me know if the solution works.

@Maverobot
Copy link

@jontromanab The kinect-devel branch from your fork works! Thanks!

@vajrag
Copy link

vajrag commented Jun 6, 2018

Hey @jontromanab!

I did follow this, reinstalled hdf5 using this command sudo apt-get install libhdf5-dev and it is the newest version.
I have cloned this version https://github.com/jontromanab/reuleaux/tree/kinetic-devel of the repo. But I still face the issue

@jontromanab
Copy link
Contributor

@vajrag Do you have any way to test if the hdf5 library is working separately. Most of the forks from the kinetic branch generally work. Is there any way to see your fork?

@blubbi321
Copy link

Hey @jontromanab!

I did follow this, reinstalled hdf5 using this command sudo apt-get install libhdf5-dev and it is the newest version.
I have cloned this version https://github.com/jontromanab/reuleaux/tree/kinetic-devel of the repo. But I still face the issue

I had the same issue and it turned out I just forgot to change the branch after checkout ;)

@JuliusSustarevas
Copy link

JuliusSustarevas commented May 20, 2019

This issue appears again in melodic, any advice?
https://github.com/jontromanab/reuleaux/tree/kinetic-devel did not work.

@tunguyenmta
Copy link

This issue appears again in melodic, any advice?
https://github.com/jontromanab/reuleaux/tree/kinetic-devel did not work.

Hey @jontromanab!
I did follow this, reinstalled hdf5 using this command sudo apt-get install libhdf5-dev and it is the newest version.
I have cloned this version https://github.com/jontromanab/reuleaux/tree/kinetic-devel of the repo. But I still face the issue

I had the same issue and it turned out I just forgot to change the branch after checkout ;)

As a long time searching on the internet I have just built the package 100%
firstly, you need to find the path to the H5Cpp.h in my case it is /usr/include/hdf5/serial/
then you can use terminal and export or add export CPATH=/usr/include/hdf5/serial/ in bashrc
and when compile you will face another issue that is about /usr/bin/ld: cannot find -lhdf5
in my case once again we need to find the path of libhdf5.so and use terminal sudo cp yourpath/libhdf5.so /usr/lib
Hope it's useful
Tu_Mo

@daominhson
Copy link

This issue appears again in melodic, any advice?
https://github.com/jontromanab/reuleaux/tree/kinetic-devel did not work.

Hey @jontromanab!
I did follow this, reinstalled hdf5 using this command sudo apt-get install libhdf5-dev and it is the newest version.
I have cloned this version https://github.com/jontromanab/reuleaux/tree/kinetic-devel of the repo. But I still face the issue

I had the same issue and it turned out I just forgot to change the branch after checkout ;)

As a long time searching on the internet I have just built the package 100%
firstly, you need to find the path to the H5Cpp.h in my case it is /usr/include/hdf5/serial/
then you can use terminal and export or add export CPATH=/usr/include/hdf5/serial/ in bashrc
and when compile you will face another issue that is about /usr/bin/ld: cannot find -lhdf5
in my case once again we need to find the path of libhdf5.so and use terminal sudo cp yourpath/libhdf5.so /usr/lib
Hope it's useful
Tu_Mo

huhuhu

@sidml
Copy link

sidml commented Nov 21, 2019

I got this error in melodic. I resolved it by linking both hdf5 and hdf5_cpp.

In cmake file i added the following
target_link_libraries(basic_shapes hdf5 hdf5_cpp ${catkin_LIBRARIES} )

@Kaushik093
Copy link

In file included from /home/kaushik/catkin_ws/src/reuleaux/map_creator/src/hdf5_dataset.cpp:1: /home/kaushik/catkin_ws/src/reuleaux/map_creator/include/map_creator/hdf5_dataset.h:3:10: fatal error: H5cpp.h: No such file or directory 3 | #include "H5cpp.h" | ^~~~~~~~~ compilation terminated. make[2]: *** No rule to make target '/opt/ros/noetic/lib/liboctomap.so.1.9.8', needed by '/home/kaushik/catkin_ws/devel/lib/libsphere_discretization.so'. Stop. make[2]: *** [reuleaux/map_creator/CMakeFiles/hdf5_dataset.dir/build.make:63: reuleaux/map_creator/CMakeFiles/hdf5_dataset.dir/src/hdf5_dataset.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:4923: reuleaux/map_creator/CMakeFiles/sphere_discretization.dir/all] Error 2 make[1]: *** [CMakeFiles/Makefile2:4869: reuleaux/map_creator/CMakeFiles/hdf5_dataset.dir/all] Error 2 [ 2%] Built target pcl_msgs_generate_messages_eus [ 2%] Built target _map_creator_generate_messages_check_deps_WorkSpace [ 2%] Built target _map_creator_generate_messages_check_deps_capShape [ 2%] Built target _map_creator_generate_messages_check_deps_WsSphere [ 2%] Built target _map_creator_generate_messages_check_deps_capability make: *** [Makefile:141: all] Error 2 Invoking "make -j8 -l8" failed

This was the error I faced on map_creator
I am trying to build on ROS-noetic
How do I rectify this?

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