Compiling on OSX

I finally managed to compile toolchain-2.5 on OSX 10.7 and ROS Fuerte. Here is what I had to do.

Homebrew: antlr,cppunit,gdbm,gtest,libtiff,lua,opencv,qt,swig-wx,yaml-cpp, boost,eigen,gfortran,jasper,libyaml,mercurial,pcre,readline,tbb, cmake,gccxml,graphviz,jpeg,log4cxx,omniorb,pkg-config,swig,wget

OmniORB: I had to compile omniorb manually. The include/omniORB4/CORBA_sysdep.h file had to be replaced with the one here attached and the following line needed to be added to orocos_kinematics_dynamics/orocos_kdl/CMakeLists.txt

  set(CMAKE_OSX_ARCHITECTURES "x86_64")
SwigWx: The swig-wx.rb also had to be modified to the one attached.

Compiling orocos-toolchain-2.5: Before executing rosmake. The source had to be patched with the patch provided by: http://bugs.orocos.org/show_bug.cgi?id=971

    git clone http://git.gitorious.org/orocos-toolchain/orocos_toolchain.git
    git clone http://git.mech.kuleuven.be/robotics/rtt_ros_integration.git
    git clone http://git.mech.kuleuven.be/robotics/rtt_ros_comm.git
    git clone http://git.mech.kuleuven.be/robotics/rtt_common_msgs.git
    git clone http://git.mech.kuleuven.be/robotics/rtt_geometry.git
    
    roscd orocos_toolchain
    git submodule init
    git submodule update
    
    roscd log4cpp && git checkout toolchain-2.5
    roscd ocl && git checkout toolchain-2.5
    roscd orogen && git checkout toolchain-2.5
    roscd rtt && git checkout toolchain-2.5
    roscd rtt_typelib && git checkout toolchain-2.5
    roscd typelib && git checkout toolchain-2.5
    roscd utilmm && git checkout toolchain-2.5
    roscd utilrb && git checkout toolchain-2.5
    
    roscd orocos_toolchain
    source env.sh

    rosmake orocos_toolchain rtt_ros_integration rtt_ros_comm rtt_common_msgs rtt_geometry
Even after sourcing the env.sh, DYLD_LIBRARY_PATH had to be updated to:
     export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${OROCOS_INSTALL_ROOT}/orocos_toolchain/install/lib:${OROCOS_INSTALL_ROOT}/orocos_toolchain/install/lib/typelib

If you get fatal error: 'ros/package.h' file not found, then you can modify ocl/CMakeLists.txt to add: include_directories($ENV{ROS_ROOT}/../../include)

AttachmentSize
CORBA_sysdep.h14.07 KB
swig-wx.rb_.tar_.gz496 bytes

Re: Compiling on OSX

Hi Jean,

First of all thank you for your tutorial. I was really looking for a way of installing orocos on my macbook.

I'm trying to follow your instructions in order to build Orocos on osX Lion with ROS Fuerte.

However I reveived two errors, one with orogen and the other with ocl (see below).

Do you have any idea of how to fix it?

Thanks, Luca

Orogen

rake
cannot load oroGen
  did you install Typelib's Ruby bindings and update the RUBYLIB environment variable accordingly ?
  did you add /Users/luca/Software/ros-stacks/orocos_toolchain/orogen/lib to RUBYLIB ?
the error is: dlopen(/Users/luca/Software/ros-stacks/orocos_toolchain/.gems/gems/nokogiri-1.4.6/lib/nokogiri/nokogiri.bundle, 9): Library not loaded: /usr/local/lib/libruby.1.9.1.dylib
  Referenced from: /Users/luca/Software/ros-stacks/orocos_toolchain/.gems/gems/nokogiri-1.4.6/lib/nokogiri/nokogiri.bundle
  Reason: image not found - /Users/luca/Software/ros-stacks/orocos_toolchain/.gems/gems/nokogiri-1.4.6/lib/nokogiri/nokogiri.bundle
  /Users/luca/Software/ros-stacks/orocos_toolchain/.gems/gems/nokogiri-1.4.6/lib/nokogiri/nokogiri.bundle
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
  /Users/luca/Software/ros-stacks/orocos_toolchain/.gems/gems/nokogiri-1.4.6/lib/nokogiri.rb:13
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
  /Users/luca/Software/ros-stacks/orocos_toolchain/typelib/bindings/ruby/lib/typelib-gccxml.rb:3
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
  /Users/luca/Software/ros-stacks/orocos_toolchain/typelib/bindings/ruby/lib/typelib.rb:2438
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
  /Users/luca/Software/ros-stacks/orocos_toolchain/orogen/Rakefile:6
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2383:in `load'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2383:in `raw_load_rakefile'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2017:in `load_rakefile'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2016:in `load_rakefile'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2000:in `run'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rake.rb:1998:in `run'
  /usr/bin/rake:31
