Home > iPhone > Player/Stage, MacPorts, and iPhone

Player/Stage, MacPorts, and iPhone

April 10th, 2009 Leave a comment Go to comments

Today I worked on setting up Player/Stage on my Macbook Pro with Leopard 10.5.6 and I ran into a few issues.

I was using Macports 1.710 and I was attempting to install player-stage-player (2.03 2.1.2) and player-stage-stage (2.03 2.1.1) following a short guide at http://bentham.k2.t.u-tokyo.ac.jp/notebook/?p=247

If it’s your first time using macports it can take a long time. I waited 2+ hours to download/build/install dependencies

I used the command:

$ sudo port install playerstage-player playerstage-stage

However it errored out at the end with the message:

$ sudo port install playerstage-player playerstage-stage
--->  Building playerstage-player
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_playerstage-player/work/player-2.0.4" && make all " returned error 2
Command output: building '_playerc' extension
swigging playerc.i to playerc_wrap.c
swig -python -o playerc_wrap.c playerc.i
playerc.i:44: Warning(124): Specifying the language name in %typemap is deprecated - use #ifdef SWIG<LANG> instead.
playerc.i:82: Warning(124): Specifying the language name in %typemap is deprecated - use #ifdef SWIG<LANG> instead.
playerc.i:121: Warning(124): Specifying the language name in %typemap is deprecated - use #ifdef SWIG<LANG> instead.
playerc.i:127: Warning(124): Specifying the language name in %typemap is deprecated - use #ifdef SWIG<LANG> instead.
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -I./../.. -I../../../.. -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c playerc_wrap.c -o build/temp.macosx-10.5-i386-2.5/playerc_wrap.o
playerc_wrap.c: In function '_wrap_playerc_mclient_client_set':
playerc_wrap.c:40301: warning: assignment from incompatible pointer type
playerc_wrap.c: In function '_wrap_playerc_mclient_addclient':
playerc_wrap.c:40504: warning: passing argument 2 of 'playerc_mclient_addclient' from incompatible pointer type
playerc_wrap.c: In function '_wrap_playerc_mclient_client_set':
playerc_wrap.c:40301: warning: assignment from incompatible pointer type
playerc_wrap.c: In function '_wrap_playerc_mclient_addclient':
playerc_wrap.c:40504: warning: passing argument 2 of 'playerc_mclient_addclient' from incompatible pointer type
gcc -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc build/temp.macosx-10.5-i386-2.5/playerc_wrap.o -L./../../.libs -L../../../../libplayerxdr/.libs -L../../../../libplayercore/.libs -L../../../../libplayerjpeg/.libs -lplayerxdr -lplayerc -lplayerjpeg -ljpeg -lplayererror -o build/lib.macosx-10.5-i386-2.5/_playerc.so
ld: library not found for -ljpeg
collect2: ld returned 1 exit status
ld: library not found for -ljpeg
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccI9TvVp.out
(No such file or directory)
error: command 'gcc' failed with exit status 1
make[6]: *** [pythonbuild] Error 1
make[5]: *** [all] Error 2
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.

So I searched around the MacPorts website and I came across the ticket #18891, which basically said to run the following command to change the version of python being used from 3.0 to 2.5.

$ sudo port install python_select && sudo python_select python25
Skipping org.macports.activate (python_select +darwin_9) since this
port is already active
--->  Cleaning python_select
Selecting version "python25" for python

Following that command I was able to finish installing Player/Stage via MacPorts by using the orginal port command.

$ sudo port install playerstage-player playerstage-stage
--->  Building playerstage-player
--->  Staging playerstage-player into destroot
--->  Installing playerstage-player @2.0.4_2
--->  Activating playerstage-player @2.0.4_2
--->  Cleaning playerstage-player
--->  Fetching playerstage-stage
--->  Attempting to fetch stage-2.0.3.tar.bz2 from

http://voxel.dl.sourceforge.net/playerstage

--->  Verifying checksum(s) for playerstage-stage
--->  Extracting playerstage-stage
--->  Configuring playerstage-stage
--->  Building playerstage-stage
--->  Staging playerstage-stage into destroot
--->  Installing playerstage-stage @2.0.3_0
--->  Activating playerstage-stage @2.0.3_0
--->  Cleaning playerstage-stage

I tried to use player stage from MacPorts.

$ player /opt/local/var/macports/software/playerstage-stage\
/*/opt/local/share/stage/worlds/simple.cfg

And I received the error:

rr: unable to open color database /usr/X11R6/lib/X11/rgb.txt
 : No such file or directory (stage.c stg_lookup_color)

Following the advice from http://bentham.k2.t.u-tokyo.ac.jp/notebook/?cat=5 I added the following link.

$ sudo ln -s /usr/X11/share/X11/rgb.txt /usr/X11R6/lib/X11/rgb.txt

Now I am able to create a player server and connect with a client with the commands:

$ player /opt/local/var/macports/software/playerstage-stage\
/*/opt/local/share/stage/worlds/simple.cfg

