- Ubuntu 20.04, 22.04
- Linux Mint 18.x / 20.x
Open a terminal Ctrl
+Alt
+t
(usually) and type the followings commands:
$ sudo apt install clang cmake git graphviz libasound-dev libglew-dev libqt5opengl5-dev libqt5svg5-dev lld llvm net-tools ninja-build pigz qtbase5-dev rsync wish xterm xxd
-
Ubuntu 21.10 or higher (only with APT):
$ sudo apt install libdav1d-dev
-
otherwise, you'll have to compile and install from source. The repo is found at https://code.videolan.org/videolan/dav1d
- Clone the repo:
git clone https://code.videolan.org/videolan/dav1d.git
- Enter the new folder:
$ cd dav1d
- Make a build directory:
$ mkdir build && cd build
- Configure meson:
$ meson ..
- Compile:
$ ninja
- Install:
$ sudo ninja install
- Trick your system into believing you have the correct version (1 of 2):
$ cd /usr/local/lib/x86_64-linux-gnu
- (2 of 2):
$ sudo ln --symbolic libdav1d.so.6.7.0 libdav1d.so.4
- Close this terminal or use
cd
to change directory again, whatever you do don't remain in this library path by accident.
- Clone the repo:
- Install git -
$ sudo apt-get install git git-core git-gui git-doc
- Install gitg -
$ sudo apt-get install gitg
- Set up git you can do that by reading this page (Attention: "Your Name here" means "Nome Cognome")
- Colorize git:
$ git config --global color.status auto
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo reboot
- Create a folder called RoboCup in your home folder -
$ mkdir RoboCup
- Enter in the RoboCup folder -
$ cd RoboCup
- Execute the command to clone -
$ git clone https://github.com/SPQRTeam/spqr2023.git
- Download source of OpenCV
wget https://github.com/opencv/opencv/archive/3.4.1.zip
- Unzip the files
unzip 3.4.1.zip
- Move into OpenCV directory
cd opencv-3.4.1
- Create the build directory
mkdir build && cd build
- Generate the make file
cmake -DWITH_QT=OFF -DWITH_OPENGL=OFF -DBUILD_SHARED_LIBS=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DWITH_CUDA=OFF -DQT_NO_VERSION_TAGGING=ON -DWITH_PNG=OFF -DWITH_TIFF=OFF -DWITH_WEBP=OFF -DWITH_OPENJPEG=OFF -DWITH_JASPER=OFF -DWITH_OPENEXR=OFF -DBUILD_TBB=ON ..
-
Open
opencv-3.4.1/modules/python/src2/cv2.cpp
. Move to line 889 and replacechar* str = PyString_AsString(obj);
withconst char* str = PyString_AsString(obj);
-
Compile
make -j#num of core of your cpu
- Install OpenCV
sudo make install
and then
sudo ldconfig
Whenever a file is added/removed/modified, we need to regenerate the CMakeLists file with:
NO_CLION=True path/to/repo/root/Make/Linux/generate
path/to/repo/root/Make/Linux/compile
It might be beneficial to create a bash script that does this automatically:
#! /bin/bash
cd spqr2023 # Go to repo root. REPLACE WITH YOUR OWN PATH.
touch Make/CMake/Nao.cmake # notice new symbols in new files
NO_CLION=true Make/Linux/generate # notice new files
Make/Linux/compile # compile!
You could even want to associate this command with a bash alias to speed things up.
## Possible issues (Ubuntu)
Here's a list of known issues and errors and their respective solutions:
-
Error: CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
Solution:
- Install ninja-build
sudo apt-get install ninja-build
-
Error: clang: error: invalid linker name in argument '-fuse-ld=lld'
Solution:
- Install llvm
sudo apt-get install llvm
- Export its path to
-
GCC version error: if you get an error that looks like a compiler version error (such as "no member named 'strlen' in namespace 'std'")
The framework requires a GCC version <= 11. You can check what GCC version clang is using by typing
clang -v
Pay attention to the line
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/XX
Where instead of XX there will be the selected GCC version.