Player/Stage on OS X 10.5 with Macports
May 24, 2008
Below is a quick recipe for installing and testing Player/Stage 2.0.4 on OS X 10.5 Leopard using Macports. First, if you have not already, install Macports. Once Macports is installed, from the terminal execute:
sudo port install playerstage-stage playerstage-player
At this point, I tried to launch Player/Stage, but received errors about rgb.txt:
unable to open color database /usr/X11R6/lib/X11/rgb.txt : No such file or directory (stage.c stg_lookup_color)
To correct this problem, player/stage needs a link to the X11 color map in the place it expects:
sudo ln -s /usr/X11/share/X11/rgb.txt /usr/X11R6/lib/X11/rgb.txt
Now you are ready to launch and test player/stage:
player /opt/local/var/macports/software/playerstage-stage\ /*/opt/local/share/stage/worlds/simple.cfg
If you are sucessful, you should see the following window. You can drive player/stage using an example program in another terminal:
/opt/local/var/macports/software/playerstage-player\ /*/opt/local/share/player/examples/libplayerc++/laserobstacleavoid
After playing around a bit, I am sure you will agree that player/stage is the best thing going right now for open source robot simulation, control, and development.
Advertisement

October 8, 2008 at 20:00
Any chance you’ve also gotten Gazebo installed and running on Leopard? If so, I’d love to hear about how you did it.
January 20, 2009 at 16:59
retrieve some error while trying, any ideas?
—> 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:45: Warning(124): Specifying the language name in %typemap is deprecated – use #ifdef SWIG instead.
playerc.i:83: Warning(124): Specifying the language name in %typemap is deprecated – use #ifdef SWIG instead.
playerc.i:122: Warning(124): Specifying the language name in %typemap is deprecated – use #ifdef SWIG instead.
playerc.i:128: Warning(124): Specifying the language name in %typemap is deprecated – use #ifdef SWIG 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:40751: warning: assignment from incompatible pointer type
playerc_wrap.c: In function ‘_wrap_playerc_mclient_addclient’:
playerc_wrap.c:40956: 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:40751: warning: assignment from incompatible pointer type
playerc_wrap.c: In function ‘_wrap_playerc_mclient_addclient’:
playerc_wrap.c:40956: 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 -ldljpeg
: library not found for -ljpeg
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
lipo: can’t open input file: /var/tmp//ccKcAtkX.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
January 21, 2009 at 01:23
If you encounter errors, I’d try first to upgrade macports:
sudo port selfupdate
sudo port upgrade installed
If you still can’t build playerstage-player after that, your best bet is to submit a bug report:
http://trac.macports.org/newticket
February 4, 2009 at 18:22
has tried update it but still have the same problems…was wondering what’s wrong…:(
February 12, 2009 at 00:10
I got that same error, mac. I fixed it by using DarwinPorts (or MacPorts) to install player and stage. First I had to update python and swig.
$ sudo port install python30
$ sudo port install swig
$ sudo port install playerstage-player playerstage-stage
March 5, 2009 at 03:44
Hi Tanya,
Just wanted to say that you suggestion worked for me as well.
Thanks.
May 15, 2009 at 18:04
Hi, thanks a lot to everybody!
Just wanted to let you know that in my case I had to use python25 and not python30, otherwise it wasn’t able to build the player-stage code.
In conclusion if you still have compiling errors after all the steps above, you might want to do this:
$ sudo python_select python25
$ sudo port clean playerstage-player playerstage-stage
$ sudo port install playerstage-player playerstage-stage
hope this helps!
Thanks again!
June 30, 2009 at 11:44
Manage to get it works when testing using player /opt/local/var/macports/software/playerstage-stage\
/*/opt/local/share/stage/worlds/simple.cfg
However, got an error when trying this /opt/local/var/macports/software/playerstage-player\
/*/opt/local/share/player/examples/libplayerc++/laserobstacleavoid
—
playerc error : connect call on [localhost:6665] failed with error [61:Connection refused]
PlayerClient::Connect()(-1) : connect call on [localhost:6665] failed with error [61:Connection refused]
dyn044:~ ameliaritahani$ /opt/local/var/macports/software/playerstage-player\
> /*/opt/local/share/player/examples/libplayerc++/laserobstacleavoid
calling connect
done
playerc error : connect call on [localhost:6665] failed with error [61:Connection refused]
PlayerClient::Connect()(-1) : connect call on [localhost:6665] failed with error [61:Connection refused]
dyn044:~ ameliaritahani$ /opt/local/var/macports/software/playerstage-player\
> /*/opt/local/share/player/examples/libplayerc++/laserobstacleavoid
calling connect
done
playerc error : connect call on [localhost:6665] failed with error [61:Connection refused]
PlayerClient::Connect()(-1) : connect call on [localhost:6665] failed with error [61:Connection refused]
June 30, 2009 at 13:05
Hi…I am new with stage/player…I have a simple questions. I managed to run the player/stage according to the steps given. How can I run examples from other folder ( my predefined folder)?
Thanks
July 1, 2009 at 16:09
[...] Never had an experience in simulating robots….I refer to this guideline for installing Stage/Player in my macbook which has started in February and I have few errors and [...]
October 19, 2009 at 17:05
Thanks2All here – you are great.
November 2, 2009 at 12:27
I can open the player according to the tutorial,
but I have trouble porting my code over to my mac.
I get this error.
Any ideas?
/opt/local/include/player-2.0/libplayerc++/playerclient.h:20:36: error: boost/thread/mutex.hpp: No such file or directory
/opt/local/include/player-2.0/libplayerc++/playerclient.h:21:37: error: boost/thread/thread.hpp: No such file or directory
November 6, 2009 at 03:34
Sean: I think you need to make sure your code links to the boost headers. A first step would be to check if boost is installed. I believe there is a macport for it. Next step would be to check your Makefile includes to be sure they have the right directory listed.
March 29, 2010 at 05:31
Blog liked, but a lot of unnecessary comments.
April 28, 2010 at 18:03
[...] DeliciousPlayer/Stage: Getting Started Guide 16 hours agoPlayer/Stage on OS X 10.5 with Macports « sublimiated 19 hours agoNidhi Kalra 23 hours agoPosteRazor – Make your own poster! 2010/04/26Pencil – a [...]
June 24, 2010 at 08:16
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
June 24, 2010 at 08:17
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
December 21, 2011 at 13:18
Try “port install cmake” and see how things progress.