STAIR Vision Library

Linux Installation

Getting Latest Code

Download
Select the appropriate stable release from the here or check out directly from the repository by following the instructions below.

Repository
For the development branch use:

svn checkout https://stairvision.svn.sourceforge.net/svnroot/stairvision/trunk $CODEBASE
For release 2.4 use:
svn checkout https://stairvision.svn.sourceforge.net/svnroot/stairvision/release/2.4 $CODEBASE
Repository (Stanford-Only Projects)
After checking out the appropriate STAIR Vision Library code, Stanford students can get Stanford-only projects by running:
svn checkout file:///afs/cs.stanford.edu/group/stair/software/svl-projects/trunk $CODEBASE/stanford
  (use svn+ssh://<USERNAME>@robo.stanford.edu/afs/cs/group/stair/software/svl-projects/trunk if accessing from non-cs machine)

Building the Code

After downloading or checking out do:
cd $CODEBASE
cat README
  (install and link OpenCV and wxWidgets if necessary (see below))
make
Then for each project you work on,
cd project/<PROJECTNAME>
make
cd ../..
or
cd stanford/<PROJECTNAME>
make
cd ../..

make.local

You can control how the STAIR Vision Library gets build by setting various flags in a file called make.local in the base directory. The default values for these flags are shown below (don't include the comments):
FORCE32BIT = 0          # set to 1 to compile 32-bit applications on 64-bit machines
BUILD_GUI_APPS = 1      # set to 0 to disable automatic building of GUI applications (needs wxWidgets)
BUILD_MEX_APPS = 0      # set to 1 to automatically build Matlab applications
SVL_SHARED_LIBS = 0     # set to 1 to compile applications against shared libraries (.so) instead of static (.a)
SVL_DEBUG_SYMBOLS = 1   # set to 0 to remove debug symbols (-g) from binaries (resulting in much smaller files)
BUILD_CUDA_KERNELS = 0  # set to 1 to compile GPU-accelerated code (needs Cuda)

# list of projects to automatically build when make is invoked
SVL_PROJECTS := projects/helloworld
If you use shared libraries, you will need to add $CODEBASE/bin to your LD_LIBRARY_PATH environment variable.

Installing Build Tools (Ubuntu 7.10, 8.04)

# Build Tools
sudo apt-get install build-essential subversion wget

# x64 platforms (only)
sudo apt-get install libc6-dev-i386 

# OpenGL
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev

# libJPEG
sudo apt-get install libjpeg-dev

# OpenCV
sudo apt-get install libgtk2.0-dev
sudo apt-get install libpng12-dev zlib1g-dev libtiff4-dev libjasper-1.701-dev
sudo apt-get install python2.5-dev
sudo apt-get install libavcodec-dev libavformat-dev ffmpeg
sudo apt-get install libgz2-dev

Installing Build Tools (Fedora)

# Build Tools
sudo yum install gcc gcc-c++ subversion wget

# OpenGL
sudo yum install mesa-libGLU-devel.i386 mesa-libGL-devel.i386

# libJPEG
sudo yum install libjpeg-devel.i386

Installing OpenCV, Eigen and wxWidgets the Fast Way

cd external
./install.sh
If you want to know what this is doing to your system (or link to existing installations of the libraries) then you should follow the steps below.

Installing OpenCV, Eigen and wxWidgets the Slow Way

Installing OpenCV 2.1

wget -c http://prdownloads.sourceforge.net/opencvlibrary/OpenCV-2.1.0.tar.bz2
bunzip2 OpenCV-2.1.0.tar.bz2
tar xvf OpenCV-2.1.0.tar
cd OpenCV-2.1.0
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=${CODEBASE}/external/opencv .
make
make install
If you have a pre-existing installation (or followed the above instructions with a different CMAKE_INSTALL_PREFIX, you can simply link to your local copy:
ln -s /usr/local/opencv-<VERSION> $CODEBASE/external/opencv
Stanford students (with accounts on robo) can link to the build in the STAIR group directory:
ln -s /afs/cs.stanford.edu/group/stair/libs32/opencv $CODEBASE/external/opencv
or the DAGS group directory:
ln -s /afs/cs.stanford.edu/group/dags/software/libs64/opencv $CODEBASE/external/opencv
This will require modifying the PATH and LD_LIBRARY_PATH variables to avoid runtime errors, e.g.:
setenv PATH ${PATH}:/afs/cs.stanford.edu/group/stair/libs32/opencv
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/afs/cs.stanford.edu/group/stair/libs32/opencv/lib

Installing Eigen

wget -c http://bitbucket.org/eigen/eigen/get/2.0.13.tar.bz2 -O eigen-2.0.13.tar.bz2
bunzip2 eigen-2.0.13.tar.bz2
tar xvf eigen-2.0.13.tar
mv eigen eigen-2.0.13
ln -s eigen-2.0.13/Eigen $CODEBASE/external/Eigen
If you have a pre-existing installation, you can simply link to your local copy:
ln -s eigen-2.0.13/Eigen $CODEBASE/external/Eigen

Installing wxWidgets

wget http://prdownloads.sourceforge.net/wxwindows/wxGTK-2.8.11.tar.gz
tar xzvf wxGTK-2.8.11.tar.gz
rm wxGTK-2.8.11.tar.gz
cd wxGTK-2.8.11
mkdir buildgtk
cd buildgtk
../configure --disable-shared --with-opengl --enable-monolithic
make
cd ../..
ln -s wxGTK-2.8.11 $CODEBASE/external/wxGTK
If you have a pre-existing installation, you can simply link to your local copy:
ln -s wxGTK-2.8.11 $CODEBASE/external/wxGTK
Stanford students (with accounts on robo) can link to the build in the STAIR group directory:
ln -s /afs/cs.stanford.edu/group/stair/libs32/wxGTK-2.8.0 $CODEBASE/external/wxGTK
or the DAGS group directory:
ln -s /afs/cs.stanford.edu/group/dags/software/libs64/wxGTK $CODEBASE/external/wxGTK

Installing Cuda

Obtain the appropriate libraries from Nvidia and link from the external directory:
ln -s /usr/local/cuda $CODEBASE/external/cuda
ln -s NVIDIA_CUDA_SDK $CODEBASE/external/cuda_sdk
Set BUILD_CUDA_KERNELS to 1 in make.local.