全局路径规划(2)_Ubuntu18.04软件安装

1)QT5.9.3 及QTcreator

          (1)点击QT镜像下载地址_run,或者 点击QT官方地址
          (2)安装

morven@ubuntu:~/下载$ chmod +x qt-opensource-linux-x64-5.9.3.run 
morven@ubuntu:~/下载$ ./qt-opensource-linux-x64-5.9.3.run 
[3761] Warning: QString::arg: 1 argument(s) missing in 无法解析%2中的符号“%2”:%3
morven@ubuntu:~/下载$ 

在这里插入图片描述
          (3)运行,注意选择Desktop gcc 64-bit 组件
在这里插入图片描述
在这里插入图片描述

# 1) QT-creator

sudo apt-get install qtcreator
//删除 sudo apt-get remove qt5-default qtcreator/qt*
//单独安装新建C++项目时kit配置问题,不建议单独安装

国内下载vscode速度慢问题解决

2)Cmake及编译必须包

          (1)优先安装最新版本。

morven@ubuntu:~/桌面$ sudo snap install cmake  # version 3.23.1
error: This revision of snap "cmake" was published using classic confinement and thus may perform
       arbitrary system changes outside of the security sandbox that snaps are usually confined to,
       which may put your system at risk.

       If you understand and want to proceed repeat the command including --classic.
morven@ubuntu:~/桌面$ sudo snap install cmake --classic
cmake 3.23.1 from Crascit✓ installed
morven@ubuntu:~/桌面$ cmake --version
cmake version 3.23.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
morven@ubuntu:~/桌面$ 

          (2)安装软件必须编译包

sudo apt-get update
sudo apt-get install -y build-essential

          解决问题:
          The CXX compiler identification is unknown CMake Error at CMakeLists.txt:97 (project):
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment variable “CXX” or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

3)Git

          (1)git安装

 morven@ubuntu:/$ sudo add-apt-repository ppa:git-core/ppa
morven@ubuntu:/$ sudo apt-get update

morven@ubuntu:/$ sudo apt-get install git
    
下列软件包是自动安装的并且现在不需要了:
  libgit2-26 libgit2-glib-1.0-0 libgtkspell3-3-0 libhttp-parser2.7.1 libssh2-1
  mercurial mercurial-common
使用'sudo apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
  git-man libpcre2-8-0
建议安装:
  git-daemon-run | git-daemon-sysvinit git-doc git-email git-gui gitk gitweb
  git-cvs git-mediawiki git-svn
下列【新】软件包将被安装:
  git libpcre2-8-0
下列软件包将被升级:
  git-man

正在设置 git-man (1:2.36.1-0ppa1~ubuntu18.04.1) ...
正在设置 libpcre2-8-0:amd64 (10.31-2) ...
正在设置 git (1:2.36.1-0ppa1~ubuntu18.04.1) ...
正在处理用于 man-db (2.8.3-2ubuntu0.1) 的触发器 ...
正在处理用于 libc-bin (2.27-3ubuntu1.5) 的触发器 ...
morven@ubuntu:/$ git version
git version 2.36.1

不推荐旧版本

sudo apt install git 

          (2)配置SSH