(in /Users/luca/Software/ros-stacks/orocos_toolchain/orogen)
make: *** [install] Error 1

Ocl

mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX=`rospack find rtt`/../install -DBUILD_TESTING=OFF ..
Orocos Component Library version  (2.5.0)
No orocos-ocl.cmake file loaded, using default settings.See orocos-ocl.default.cmake
Orocos-RTT found in /Users/luca/Software/ros-stacks/orocos_toolchain/install/lib/cmake/orocos-rtt/orocos-rtt-macosx-libraries.cmake
-- Found orocos-rtt 2.5.0 for the macosx target. Available transports: corba
[UseOrocos] Building package ocl
Found 3 nodes:
-- NODE --
-- NODE --
-- NODE --
 
Looking for netcdf in /Users/luca/Software/ros-stacks/orocos_toolchain/install
  Can't find NETCDF
Found Doxygen -- documentation can be built
-- Looking for curses implementation - found libncurses
-- Looking for readline/readline.h - found
-- Looking for editline/readline.h - found
Log4cpp version to look for: 6.0.0 (hard-coded in FindLog4cpp.cmake).
File  /usr/local/lib/liblog4cpp.6.0.0.dylib does not exist. Are you using the Orocos' version of log4cpp ?
  Use CMAKE_PREFIX_PATH to point to the install directory of the Orocos maintained log4cpp library.
Found log4cpp in /usr/local/include
Found log4cxx in /usr/local/include
[UseOrocos] Building component orocos-ocl-common in library orocos-ocl-common
[UseOrocos] Building typekit library ocl
[UseOrocos] Building plugin library print
[UseOrocos] Building plugin library os
[UseOrocos] Generating package version 2.5.0 from COMPONENT_VERSION.
[UseOrocos] Generating package version 2.5.0 from COMPONENT_VERSION.
Building TaskBrowser with readline support.
-- Found orocos-rtt 2.5.0 for the macosx target. Available transports: corba
-- Found RTT_PLUGIN_rtt-scripting_macosx 
[UseOrocos] Building library orocos-ocl-taskbrowser
[UseOrocos] Generating package version 2.5.0 from COMPONENT_VERSION.
[UseOrocos] Building component orocos-ocl-timer in library orocos-ocl-timer
[UseOrocos] Generating package version 2.5.0 from COMPONENT_VERSION.
[UseOrocos] Building component orocos-ocl-helloworld in library orocos-ocl-helloworld
-- Found orocos-rtt 2.5.0 for the macosx target. Available transports: corba
-- Found RTT_PLUGIN_rtt-marshalling_macosx 
[UseOrocos] Building component orocos-ocl-reporting in library orocos-ocl-reporting
[UseOrocos] Generating package version 2.5.0 from COMPONENT_VERSION.
-- Found orocos-rtt 2.5.0 for the macosx target. Available transports: corba
-- Found RTT_PLUGIN_rtt-marshalling_macosx 
-- Found RTT_PLUGIN_rtt-scripting_macosx 
[UseOrocos] Building library orocos-ocl-deployment
[UseOrocos] Building library orocos-ocl-deployment-corba
[UseOrocos] Generating package version 2.5.0 from COMPONENT_VERSION.
Building executable deployer
Building executable rttscript
Building executable ctaskbrowser
Building executable cdeployer
Building executable deployer-corba
[UseOrocos] Building component orocos-ocl-logging in library orocos-ocl-logging
[UseOrocos] Building library orocos-ocl-log4cpp
[UseOrocos] Building component orocos-ocl-log4cxx in library orocos-ocl-log4cxx
[UseOrocos] Generating package version 2.5.0 from COMPONENT_VERSION.
[UseOrocos] Building component orocos-ocl-lua in library orocos-ocl-lua
Building executable rttlua
[UseOrocos] Building component orocos-ocl-lua-tlsf in library orocos-ocl-lua-tlsf
Building executable rttlua-tlsf
[UseOrocos] Building plugin library rttlua-plugin
[UseOrocos] Building plugin library rttlua-tlsf-plugin
[UseOrocos] Generating package version 2.5.0 from COMPONENT_VERSION.
Selected Libraries: 
-- 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-stacks/orocos_toolchain/ocl/build
cd build && make -l8
Use: make\ docapi\ dochtml\ docpdf to build the documentation.
[  0%] Built target message
Linking CXX shared library libocl.dylib
[  1%] Built target ocl
Linking CXX shared library liborocos-ocl-common.dylib
[  5%] Built target orocos-ocl-common
Linking CXX shared library libos.dylib
[  7%] Built target os
Linking CXX shared library libprint.dylib
[  9%] Built target print
[ 11%] Building CXX object taskbrowser/CMakeFiles/orocos-ocl-taskbrowser.dir/TaskBrowser.cpp.o
/Users/luca/Software/ros-stacks/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp:172:13: error: use of undeclared identifier 'rl_resize_terminal'; did you mean 'rl_reset_terminal'?
            rl_resize_terminal();
            ^~~~~~~~~~~~~~~~~~
            rl_reset_terminal
