-
Notifications
You must be signed in to change notification settings - Fork 48
Build
NOTE CoreCVS is in process of migration to cmake. New way of building is available at branch master_cmake. For the guide please see - CMakeBuild
A word on prerequisites. Core of the project has no dependances and should work with C++14. Only prerequisite would be qmake. However if you only need core, you would have to comment out all the other sub-projects.
- Get git
sudo apt-get install git
- Clone the repository
mkdir student cd student git clone https://github.com/PimenovAlexander/corecvs.git .
- Check if you have prerequisites installed (Qt should be Qt5)
sudo apt-get install qt5-default qt5-qmake gcc g++ sudo apt-get install libqt5serialport5-dev
- Optional prerequisites. I recommend installing them, it they are avalibale they would be used autmomatically, in case you force them off in cvs-config.pri
sudo apt-get install libjpeg-dev libpng-dev
sudo apt-get install libopenblas-dev liblapacke-dev
- Optional prerequisites. I recommend installing them, otherwise you will have to switch them off in cvs-config.pri file.
Ubuntu Xenial
sudo apt-get install libtbb-dev libcv-dev libhighgui-dev graphviz valgrind libxtst-dev sudo apt-get install libavcodec-dev libavutil-dev libavformat-dev libswscale-dev
Ubuntu Cosmic 18.10
sudo apt-get install libtbb-dev libopencv-*3.* graphviz valgrind libxtst-dev sudo apt-get install libavcodec-dev libavutil-dev libavformat-dev libswscale-dev sudo apt-get install libfftw3-dev libsoapysdr-dev
-
QScript If you get error with qscript module you can
- Add following packages
sudo apt-get install qtscript-tools qtscript5-dev
- Remove qscript from options i.e in cvs-config.pri comment out "with_qscript". After this you would need to clean and rebuild.
- Add following packages
-
You will also need to either build Google Test (http://askubuntu.com/questions/145887/why-no-library-files-installed-for-google-test), or switch off all tests. Let's review your options
- Install gtest in the system (not ideal)
sudo apt-get install libgtest-dev cmake cd /usr/src/gtest sudo cmake . sudo make sudo mv libg* /usr/lib/
- Clone gtest inside our repo (recommended) So far it is not submodule for political reasons. You may do it submodule in your fork.
mkdir -P siblings cd ./siblings git clone https://github.com/google/googletest.git cp -r googletest/googletest gtest
Alternatively
cd ./siblings ./clone_gtest.sh
After this - cvs-open.pro would find it.
- Disable tests on cvs-open.pro (discouraged)
- Configuration is stored in file cvs-config.pri. Please edit it according to how you want to build the project
- Enter the root directory of the code enter
qmake -r && make
Or on all cores
qmake -r && make -j
Currently we support OpenCV 3.X You could either build it yourself or install from repository - OpenCV guide
NB. Please switch shadow build off
This file allows you to switch on and off several features of the build
- with_sse - allow compiler and our code to use SSE
- with_sse3
- with_sse4
- with_avx - allow compiler and our code to use AVX
- with_avx2
- with_tbb - try use TBB (Intel thread building blocks)
- with_blas - try use BLAS (OpenBlas or MKL)
- with_native - auto detect configuration
Dependency related. If there is a problem with a build try switching off dependences
- with_ueye - add IDS UEye camera support
- with_opencv - add openCV wrappers
- with_avcodec - add AV Codec support for input (needs libavcodec-dev libavutil-dev)
- with_qscript - switch off QScript support. Switch it off you rarely need it
There are sometimes cases when you need to clean the build directory to fix qmake errors
- Caution. Burn all non committed and not belonging to work copy to the ground.
git clean -dfx
- Use typical qmake clean procedure
make distclean
- Remove all Makefiles. This basically reverses call to "qmake -r"
find . -name "Makefile*" -delete
- Remove all objects and binaries
rm -rf ./bin/* rm -rf ./.obj/*
- TLDR
make distclean find . -name "Makefile*" -delete rm -rf ./bin/* rm -rf ./.obj/*