morven1@ubuntu:~/SoftApp/QT/Apollo/Build$ git config --global user.name "morvenxie"
morven1@ubuntu:~/SoftApp/QT/Apollo/Build$ git config --global user.email "morven_xie@163.com"
morven1@ubuntu:~/SoftApp/QT/Apollo/Build$  ssh-keygen -t rsa -C “morven_xie@163.com”
Generating public/private rsa key pair.
Enter file in which to save the key (/home/morven1/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/morven1/.ssh/id_rsa.
Your public key has been saved in /home/morven1/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:zKI+HJh/qzm/aCoLKnoglMuXlGgOU2Qa8edX4JJ/QSw “morven_xie@163.com”
The key's randomart image is:
+---[RSA 2048]----+
|ooo   ...        |
| =.  oEo.        |
|..+ = ..o        |
|o= = o + .       |
|*.ooo + S        |
|o+oo.o o         |
|o..o..           |
|= ..*o.          |
|*+.o=*+o         |
+----[SHA256]-----+
morven1@ubuntu:~/SoftApp/QT/Apollo/Build$ 
morven1@ubuntu:~/SoftApp/QT/Apollo/Build$ cd ~/.ssh
morven1@ubuntu:~/.ssh$ ll
总用量 16
drwx------  2 morven1 morven1 4096 Mar 28 08:13 ./
drwxr-xr-x 23 morven1 morven1 4096 Mar 28 08:12 ../
-rw-------  1 morven1 morven1 1679 Mar 28 08:13 id_rsa
-rw-r--r--  1 morven1 morven1  406 Mar 28 08:13 id_rsa.pub
morven1@ubuntu:~/.ssh$ vim id_rsa.pub 
morven1@ubuntu:~/.ssh$ 

          (3)添加网页SSH
在这里插入图片描述
          (4)连接测试及下载

morven1@ubuntu:~/.ssh$ ssh git@github.com
PTY allocation request failed on channel 0
Hi MorvenXie! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
morven1@ubuntu:~/SoftApp/QT/Apollo/Build$ git clone git@github.com:MorvenXie/ADV.git
正克隆到 'ADV'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
接收对象中: 100% (3/3), 7.24 KiB | 7.24 MiB/s, 完成.

          (5)安装gitg查看git变更树状图(可用smartgit替代)。

morven@ubuntu:~/桌面$ sudo apt-get install gitg

4)meld

          用于对比代码更新内容。

sudo apt-get install meld

在这里插入图片描述

5)信使

          ubuntu局域网通讯通讯软件,可与Win10系统飞秋联网,用于传递文件。

sudo apt-get install iptux

6) Notepad++和vim

          用于文档和代码编辑。

sudo add-apt-repository ppa:notepadqq-team/notepadqq
sudo apt-get update
sudo apt-get install notepadqq
sudo apt-get install vim

6+)gcc/g++/make等

sudo apt-get install build-essential
//  gcc/g++/make 通过build-essential一个命令直接安装
make --version
//sudo apt-get install cmake
sudo apt-get install neofetch
sudo apt-get install curl
sudo apt-get install wget
sudo apt-get install htop

7) 百度Apollo用第三方库

          以下内容可直接使用脚本安装。

7.1) glog

          (1)参考文档:linux 下glog的安装

-- Install configuration: ""
-- Installing: /usr/local/lib/libglog.so.0.5.0
-- Installing: /usr/local/lib/libglog.so.0
-- Installing: /usr/local/lib/libglog.so
-- Installing: /usr/local/include/glog/export.h
-- Installing: /usr/local/include/glog/logging.h
-- Installing: /usr/local/include/glog/raw_logging.h
-- Installing: /usr/local/include/glog/stl_logging.h
-- Installing: /usr/local/include/glog/vlog_is_on.h
-- Installing: /usr/local/include/glog/log_severity.h
-- Installing: /usr/local/lib/pkgconfig/libglog.pc
-- Installing: /usr/local/lib/cmake/glog/glog-modules.cmake
-- Installing: /usr/local/lib/cmake/glog/glog-config.cmake
-- Installing: /usr/local/lib/cmake/glog/glog-config-version.cmake
-- Installing: /usr/local/lib/cmake/glog/glog-targets.cmake
-- Installing: /usr/local/lib/cmake/glog/glog-targets-noconfig.cmake

7.2) Protobuf 3.20

          (1)参考文档:protobuf安装_通过Gitee安装Protobuf

          (2)使用

