SwisTrack/Developers/Setting up a development environment/Linux

Prerequisites
You need the following programs and libraries:


 * Subversion (SVN)
 * Intel Open Source Computer Vision Library OpenCV
 * wxWidgets

The following libraries are optional and only necessary if you want to use the corresponding cameras:
 * Basler Pylon driver
 * Firewire camera driver

Ubuntu 12.04 and later
Install Subversion sudo apt-get install subversion

Install wxWidgets: sudo apt-get install libwxgtk3.0-dev

Install OpenCV2: sudo apt-get install libopencv-dev

Checkout the trunk of the svn repository: svn checkout svn://svn.code.sf.net/p/swistrack/code/trunk

Compile: cd trunk make

Run: cd SwisTrackEnvironment ./SwisTrack

Ubuntu 8.04
On Ubuntu 8.04, it should be enough to install the packages
 * libwxgtk2.8-dev (wxWidgets)
 * libhighgui-dev (OpenCV)
 * libcvaux-dev (OpenCV)

Use Synaptic Packet Manager or type sudo apt-get install libwxgtk2.8-dev sudo apt-get install libhighgui-dev libcvaux-dev on the terminal to install these packages.

Other distributions
If your distribution does not provide a package, you can compile and install these libraries manually.

Manually Installing OpenCV
Download the OpenCV 1.0 sources [ http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/1.0/ ]and compile and install them: tar xfz opencv-1.0.0.tar.gz cd opencv-1.0.0 ./configure --prefix=/usr make sudo make install For detailed installation instructions, check out the INSTALL file.

Note that the current SwisTrack Makefile expects OpenCV to be installed with the prefix /usr. If you install it elsewhere, do not forget to modify the INCL_DIRS line in the Makefile appropriately.

When installing OpenCV 1.0 in newer Ubuntu distributions you may find the following issues:

1) Error message: ../../cxcore/include/cxmisc.h:133:6: error: #elif with no expression To fix it, change line 133 in cxmisc.h from #elif to #else.

2) Error message: ../../../otherlibs/highgui/.libs/libhighgui.so: undefined reference to `cvCaptureFromCAM_V4L(int)' To fix it, add #define HAVE_CAMV4L after line 24 in cvconfig.h

3) Error message: cvcap_v4l.cpp:208:28: fatal error: linux/videodev.h: No such file or directory To fix it, install libv4l-dev and link to it with the following commands: sudo apt-get install libv4l-dev sudo ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h

Manually Installing wxWidgets
Download the wxWidgets 2.8.8 sources (either wxGTK or wxAll) [ http://sourceforge.net/projects/wxwindows/files/wxAll/2.8.8/ ] and compile and install them. tar xfz wxWidgets-2.8.8.tar.gz cd wxWidgets-2.8.8 ./configure make sudo make install You are free to change the prefix here, as SwisTrack uses 'wx-config' to locate wxWidgets.

Installing Optional Libraries
If you have a FireWire camera, install the 1394camera driver.

Installing OpenCV legacy packages
Depending on the opencv version installed in your system, you may also need to install the OpenCV legacy packages. In that case, run the following command:

sudo apt-get install libcv-dev libhighgui-dev libcvaux-dev libcv2.3 libcvaux2.3 libhighgui2.3

Library Paths
Depending on your system configuration, SwisTrack will complain about missing libraries. You may see error messages like this:

./SwisTrack: error while loading shared libraries: libwx_gtk2_aui-2.8.so.0: cannot open shared object file: No suchfile or directory

In this case, you need to set your LD_LIBRARY_PATH variable to point to the directory where these libraries are installed. If you are using a bash shell, this can be achieved as follows:

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

On Ubuntu 10.10 the following is required : and create a dynamic link on the cvaux libs :   in /usr/lib/