ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Rosmake rosconsole fail on OSx Lion

asked 2011-11-29 22:43:25 -0600

LucaGhera gravatar image

updated 2012-02-24 14:19:09 -0600

Kevin gravatar image

Hi all,

I'm trying building ros under osx Lion by following the tutorial reported on the ROS website. I have installed macports and the latest version of XCode.

I applied the patch reported here: https://code.ros.org/trac/ros/ticket/3626 Otherwise the compilation of rosconsole still fails with the following error:

mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
[rosbuild] Building package rosconsole
[rosbuild] Including /Users/luca/Software/ros/electric/ros_comm/clients/roslisp/cmake/roslisp.cmake
[rosbuild] Including /Users/luca/Software/ros/electric/ros_comm/clients/rospy/cmake/rospy.cmake
[rosbuild] Including /Users/luca/Software/ros/electric/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHAIN_FILE


-- Build files have been written to: /Users/luca/Software/ros/electric/ros_comm/tools/rosconsole/build
cd build && make -l8
[  0%] Built target rospack_genmsg_libexe
[  0%] Built target rosbuild_precompile
Linking CXX shared library ../lib/librosconsole.dylib
clang: warning: argument unused during compilation: '-pthread'
ld: library not found for -llog4cxx
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [../lib/librosconsole.dylib] Error 1
make[2]: *** [CMakeFiles/rosconsole.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

It seems that it is not able to find log4cxx. Otherwise it is installed through macport and the .profile file is configured for seeing it. This is my .profile:

# MacPorts Installer addition on 2011-10-21_at_13:20:04: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

# ROS
source /Users/luca/Software/ros/electric/setup.bash
[ -f ~/.git-bash-completion.sh ] && . ~/.git-bash-completion.sh

# define colors
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad

export CPATH=/opt/local/include:/usr/local/include
export LIBRARY_PATH=/opt/local/lib:/usr/local/lib:/usr/lib/
export LD_LIBRARY_PATH=/opt/local/lib:/usr/local/lib
export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/opt/local/lib:/opt/local/Library/Frameworks:/usr/local/lib:/usr/lib/

Is there a know solution?

Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2011-12-04 04:35:06 -0600

Kevin gravatar image

If you are not married to Macports, William has also done a lot of good work getting ROS up and running using Homebrew. This is how I installed ROS on Lion and it was pretty painless.

edit flag offensive delete link more

Comments

@Kevin Can MacPort and Homebrew coexist? I'm using macport for other stuff...
LucaGhera gravatar image LucaGhera  ( 2011-12-04 23:21:30 -0600 )edit
You really shouldn't because both ports and brew will want to install some of the same stuff (e.g., cmake, cairo, boost, etc) depending on what you need. You may get conflicts with software building with one version of boost but trying to run with another (or visa versa). So it is generally not done
Kevin gravatar image Kevin  ( 2011-12-05 11:11:07 -0600 )edit
1

answered 2011-11-30 02:35:47 -0600

William gravatar image

updated 2011-12-04 04:48:42 -0600

You are trying to build it with Xcode? I would think you just need to add the path '/opt/local/lib' to your library link path in Xcode.

Here is a stack overflow talking about linking external libraries with Xcode: http://stackoverflow.com/questions/445815/linking-libraries-in-xcode

EDIT:

Sorry I misunderstood your question. Try running LDFLAGS=-L/opt/local/lib make while you are in the directory given by roscd rosconsole. I think your environment variables should have covered this but maybe they have typos or something and this will show you that if rosconsole then compiles.

Also check to make sure something like /opt/local/lib/liblog4cxx.dylib exitsts.

edit flag offensive delete link more

Comments

@William Hi, no I don't. I'm trying to build it by command line...according to the tutorial that you can find on the ROS website. Currently `/opt/local/lib` is in both `$LIBRARY_PATH` and `$LD_LIBRARY_PATH`. Thanks
LucaGhera gravatar image LucaGhera  ( 2011-11-30 02:47:19 -0600 )edit
@William Hi, fixed it by dowloading log4cxx from source, compiling and installing them...I don't think it's the good solution, but it worked...
LucaGhera gravatar image LucaGhera  ( 2011-12-04 23:27:51 -0600 )edit
@William Do you think that I have a more general problem? Rosdep also fails to find eigen, tinyxml, yaml-cpp and they are all installed through macport
LucaGhera gravatar image LucaGhera  ( 2011-12-05 00:14:07 -0600 )edit
I think so, I would manually add the CXXFLAGS and LDFLAGS to make sure it isn't some typos or something in your environment.
William gravatar image William  ( 2011-12-05 07:01:12 -0600 )edit
@William I will try it, where do I have to set this stuff? Do you have an idea of what can be wrong in my `.profile` file? I checked it and I didn't find typos. I reported it in the question. Thanks
LucaGhera gravatar image LucaGhera  ( 2011-12-05 19:47:12 -0600 )edit

Question Tools

Stats

Asked: 2011-11-29 22:43:25 -0600

Seen: 963 times

Last updated: Dec 05 '11