//    protoc ./test.proto --cpp_out=./
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC/modules/common/proto$ protoc --version
libprotoc 3.20.0
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC/modules/common/proto$ ls
BUILD              drive_state.proto  header.proto
direction.proto    error_code.proto   pnc_point.proto
drive_event.proto  geometry.proto     vehicle_signal.proto
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC/modules/common/proto$ protoc ./header.proto --cpp_out=./
modules/common/proto/error_code.proto: File not found.
header.proto:5:1: Import "modules/common/proto/error_code.proto" was not found or had errors.
header.proto:30:12: "StatusPb" is not defined.
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC/modules/common/proto$ protoc ./error_code.proto --cpp_out=./
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC/modules/common/proto$ ls
BUILD              drive_state.proto  error_code.proto  pnc_point.proto
direction.proto    error_code.pb.cc   geometry.proto    vehicle_signal.proto
drive_event.proto  error_code.pb.h    header.proto
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC/modules/common/proto$ 

          (3)注意文件目录层次

morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC/modules/common/proto$ head -n 10 ./header.proto 
syntax = "proto2";

package apollo.common;

import "modules/common/proto/error_code.proto";

message Header {
  // Message publishing time in seconds.
  optional double timestamp_sec = 1;

morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC/modules/common/proto$ protoc --cpp_out=.  ./header.proto 
modules/common/proto/error_code.proto: File not found.
header.proto:5:1: Import "modules/common/proto/error_code.proto" was not found or had errors.
header.proto:30:12: "StatusPb" is not defined.
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC/modules/common/proto$ cd ../../..
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC$ protoc --cpp_out=.  modules/common/proto/header.proto 
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC$ ls
BDA_ADV.pro  BDA_ADV.pro.user  main.cpp  modules  Pub_Libs.pri
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC$ ls modules/common/proto/BUILD              error_code.pb.cc  header.pb.cc     vehicle_signal.proto
direction.proto    error_code.pb.h   header.pb.h
drive_event.proto  error_code.proto  header.proto
drive_state.proto  geometry.proto    pnc_point.proto
morven1@ubuntu:~/SoftApp/QT/Apollo/BaiduApollo_ADV/SRC$ 

7.3) gtest

          (1)参考文档:Ubuntu安装GoogleTest

