Local installation
From Playerstage
Some developers (myself included) prefer to install applications in our user directory (e.g., /home/[username]/local) rather than in a system directory; this avoids screwing up other users of the machine if you have some funky experimental code you want to work with. It's also useful if you don't have root access.
Naturally, local installs can make it a bit tricky for the various packages to find the right headers, libs and so on. Historically, we have worked around this by specifying "--with-foo=path" arguments to the configure scripts; unfortunately, this method is fraught with danger and is now being phased out. Here, then, is the recommended way to do it:
- Pick a spot for "local" installs; for me it is "/home/ahoward/local". The install scripts will create relevant subdirs under this, such as:
/home/ahoward/local/bin
/home/ahoward/local/include
/home/ahoward/local/lib
- Set up the necessary compiler paths in your .bashrc (or whatever) script; e.g.:
$ export PATH=~/local/bin:$PATH
$ export CPATH=~/local/include:$CPATH
$ export LIBRARY_PATH=~/local/lib:$LIBRARY_PATH
The first line sets the executable path; the second sets the path for C and C++ header files; the third line sets the library search path.
- Set up some additional paths in your .bashrc (or whatever)
$ export PKG_CONFIG_PATH=~/local/lib/pkgconfig:$PKG_CONFIG_PATH
$ export PYTHONPATH=~/local/lib/python2.2/site-packages:$PYTHONPATH
The first line sets the pkg-config path (for applications using pkg-config, which will be everything in the P/S/G project pretty soon); the second line is for Python modules (e.g. Python bindings to the libplayerc client lib).
- Check to see if you have set CFLAGS or LDFLAGS:
$ env | grep CFLAGS
$ env | grep LDFLAGS
These variables can change how the compiler and linker behave. If either one is set, and if it points to a place where there is another installation of Player/Stage/Gazebo/librtk (e.g., LDFLAGS="-L/usr/local/lib", CFLAGS="-I/usr/local/include"), then you must unset it:
$ unset LDFLAGS
$ unset CFLAGS
Note that if these variables are set to something that doesn't change the compiler/linker paths (e.g., CFLAGS="-g -Wall") then you can leave them alone.
- Build applications using the "--prefix" argument; e.g.;
./configure --prefix=/home/ahoward/local
make install
Everything should now build seamlessly without any additional frigging around, and your locally installed packages will be used in preference to any system-wide installs.
