tu-darmstadt-ros-pkg / hector_localization

The hector_localization stack is a collection of packages, that provide the full 6DOF pose of a robot or platform.
83 stars 61 forks source link

Building on OS X Mavericks... #4

Closed rasit closed 9 years ago

rasit commented 10 years ago

Hi,

I've successfully (with some pain and minor modifications, but...) built desktop_full on OS X Mavericks. However, after adding the hector_quadrotor package and it dependencies, I started getting problems. Here is the command that I ran:

raspberry:catkin_ws rasit$ VERBOSE=1 ./src/catkin/bin/catkin_make_isolated --pkg hector_pose_estimation_core -j1

[ 4%] Building CXX object CMakeFiles/hector_pose_estimation.dir/src/global_reference.cpp.o /usr/bin/c++ -DROSCONSOLE_BACKEND_LOG4CXX -DROS_PACKAGE_NAME=\"hector_pose_estimation_core\" -Dhector_pose_estimation_EXPORTS -fPIC -I/usr/local/Cellar/eigen/3.2.1/include/eigen3 -I/Volumes/Data/ZProjects/ROS/catkin_ws/src/hector_localization/hector_localization/hector_pose_estimation_core/include -I/Volumes/Data/ZProjects/ROS/catkin_ws/install_isolated/include -I/usr/local/include -o CMakeFiles/hector_pose_estimation.dir/src/global_reference.cpp.o -c /Volumes/Data/ZProjects/ROS/catkin_ws/src/hector_localization/hector_localization/hector_pose_estimation_core/src/global_reference.cpp In file included from /Volumes/Data/ZProjects/ROS/catkin_ws/src/hector_localization/hector_localization/hector_pose_estimation_core/src/global_reference.cpp:29: In file included from /Volumes/Data/ZProjects/ROS/catkin_ws/src/hector_localization/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/global_reference.h:32: In file included from /Volumes/Data/ZProjects/ROS/catkin_ws/src/hector_localization/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/types.h:32: /Volumes/Data/ZProjects/ROS/catkin_ws/src/hector_localization/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/matrix.h:80:5: error: no template named 'DenseBase'; did you mean 'Eigen::DenseBase'? EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) ^ /usr/local/Cellar/eigen/3.2.1/include/eigen3/Eigen/src/Core/util/Macros.h:316:48: note: expanded from macro 'EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR' EIGEN_STRONG_INLINE Derived& operator=(const DenseBase& ... ^ /usr/local/Cellar/eigen/3.2.1/include/eigen3/Eigen/src/Core/DenseBase.h:41:34: note: 'Eigen::DenseBase' declared here template class DenseBase ^ In file included from /Volumes/Data/ZProjects/ROS/catkin_ws/src/hector_localization/hector_localization/hector_pose_estimation_core/src/global_reference.cpp:29: In file included from /Volumes/Data/ZProjects/ROS/catkin_ws/src/hector_localization/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/global_reference.h:32: In file included from /Volumes/Data/ZProjects/ROS/catkin_ws/src/hector_localization/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/types.h:32: Any help is greatly appreciated. --Rasit
meyerj commented 10 years ago

Which Eigen version and compiler do you use?

NikolausDemmel commented 10 years ago

Eigen version appears to be 3.2.1 and compiler on OSX 10.9 is clang, specifically:

$ clang --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

I believe subtle differences between clang and gcc and possibly some differences in the standard headers between linux/osx are the main issues here.

meyerj commented 10 years ago

Could you please verify that #5 fixes the problem?

NikolausDemmel commented 10 years ago

Thanks for looking into it. This fixes the first error. New one appears: http://pastebin.com/pLGjeU71

rasit commented 10 years ago

I'll check it soon, but I solved the sincos() problem by separating those calls into sin() and cos().

NikolausDemmel commented 10 years ago

sincos is a GNU extension and not part of standard libc. See http://www.gnu.org/software/libc/manual/html_node/Trig-Functions.html, which says on sincos: "This function is a GNU extension. Portable programs should be prepared to cope with its absence."

rasit commented 10 years ago

Yes, indeed. That's why I separated it...

NikolausDemmel commented 10 years ago

@rasit: We would need a fix that works for all platforms. Using sincos when available will be faster. Maybe a preprocessor check for GNU libc can help.

rasit commented 10 years ago

Well, the real fix is the same done by the developers, not us, the end users...

NikolausDemmel commented 10 years ago

I just argued that this is not necessarily the "real fix" as it deteriorates the situation on Linux. I'm sure the developer would welcome a pull requests, if you have already solved this. Otherwise he is spending his free time to duplicate your work.

rasit commented 10 years ago

Sure... My fix was an hint, albeit not a clear one, that the solution would be adopted by the developer. As a matter of fact, I just heard about the function (not write application code much), and think that it is a poor idea (of GNU people) to have such a mixed function in the first place.

NikolausDemmel commented 10 years ago

The reason for this extension is probably that there is hardware support for computing both sin and cos at the same time.

rasit commented 10 years ago

Any solutions for the new (as presented by Nikolaus Demmel) compiler errors? Obviously, I'm getting the same.