morven1@ubuntu:~/SoftApp/PublicSoft/PubSoft/google-gtest/googletest$ sudo make install
[sudo] morven1 的密码: 
[ 25%] Built target gtest
[ 50%] Built target gmock
[ 75%] Built target gmock_main
[100%] Built target gtest_main
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/include
-- Installing: /usr/local/include/gmock
-- Installing: /usr/local/include/gmock/gmock-spec-builders.h
-- Installing: /usr/local/include/gmock/gmock-nice-strict.h
-- Installing: /usr/local/include/gmock/internal
-- Installing: /usr/local/include/gmock/internal/gmock-port.h
-- Installing: /usr/local/include/gmock/internal/gmock-pp.h
-- Installing: /usr/local/include/gmock/internal/custom
-- Installing: /usr/local/include/gmock/internal/custom/gmock-port.h
-- Installing: /usr/local/include/gmock/internal/custom/README.md
-- Installing: /usr/local/include/gmock/internal/custom/gmock-matchers.h
-- Installing: /usr/local/include/gmock/internal/custom/gmock-generated-actions.h
-- Installing: /usr/local/include/gmock/internal/gmock-internal-utils.h
-- Installing: /usr/local/include/gmock/gmock-function-mocker.h
-- Installing: /usr/local/include/gmock/gmock-cardinalities.h
-- Installing: /usr/local/include/gmock/gmock.h
-- Installing: /usr/local/include/gmock/gmock-actions.h
-- Installing: /usr/local/include/gmock/gmock-matchers.h
-- Installing: /usr/local/include/gmock/gmock-more-matchers.h
-- Installing: /usr/local/include/gmock/gmock-more-actions.h
-- Installing: /usr/local/lib/libgmock.a
-- Installing: /usr/local/lib/libgmock_main.a
-- Installing: /usr/local/lib/pkgconfig/gmock.pc
-- Installing: /usr/local/lib/pkgconfig/gmock_main.pc
-- Installing: /usr/local/lib/cmake/GTest/GTestTargets.cmake
-- Installing: /usr/local/lib/cmake/GTest/GTestTargets-noconfig.cmake
-- Installing: /usr/local/lib/cmake/GTest/GTestConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/GTest/GTestConfig.cmake
-- Up-to-date: /usr/local/include
-- Installing: /usr/local/include/gtest
-- Installing: /usr/local/include/gtest/gtest_pred_impl.h
-- Installing: /usr/local/include/gtest/gtest-message.h
-- Installing: /usr/local/include/gtest/gtest_prod.h
-- Installing: /usr/local/include/gtest/internal
-- Installing: /usr/local/include/gtest/internal/gtest-string.h
-- Installing: /usr/local/include/gtest/internal/gtest-port-arch.h
-- Installing: /usr/local/include/gtest/internal/gtest-death-test-internal.h
-- Installing: /usr/local/include/gtest/internal/gtest-port.h
-- Installing: /usr/local/include/gtest/internal/gtest-filepath.h
-- Installing: /usr/local/include/gtest/internal/gtest-internal.h
-- Installing: /usr/local/include/gtest/internal/gtest-type-util.h
-- Installing: /usr/local/include/gtest/internal/custom
-- Installing: /usr/local/include/gtest/internal/custom/README.md
-- Installing: /usr/local/include/gtest/internal/custom/gtest-port.h
-- Installing: /usr/local/include/gtest/internal/custom/gtest-printers.h
-- Installing: /usr/local/include/gtest/internal/custom/gtest.h
-- Installing: /usr/local/include/gtest/internal/gtest-param-util.h
-- Installing: /usr/local/include/gtest/gtest-printers.h
-- Installing: /usr/local/include/gtest/gtest-param-test.h
-- Installing: /usr/local/include/gtest/gtest.h
-- Installing: /usr/local/include/gtest/gtest-typed-test.h
-- Installing: /usr/local/include/gtest/gtest-test-part.h
-- Installing: /usr/local/include/gtest/gtest-death-test.h
-- Installing: /usr/local/include/gtest/gtest-spi.h
-- Installing: /usr/local/include/gtest/gtest-matchers.h
-- Installing: /usr/local/include/gtest/gtest-assertion-result.h
-- Installing: /usr/local/lib/libgtest.a
-- Installing: /usr/local/lib/libgtest_main.a
-- Installing: /usr/local/lib/pkgconfig/gtest.pc
-- Installing: /usr/local/lib/pkgconfig/gtest_main.pc

7.4) sqlite3

1、sqlite3安装

morven1@ubuntu:~/桌面$ sudo apt-get install sqlite3
[sudo] morven1 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  clang libbotan-2-4 libqbscore1.10 libqbsqtprofilesetup1.10 libqt5concurrent5
  libqt5designer5 libqt5designercomponents5 libqt5help5 libqt5positioning5
  libqt5printsupport5 libqt5qml5 libqt5quick5 libqt5quicktest5
  libqt5quickwidgets5 libqt5script5 libqt5sensors5 libqt5sql5
  libqt5sql5-sqlite libqt5test5 libqt5webchannel5 libqt5webkit5 libqt5xml5
  libqt5xmlpatterns5 libtspi1 linux-hwe-5.4-headers-5.4.0-100
  linux-hwe-5.4-headers-5.4.0-84 linux-hwe-5.4-headers-5.4.0-96 qbs-common
  qml-module-qtgraphicaleffects qml-module-qtqml-models2
  qml-module-qtquick-controls qml-module-qtquick-layouts
  qml-module-qtquick-window2 qml-module-qtquick2
使用'sudo apt autoremove'来卸载它(它们)。
建议安装:
  sqlite3-doc
