Download the latest Player source tarball (player-<version>.tgz) from SourceForge.
Uncompress and expand the tarball:
$ tar xzvf player-<version>.tgz
`cd' into Player's source directory:
$ cd player-<version>
To configure Player with default settings:
Install Player. By default, Player will be installed in /usr/local so you need to become root for this step. Remember to return to your normal user ID afterwards.
$ make install
Executables (e.g., the Player utilities) are in /usr/local/bin, libraries (e.g., libplayercore, libplayerdrivers) are in /usr/local/lib, and so on.
$ pkg-config --libs playercore
You should get something like (exact results vary by system):
-lplayercore -lltdl -lpthread -lplayererror
If instead you get this:
Package playercore was not found in the pkg-config search path.
Perhaps you should add the directory containing `playercore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'playercore' found
then you need to add /usr/local/lib/pkgconfig to your PKG_CONFIG_PATH. E.g., in bash:
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
Otherwise you will not be able to compile programs that use any of Player's libraries.
--prefix, used to change the installation directory from the default (which varies from system to system, but is usually /usr/local). Prefixes must be absolute paths, i.e. a complete path starting with a '/'.
For example, you might want to install Player in your home directory because you don't have root access:
$ ./configure --prefix=/home/gerkey/ps
$ make install
Now the executables are in /home/gerkey/ps/bin, the libraries are in /home/gerkey/ps/lib, and so on.
- You may have to change various environment variables if you install Player somewhere other than the default location. Variables that may need modification include: PATH, LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH on Mac OS X), and PKG_CONFIG_PATH. More information on local installations can be found here.
You can override this default behavior by passing options to configure to disable the compilation of certain drivers. For every driver
foo, you can pass
--disable-foo to configure. For example, to prevent compilation of the sicklms200 driver:
$ ./configure --disable-sicklms200
You can also pass
--enable-foo to enable a driver
foo that has been disabled by default. But keep in mind that such a driver is probably disabled for a reason; don't be surprised if it does not compile. And note that
--enable-foo will not force compilation of a driver whose prerequisites have not been met.
A special option is provided to disable all drivers:
--disable-alldrivers. This option is useful, for example, when building a small-footprint Player binary to run on an embedded system. You can combine this option with any number of
--enable-foo options to get just the drivers you want without having to enumerate the ones that you don't want. For example, to build just the p2os and sicklms200 drivers:
$ ./configure --disable-alldrivers --enable-p2os --enable-sicklms200
The order of these options on the command line does not matter. The
--disable-alldrivers option, if present anywhere on the command line, is processed first. Then any
--enable-foo options are processed.