/usr/include/readline/readline.h:181:8: note: 'rl_reset_terminal' declared here
void             rl_reset_terminal(const char *);
                 ^
/Users/luca/Software/ros-stacks/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp:172:32: error: too few arguments to function call, expected 1, have 0
            rl_resize_terminal();
            ~~~~~~~~~~~~~~~~~~ ^
/usr/include/readline/readline.h:181:1: note: 'rl_reset_terminal' declared here
void             rl_reset_terminal(const char *);
^
/Users/luca/Software/ros-stacks/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp:210:13: error: use of undeclared identifier 'rl_set_signals'
        if (rl_set_signals() != 0)
            ^
/Users/luca/Software/ros-stacks/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp:649:9: error: use of undeclared identifier 'rl_catch_sigwinch'
        rl_catch_sigwinch = 0;
        ^
/Users/luca/Software/ros-stacks/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp:729:12: error: use of undeclared identifier 'rl_catch_signals'
        if(rl_catch_signals == 0)
           ^
/Users/luca/Software/ros-stacks/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp:731:13: error: use of undeclared identifier 'rl_set_signals'
        if (rl_set_signals() != 0)
            ^
6 errors generated.
make[3]: *** [taskbrowser/CMakeFiles/orocos-ocl-taskbrowser.dir/TaskBrowser.cpp.o] Error 1
make[2]: *** [taskbrowser/CMakeFiles/orocos-ocl-taskbrowser.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

jfdupuis wrote:
I finally managed to compile toolchain-2.5 on OSX 10.7 and ROS Fuerte. Here is what I had to do.

Homebrew: antlr,cppunit,gdbm,gtest,libtiff,lua,opencv,qt,swig-wx,yaml-cpp, boost,eigen,gfortran,jasper,libyaml,mercurial,pcre,readline,tbb, cmake,gccxml,graphviz,jpeg,log4cxx,omniorb,pkg-config,swig,wget

OmniORB: I had to compile omniorb manually. The include/omniORB4/CORBA_sysdep.h file had to be replaced with the one here attached and the following line needed to be added to orocos_kinematics_dynamics/orocos_kdl/CMakeLists.txt

  set(CMAKE_OSX_ARCHITECTURES "x86_64")
SwigWx: The swig-wx.rb also had to be modified to the one attached.

Compiling orocos-toolchain-2.5: Before executing rosmake. The source had to be patched with the patch provided by: http://bugs.orocos.org/show_bug.cgi?id=971

    git clone http://git.gitorious.org/orocos-toolchain/orocos_toolchain.git
    git clone http://git.mech.kuleuven.be/robotics/rtt_ros_integration.git
    git clone http://git.mech.kuleuven.be/robotics/rtt_ros_comm.git
    git clone http://git.mech.kuleuven.be/robotics/rtt_common_msgs.git
    git clone http://git.mech.kuleuven.be/robotics/rtt_geometry.git
    
    roscd orocos_toolchain
    git submodule init
    git submodule update
    
    roscd log4cpp && git checkout toolchain-2.5
    roscd ocl && git checkout toolchain-2.5
    roscd orogen && git checkout toolchain-2.5
    roscd rtt && git checkout toolchain-2.5
    roscd rtt_typelib && git checkout toolchain-2.5
    roscd typelib && git checkout toolchain-2.5
    roscd utilmm && git checkout toolchain-2.5
    roscd utilrb && git checkout toolchain-2.5
    
    roscd orocos_toolchain
    source env.sh

    rosmake orocos_toolchain rtt_ros_integration rtt_ros_comm rtt_common_msgs rtt_geometry
Even after sourcing the env.sh, DYLD_LIBRARY_PATH had to be updated to:
     export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${OROCOS_INSTALL_ROOT}/orocos_toolchain/install/lib:${OROCOS_INSTALL_ROOT}/orocos_toolchain/install/lib/typelib

If you get fatal error: 'ros/package.h' file not found, then you can modify ocl/CMakeLists.txt to add: include_directories($ENV{ROS_ROOT}/../../include)