/opt/local/var/macports/software/playerstage-player\
/*/opt/local/share/player/examples/libplayerc++/laserobstacleavoid

With the ability to run player/stage I will post again on my progress as I use an iPhone to run the Player client, rather than my Macbook Pro.

Player client running on iPhone with Player/Stage.

Player client running on iPhone with Player/Stage.

  1. April 13th, 2009 at 15:56 | #1

    How did you get player running on the iPhone?

  2. April 15th, 2009 at 13:14 | #2

    It wasn’t too hard. I’ll have more information to post in the upcoming week.

    I basically included all the needed files together and built in Xcode from the player client source code.

  3. Len White
    June 30th, 2009 at 08:51 | #3

    Hi! It’s great that you’re doing this.
    I’m very interested in getting Player running on my iPhone.
    I also develop on a Macbook Pro in Mac and Windows (Boot camp).
    But I’d love to have a little control app for my remote player server (running on a linux laptop on the robot).

    If I can help develop this I will try.
    Very eager to hear more about the iPhone progress!
    Thanks!

    -Len

  4. nick
    July 8th, 2009 at 16:05 | #4

    Could you describe how you built the player client code in xcode?

  5. July 22nd, 2009 at 15:47 | #5

    I’m going to have some more details in a few more weeks. Sorry I’ve been busy and haven’t gotten back to getting the details posted.

    You have to hack at the Player/Stage code to get it working in a standalone directory, rather than relying on the full install. You then take that and build it for the iPhone and it should work.

    I’m having issues getting it working with 3.0.

  6. July 22nd, 2009 at 15:49 | #6

    Hopefully this week I’ll get more details up and my basic player/stage library Xcode project with instructions on how to reference from a separate Xcode project.

  7. Tom
    August 3rd, 2009 at 03:09 | #7

    Would be great If you could upload some more infos about the iPhone XCode development!

  8. Paul Solt
    August 3rd, 2009 at 12:50 | #8

    I should have something by Wednesday. I’m creating a couple samples and working on the documentation.

  9. Shyam
    June 24th, 2010 at 03:01 | #9

    Hey Paul,
    I’m really eager to get P/S working on my mac. I tried following your steps above. Unfortunately, the command ‘sudo port install playerstage-player playerstage-stage’ gives me an error. I have included the log created by it over here. Please help me out…

    Here’s the log for playerstage-player:
    :debug:configure Executing proc-pre-org.macports.configure-configure-0
    :debug:configure Executing org.macports.configure (playerstage-player)
    :debug:configure Environment: CPATH=’/opt/local/include’ CFLAGS=’-O2 -arch i386′ CPPFLAGS=’-I/opt/local/include’ CXXFLAGS=’-O2 -arch i386′ LIBRARY_PATH=’/opt/local/lib’ MACOSX_DEPLOYMENT_TARGET=’10.5′ CXX=’/usr/bin/g++-4.0′ CC_PRINT_OPTIONS_FILE=’/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_playerstage-player/work/.CC_PRINT_OPTIONS’ F90FLAGS=’-O2 -m32′ LDFLAGS=’-L/opt/local/lib -arch i386′ OBJC=’/usr/bin/gcc-4.0′ FCFLAGS=’-O2 -m32′ INSTALL=’/usr/bin/install -c’ OBJCFLAGS=’-O2 -arch i386′ FFLAGS=’-O2 -m32′ CC_PRINT_OPTIONS=’YES’ CC=’/usr/bin/gcc-4.0′
    :debug:configure Assembled command: ‘cd “/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_playerstage-player/work/player-3.0.0″ && cmake -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_SYSTEM_PREFIX_PATH=”/opt/local;/usr” -DQT_QMAKE_EXECUTABLE=/opt/local/libexec/qt4-mac/bin/qmake -Wno-dev -DCMAKE_OSX_ARCHITECTURES=”i386″‘
    :info:configure sh: cmake: command not found
    :info:configure shell command ” cd “/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_playerstage-player/work/player-3.0.0″ && cmake -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_SYSTEM_PREFIX_PATH=”/opt/local;/usr” -DQT_QMAKE_EXECUTABLE=/opt/local/libexec/qt4-mac/bin/qmake -Wno-dev -DCMAKE_OSX_ARCHITECTURES=”i386″ ” returned error 127
    :error:configure Target org.macports.configure returned: configure failure: shell command failed
    :debug:configure Backtrace: configure failure: shell command failed
    while executing
    “$procedure $targetname”
    :info:configure Warning: the following items did not execute (for playerstage-player): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
    :notice:configure Log for playerstage-player is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_playerstage-player/main.log

  1. No trackbacks yet.