Robotics StackExchange | Archived questions

rosserial_arduino compiling problems on OS X

I've installed rosserial on Lion 10.7.2 and am having problems getting it to work with the rosserial_arduino CMake architecture. I get the following error when cross-compiling any C++ files:

avr-g++: error: x86_64: No such file or directory
avr-g++: error: unrecognized option '-arch'

This is happening because some host flags are being passed to avr-g++. Here is the command in the CMake-generated Makefile:

avr-g++    -O3  -ffunction-sections -fdata-sections -fno-tree-loop-optimize -fno-move-loop-invariants -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -I/Users/mkoval/ros/navi_stack/navi_jackal/src/ros_lib    -o CMakeFiles/navi_jackal.dir/Users/mkoval/ros/rosserial/rosserial_arduino/cmake_scripts/cc_support.cpp.o -c /Users/mkoval/ros/rosserial/rosserial_arduino/cmake_scripts/cc_support.cpp

Note the two Apple GCC specific flags -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk. These aren't in any of the rosserial_arduino CMake files and I can't figure out what is adding them to CMAKE_CXX_FLAGS.

Can anyone who is more familiar with CMake point me in the right direction?

Asked by mkoval on 2012-01-03 02:48:47 UTC

Comments

Answers