Table of contents
Install cmake and other dependent libraries
Compile and install ceres-slover
Install monitoring software jtop
Change source for ubuntu18.04
sudo gedit /etc/apt/sources.list
(The following is the relevant source ubuntu18.04 arm version, nx can be used directly)
#阿里源
deb http://mirrors.aliyun.com/ubuntu-ports/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
#中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#163源
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
sudo apt-get update
If the source change fails, be sure to check your own network
If the network connection is normal and the source change still fails:
Open software and update: check and switch Ali source as shown in the figure
Close Software & Updates:
Click to reload
Can be ignored: select 20W 6CORE mode in the upper right corner (optional)
Install cmake and other dependent libraries
sudo apt-get install cmake-gui
If the cmake-gui installation fails here: it is probably a source problem, check the source, update
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev python-pip
Compile and install opencv
Unzip the opencv compressed package in the u disk to the home directory (or download it yourself, the version is opencv4.5.3)
You can go to the official website to download, or you can download the installation package from me
Link: https://pan.baidu.com/s/1AqR_G1n4gsWYorB36LHMhQ
Extraction code: x8qk
Unzip opencv_contrib to the opencv folder (optional)
Create folder build in opencv folder
open cmake-gui
The first directory selects the opencv folder
The second selects the build folder
Click configure, then select BUILD_opencv_world
CMAKE_BUILD_TYPE input Release
OPENCV_EXTRA_MODULES_MATH selects the module folder in opencv_contrib (optional)
Click configure, click generate
Go to the build folder
make -j4(根据minipc核心数量,如12线程则最多可选-j12)
sudo make install
Compile and install ceres-slover
(git clone https://ceres-solver.googlesource.com/ceres-solver )
You can also download the installation package from me, link: https://pan.baidu.com/s/1hmC1mq0GvDRDugwZBms-Kg Extraction code: tagw
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
# Use ATLAS for BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse and CXSparse (optional)
sudo apt-get install libsuitesparse-dev
Enter the ceres-solover directory
create build folder
Go to the build folder
cmake ..
make -j6
sudo make install
Upgrade gcc:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
If the previous step prompts that the connection has timed out, check the network first
sudo apt-get update
sudo apt-get install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 20
(In this step, if it prompts that the link library is damaged, update it again)
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 19
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 19
sudo update-alternatives --config gcc
Select gcc11 according to the prompt
sudo update-alternatives --config g++
Select g++11 according to the prompt
(tips: sudo update-alternatives –-config xxx can choose gcc/g++ version, different versions may be needed when compiling different libraries)
Install monitoring software jtop
sudo -H pip install -U jetson-stats
Install QT
sudo apt-get install qt5-default qtcreator -y
Install the camera driver (http://download.huaraytech.com/pub/sdk/), pay attention to the architecture, nuc is x86, tx2/nx is arm (nuc can choose the latest version to install, tx2/nx choose aarch64/arm linux version )
Put the camera driver into tx2 (MVviewer_Ver2.2.3_Linux_arm_Jetson_TX2_Build20200311.run)
Enter the placement location (preferably not on the desktop)
sudo sh MVviewer_Ver2.2.3_Linux_arm_Jetson_TX2_Build20200311.run //文件名
If there are no special requirements, the environment construction has been completed at this step. Readers can move to view other people's excellent articles.
Solve the problem that cuda-runtime-api.h cannot be found when linking (stupid way)
sudo cp -r /usr/local/cuda/include/* /usr/include/aarch64-linux-gnu
Check whether it has been set to automatically log in when booting, not to automatically turn off the screen, and to automatically sleep
Create a folder SD in the home directory and download the code with git
(note if ssh has been added)
Start-up settings
Execute in terminal
gnome-session-properties
Add "tools/dog.sh" in the code project, namely:
gnome-terminal -- /home/nvidia/SD/Fastest/tools/dog.sh
I have little talent and knowledge, if there is any misunderstanding, please correct me, thank you for watching.