Difference between revisions of "YARP on Mac"

From Wiki for iCub and Friends
Jump to: navigation, search
Line 1: Line 1:
 +
I don't know much about OSX; this is a log of a random YARP install by an OSX newbie.
 +
Information about machine from uname -a:
 +
  Darwin foo.bar.edu 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep  8 17:18:57 PDT 2006;
 +
  root:xnu-.../RELEASE_PPC Power Macintosh powerpc
 +
 +
Followed the generic [http://eris.liralab.it/yarp/specs/dox/user/html/install.html YARP Install Notes] for UNIX.  Only deviations from these notes (or choices left open in these notes) are listed here.
 +
 +
== ACE ==
 +
* Fetched http://deuce.doc.wustl.edu/ACE-5.5.tar.gz
 +
* Used platform_macosx-tiger.GNU for platform_macros.GNU step of ACE installation.
 +
* Used config-macosx-tiger.h for config.h step of ACE installation.
 +
* Generic instructions for UNIX worked fine.  Got:
 +
  ACE_wrappers/lib/libACE.dylib
 +
  ACE_wrappers/lib/libACE_SSL.dylib
 +
* I set some variables in my ~/.bash_profile file:
 +
  export ACE_ROOT=$HOME/cvs/ACE_wrappers
 +
  export LD_LIBRARY_PATH=$ACE_ROOT/lib:$LD_LIBRARY_PATH
 +
  export DYLD_LIBRARY_PATH=$ACE_ROOT/lib:$DYLD_LIBRARY_PATH
 +
 +
For YARP on an Intel flavor of OSX, make sure you're using a version of the ACE library after October 2006 (the ACE ChangeLog suggests that's when support was introduced).
 +
 +
For example, version 5.5.4, available from:
 +
* http://download.dre.vanderbilt.edu/previous_versions/
 +
 +
== CMake ==
 +
* Fetched http://www.cmake.org/files/v2.4/cmake-2.4.4-Darwin-universal.tar.gz
 +
* This darwin universal binary worked just fine.
 +
* I added the path to cmake in my ~/.bash_profile file:
 +
  export PATH=$PATH:$HOME/cvs/cmake/bin
 +
 +
== YARP ==
 +
* Fetched YARP from CVS using anonymous checkout (blank password).  This was a slow process.
 +
* I ran cmake in the YARP directory and it worked fine:
 +
  $ cmake .
 +
  -- Check for working C compiler: /usr/bin/gcc
 +
  -- Check for working C compiler: /usr/bin/gcc -- works
 +
  -- Check size of void*
 +
  -- Check size of void* - done
 +
  -- Check for working CXX compiler: /usr/bin/c++
 +
  -- Check for working CXX compiler: /usr/bin/c++ -- works
 +
  -- Check if the system is big endian
 +
  -- Check if the system is big endian - big endian
 +
  -- Found ACE library: /Users/paulfitz/cvs/ACE_wrappers/lib/libACE.dylib
 +
  -- Found ACE include: /Users/paulfitz/cvs/yarp2/../ACE_wrappers
 +
  -- Configuring done
 +
  -- Generating done
 +
  -- Build files have been written to: /Users/paulfitz/cvs/yarp2
 +
* I ran make in the YARP directory and it worked fine:
 +
  $ make
 +
  Scanning dependencies of target YARP_OS
 +
  [  1%] Building CXX object src/libYARP_OS/CMakeFiles/YARP_OS.dir/src/Address.o
 +
  [  2%] Building CXX object src/libYARP_OS/CMakeFiles/YARP_OS.dir/src/Bottle.o
 +
  ...
 +
* Once everything compiled, I tried the YARP regression tests and they worked fine:
 +
  $ make test
 +
  Running tests...
 +
  Start processing tests
 +
  Test project /Users/paulfitz/cvs/real/yarp2
 +
    1/ 30 Testing YARP_OS::AddressTest            Passed
 +
    2/ 30 Testing YARP_OS::BinPortableTest        Passed
 +
    ...
 +
* The YARP device library is not compiled by default and I needed it so I ran
 +
  ccmake .
 +
* I pressed "c" to configure, turned on the "CREATE_DEVICE_LIBRARY" option, pressed "c" again, then pressed "g" to generate and quit.  Then I ran "make" again.
 +