下列【新】软件包将被安装:
  sqlite3
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 25 个软件包未被升级。
需要下载 752 kB 的归档。
解压缩后会消耗 2,482 kB 的额外空间。
获取:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 sqlite3 amd64 3.22.0-1ubuntu0.4 [752 kB]
已下载 752 kB,耗时 4(170 kB/s)                  
正在选中未选择的软件包 sqlite3。
(正在读取数据库 ... 系统当前共安装有 259068 个文件和目录。)
正准备解包 .../sqlite3_3.22.0-1ubuntu0.4_amd64.deb  ...
正在解包 sqlite3 (3.22.0-1ubuntu0.4) ...
正在设置 sqlite3 (3.22.0-1ubuntu0.4) ...
正在处理用于 man-db (2.8.3-2ubuntu0.1) 的触发器 ...
morven1@ubuntu:~/桌面$ sudo apt-get install libsqlite3-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  clang libbotan-2-4 libqbscore1.10 libqbsqtprofilesetup1.10 libqt5concurrent5
  libqt5designer5 libqt5designercomponents5 libqt5help5 libqt5positioning5
  libqt5printsupport5 libqt5qml5 libqt5quick5 libqt5quicktest5
  libqt5quickwidgets5 libqt5script5 libqt5sensors5 libqt5sql5
  libqt5sql5-sqlite libqt5test5 libqt5webchannel5 libqt5webkit5 libqt5xml5
  libqt5xmlpatterns5 libtspi1 linux-hwe-5.4-headers-5.4.0-100
  linux-hwe-5.4-headers-5.4.0-84 linux-hwe-5.4-headers-5.4.0-96 qbs-common
  qml-module-qtgraphicaleffects qml-module-qtqml-models2
  qml-module-qtquick-controls qml-module-qtquick-layouts
  qml-module-qtquick-window2 qml-module-qtquick2
使用'sudo apt autoremove'来卸载它(它们)。
建议安装:
  sqlite3-doc
下列【新】软件包将被安装:
  libsqlite3-dev
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 25 个软件包未被升级。
需要下载 633 kB 的归档。
解压缩后会消耗 2,135 kB 的额外空间。
获取:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsqlite3-dev amd64 3.22.0-1ubuntu0.4 [633 kB]
已下载 633 kB,耗时 4(175 kB/s)      
正在选中未选择的软件包 libsqlite3-dev:amd64。
(正在读取数据库 ... 系统当前共安装有 259074 个文件和目录。)
正准备解包 .../libsqlite3-dev_3.22.0-1ubuntu0.4_amd64.deb  ...
正在解包 libsqlite3-dev:amd64 (3.22.0-1ubuntu0.4) ...
正在设置 libsqlite3-dev:amd64 (3.22.0-1ubuntu0.4) ...
morven1@ubuntu:~/桌面$ which sqlite3
/usr/bin/sqlite3

7.5) absl

1、参考文档:abseil库的安装.

8)smartgit/gitg

          (1)安装方法

morven@ubuntu:~/桌面$ java -version
Command 'java' not found, but can be installed with:

sudo apt install default-jre            
sudo apt install openjdk-11-jre-headless
sudo apt install openjdk-8-jre-headless 
morven@ubuntu:~/桌面$ sudo apt install openjdk-8-jre-headless 

已下载 15.4 kB,耗时 2(9,081 B/s)
正在读取软件包列表... 完成
morven@ubuntu:~/桌面$ 
morven@ubuntu:~/桌面$ sudo add-apt-repository ppa:eugenesan/ppa
morven@ubuntu:~/桌面$ sudo apt-get update

morven@ubuntu:~/桌面$ java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~18.04-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
morven@ubuntu:~/桌面$ sudo apt-get install smartgithg
//或者
sudo apt-get install smartgithg


//首次拉取时,填写时网址,不是.git结尾的下载地址,另外不是https

版权声明:本文为weixin_44808082原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
THE END
< <上一篇
下一篇>>