Difference between revisions of "YARP on Mac"

From Wiki for iCub and Friends
Jump to navigation Jump to search
(→‎ACE: added link for other tutorial if problems arise)
(Replaced content with "For updated instructions on how to use YARP software on macOS, please check the YARP documentation: https://www.yarp.it/install_yarp_mac.html .")
Line 1: Line 1:
For updated instructions on how to use YARP software on macOS, please check the YARP documentation: https://www.yarp.it/install_yarp_mac.html .
This page is a bit out of date, there are more up to date instructions:
* Here: [[PrepareMacOSX]]
* And here: [[CompileMacOSX]]
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 ==
* Fetch http://deuce.doc.wustl.edu/ACE-5.5.tar.gz
** Note: ACE 6.0.0 seems to compile fine on my snow leopard iMac (Juxi, Feb 2011)
* 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:
* I set some variables in my ~/.bash_profile file:
  export ACE_ROOT=$HOME/cvs/ACE_wrappers
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/
If you have trouble with the generic installation instructions checkout the instructions [http://www.trinitycore.org/w/How-to:Mac here].
== 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. If you have trouble compiling the current SVN release make sure that it does not show any errors for mac/darwin on the [http://dashboard.icub.org/index.php?project=YARP yarp Dashboard page]. If there are errors use a tar ball from a stable release.
* 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://
  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.
== Enabling yarpview ==
In order to compile yarpview on the Mac you need to edit $YARP_ROOT/conf/FindGtkPlus.cmake and outcomment the section
(Don't outcomment the comments though).
yarpview is not compiled by default. You have to activate it via ccmake.
Prerequisite for yarpview is Gtk+ that you can install via fink or macports.
== 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 ==
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.

Latest revision as of 09:27, 5 October 2020

For updated instructions on how to use YARP software on macOS, please check the YARP documentation: https://www.yarp.it/install_yarp_mac.html .