* At this pount, in the YARP "bin" directory, there was:
 +
  $ ls bin/
 +
  harness_dev    harness_sig    yarpdev
 +
  harness_os      yarp            yarphear
 +
* To test the installation I did:
 +
  $ ./bin/yarp check
 +
  yarp: Cannot find name server
 +
  yarp: ==================================================================
 +
  yarp: === Trying to register some ports
 +
  yarp: no connection to nameserver
 +
  yarp: no connection to nameserver, scanning mcast
 +
  yarp: Polling for name server (using multicast), try 1 of max 3
 +
  yarp: Received address text://131.212.41.183:10000
 +
  yarp: ==================================================================
 +
  yarp: === Trying to connect some ports
 +
  yarp: Receiving input from /tmp/port/1 to /tmp/port/2 using tcp
 +
  yarp: Sending output from /tmp/port/1 to /tmp/port/2 using tcp
 +
  Added output connection from "/tmp/port/1" to "/tmp/port/2"
 +
  yarp: ==================================================================
 +
  yarp: === Trying to write some data
 +
  yarp: ==================================================================
 +
  yarp: === Trying to read some data
 +
  yarp: *** Read number 42
 +
  yarp: ==================================================================
 +
  yarp: === Trying to close some ports
 +
  yarp: Removing output from /tmp/port/1 to /tmp/port/2
 +
  yarp: Removing input from /tmp/port/1 to /tmp/port/2
 +
  yarp: *** YARP seems okay!
 +
* The fact that YARP found a server was a surprise to me, I guess somebody else was running one on the local network somewhere.  Anyway, the installation looked good.
 +
 +
 +
== Installing Dependencies ==
 +
For installing many dependencies required by YARP (e.g., Gtk+), try using [http://www.macports.org macports], a package manager that automatically downloads, builds, and installs various unix libraries along with all necessary dependencies.
 +
 
== Semaphore Issues ==
 
== Semaphore Issues ==
 
If you get errors regarding semaphores when running yarp programs, try this command:  
 
If you get errors regarding semaphores when running yarp programs, try this command:  
Line 5: Line 103:
  
 
(Add this to your startup script, like .bash_profile, to make it happen automatically for each new window.)
 
(Add this to your startup script, like .bash_profile, to make it happen automatically for each new window.)
 
== Installing Dependencies ==
 
Using darwinports to install mac dependencies appears to work most of the time.
 
  
 
== SDL Issues (_NSAutoreleaseNoPool() errors) ==
 
== SDL Issues (_NSAutoreleaseNoPool() errors) ==

Revision as of 11:21, 23 July 2009

I don't know much about OSX; this is a log of a random YARP install by an OSX newbie. Information about machine from uname -a:

 Darwin foo.bar.edu 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep  8 17:18:57 PDT 2006;
 root:xnu-.../RELEASE_PPC Power Macintosh powerpc

Followed the generic YARP Install Notes for UNIX. Only deviations from these notes (or choices left open in these notes) are listed here.

ACE

  • Fetched http://deuce.doc.wustl.edu/ACE-5.5.tar.gz
  • Used platform_macosx-tiger.GNU for platform_macros.GNU step of ACE installation.
  • Used config-macosx-tiger.h for config.h step of ACE installation.
  • Generic instructions for UNIX worked fine. Got:
 ACE_wrappers/lib/libACE.dylib
 ACE_wrappers/lib/libACE_SSL.dylib
  • I set some variables in my ~/.bash_profile file:
 export ACE_ROOT=$HOME/cvs/ACE_wrappers
 export LD_LIBRARY_PATH=$ACE_ROOT/lib:$LD_LIBRARY_PATH
 export DYLD_LIBRARY_PATH=$ACE_ROOT/lib:$DYLD_LIBRARY_PATH

For YARP on an Intel flavor of OSX, make sure you're using a version of the ACE library after October 2006 (the ACE ChangeLog suggests that's when support was introduced).

For example, version 5.5.4, available from:

CMake

 export PATH=$PATH:$HOME/cvs/cmake/bin

