Skip to content

Development environment

Jelle Spijker edited this page Aug 19, 2015 · 33 revisions

Development Environment

The software for the VSA is written in C++ on a Desktop computer running Linux 3.19.0-18-generic #. Ubuntu 15.04 is the environment of choice. The prefered IDE is QT Creator Community edition This is an opensource IDE and available for Linux/Windows/Mac. Version control is done via Github the main project page is VisionSoilAnalyzer - project page. The following page all installed packages by Jelle is a good starting reference. The packages below are the absolute minimum needed to start development.

It is advised to make a clone of your harddisk after the development environment setup is complete. Clonezilla is the recommended tool.

Cross-compiling can be setup using a Change Root

Below is a list of used libraries during and their installation instructions:

Common packages

sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev libv4l-dev v4l-utils libqt5multimediawidgets5 clang libboost-all-dev cheese cmake-qt-gui qt-sdk libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libtiff5-dev libgstreamer0.10-dev libpython3-all-dev libpython-all-dev libbz2-dev valgrind python3-numpy

sudo apt-get purge nvidia*
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-355 nvidia-settings
sudo nvidia-xconfig
sudo apt-get install bumblebee bbswitch-dkms primus
sudo systemctl enable bumblebeed
sudo echo "i915" >> /etc/modules-load.d/modules.conf && sudo echo "bbswitch" >> /etc/modules-load.d/modules.conf
sudo ln -s /usr/lib/nvidia-current /usr/lib/nvidia-355
sudo ln -s /usr/lib32/nvidia-current /usr/lib32/nvidia-355
sudo nano /etc/bumblebee/bumblebee.conf
change the parameter Driver= > Driver=nvidia
change the parameter KernelDriver=nvidia-current > KernelDriver=nvidia-355

restart the computer

wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/rpmdeb/cuda-repo-ubuntu1410-7-0-local_7.0-28_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1410-7-0-local_7.0-28_amd64.deb
sudo apt-get update
sudo apt-get install cuda
export PATH=/usr/local/cuda-7.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH

wget http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
sudo chmod +x qt-unified-linux-x64-online.run
./qt-unified-linux-x64-online.run

cd ~/\<my_working _directory\>/
git clone https://github.com/Itseez/opencv.git
cd opencv
mkdir release
cd release
Enter the following command for an NVIDIA CUDA enabled environment:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_CUDA_STUBS=ON -D BUILD_DOCS=OFF -D BUILD_JPEG=ON -D BUILD_PNG=ON -D BUILD_TESTS=OFF -D BUILD_WITH_DEBUG_INFO=OFF -D CUDA_FAST_MATH=ON -D ENABLE_FAST_MATH=ON -D WITH_CUBLAS=ON WITH_OPENGL=ON WITH_QT=ON ..
Or the command below for a computer that has no NVIDIA CUDA capabilities:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=OFF -D BUILD_DOCS=OFF -D BUILD_JPEG=ON -D BUILD_PNG=ON -D BUILD_TESTS=OFF -D BUILD_WITH_DEBUG_INFO=OFF -D ENABLE_FAST_MATH=ON -D WITH_OPENGL=ON -D WITH_QT=ON ..

make -jnumber of processors
sudo make install
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig

wget http://zlib.net/zlib-1.2.8.tar.gz
tar xf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make -jnumber of processors
sudo make install

Optional packages

Furthermore it is advised to install the following packages

  • Timeshift
  • cmake
  • Clang
  • build-essential
  • git
  • doxygen
  • kcachegrind
  • v4l-utils
  • libv4l-dev
  • libgtk2.0-dev
  • pkg-config
  • libavcodec-dev
  • libavformat-dev
  • libswscale-dev
  • python-dev
  • python-numpy
  • libtbb2
  • libtbb-dev
  • libjpeg-dev
  • libpng-dev
  • libtiff-dev
  • libjasper-dev
  • libdc1394-22-dev

Testing and benchmarking

Testing is done using the QT unit test framework resulst are verified against know results. Which are calculated via Matlab, Mathematica or Python. Benchmarks are done using the QT unit test framework and will test multiple solutions. Solutions that are deemed obsolete by the benchmark results will not be removed but be renamed with a _ in front of the functionname _<FunctionName>. Valgrind is used to determine memomory leakages and function profiles. These function profiles will be the guide which determine the priority of functions to be optimized.

Source documention

The detailed Doxygen documentation of the current program and libs can be found source documentation. It consists of detailed graphs, the complete source code and the internal structure of the program. This page is generated using Doxygen. This programs grabs user comments and converts them to source code documentation. Documentation [Rules](Doxygen Rules) are to be followed when writing code