YARP

  • Fetched YARP from CVS using anonymous checkout (blank password). This was a slow process.
  • I ran cmake in the YARP directory and it worked fine:
 $ cmake .
 -- Check for working C compiler: /usr/bin/gcc
 -- Check for working C compiler: /usr/bin/gcc -- works
 -- Check size of void*
 -- Check size of void* - done
 -- Check for working CXX compiler: /usr/bin/c++
 -- Check for working CXX compiler: /usr/bin/c++ -- works
 -- Check if the system is big endian
 -- Check if the system is big endian - big endian
 -- Found ACE library: /Users/paulfitz/cvs/ACE_wrappers/lib/libACE.dylib
 -- Found ACE include: /Users/paulfitz/cvs/yarp2/../ACE_wrappers
 -- Configuring done
 -- Generating done
 -- Build files have been written to: /Users/paulfitz/cvs/yarp2
  • I ran make in the YARP directory and it worked fine:
 $ make
 Scanning dependencies of target YARP_OS
 [  1%] Building CXX object src/libYARP_OS/CMakeFiles/YARP_OS.dir/src/Address.o
 [  2%] Building CXX object src/libYARP_OS/CMakeFiles/YARP_OS.dir/src/Bottle.o
 ...
  • Once everything compiled, I tried the YARP regression tests and they worked fine:
 $ make test
 Running tests...
 Start processing tests
 Test project /Users/paulfitz/cvs/real/yarp2
   1/ 30 Testing YARP_OS::AddressTest             Passed
   2/ 30 Testing YARP_OS::BinPortableTest         Passed
   ...
  • The YARP device library is not compiled by default and I needed it so I ran
 ccmake .
  • I pressed "c" to configure, turned on the "CREATE_DEVICE_LIBRARY" option, pressed "c" again, then pressed "g" to generate and quit. Then I ran "make" again.
  • At this pount, in the YARP "bin" directory, there was:
 $ ls bin/
 harness_dev     harness_sig     yarpdev
 harness_os      yarp            yarphear
  • To test the installation I did:
 $ ./bin/yarp check
 yarp: Cannot find name server
 yarp: ==================================================================
 yarp: === Trying to register some ports
 yarp: no connection to nameserver
 yarp: no connection to nameserver, scanning mcast
 yarp: Polling for name server (using multicast), try 1 of max 3
 yarp: Received address text://131.212.41.183:10000
 yarp: ==================================================================
 yarp: === Trying to connect some ports
 yarp: Receiving input from /tmp/port/1 to /tmp/port/2 using tcp
 yarp: Sending output from /tmp/port/1 to /tmp/port/2 using tcp
 Added output connection from "/tmp/port/1" to "/tmp/port/2"
 yarp: ==================================================================
 yarp: === Trying to write some data
 yarp: ==================================================================
 yarp: === Trying to read some data
 yarp: *** Read number 42
 yarp: ==================================================================
 yarp: === Trying to close some ports
 yarp: Removing output from /tmp/port/1 to /tmp/port/2
 yarp: Removing input from /tmp/port/1 to /tmp/port/2
 yarp: *** YARP seems okay!
  • The fact that YARP found a server was a surprise to me, I guess somebody else was running one on the local network somewhere. Anyway, the installation looked good.


Installing Dependencies

For installing many dependencies required by YARP (e.g., Gtk+), try using macports, a package manager that automatically downloads, builds, and installs various unix libraries along with all necessary dependencies.

Semaphore Issues

If you get errors regarding semaphores when running yarp programs, try this command:

 ulimit -n 4096

(Add this to your startup script, like .bash_profile, to make it happen automatically for each new window.)

SDL Issues (_NSAutoreleaseNoPool() errors)

SDL apps on Mac require that a file called something like SDLMain-1.2.13.m (an objective-C file) is compiled into the executable. (SDL overrides your main function, and the SDL main implementation is contained in this .m file.) If you don't compile in this file, you'll get lots of _NSAutoreleaseNoPool() errors when you run SDL-based programs like the iCub simulator.

To fix this for the iCub simulator app, compile in the SDLMain-1.2.13.m file (usually included with the SDL source distribution for mac), then add FILE(GLOB folder_source2 *.m) to the iCubSimulator/CMakeLists.txt and add ${folder_source2} to the ADD_EXECUTABLE line, and add SDLmain.h and SDLMain-1.2.13.m to the iCubSimulator source directory.