“Ubuntu-16.04.6 64位开发环境指导”的版本间的差异

来自乐兔兔Wiki
跳到导航 跳到搜索
 
(未显示同一用户的25个中间版本)
第1行: 第1行:
开发前需要在PC安装好Linux操作系统,推荐使⽤Ubuntu 16.04 64bit发行版
+
=='''Linux系统部署'''==
==开发环境搭建==
+
开发前需要在PC安装好Linux操作系统,推荐使Ubuntu 16.04 或者更高版本,150G(推荐500G以上) 空闲硬盘。
需要安装一些常用软件
 
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-e
 
ssential chrpath socat libsdl1.2-dev u-boot-tools
 
sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html doc
 
book-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-d
 
ev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
 
  
将软件源替换成清华源,
+
:可到网盘下载Vmware 14、Ubuntu 16.04镜像文件,以及《vmware14虚拟机安装教程》
清华源网址如下:
 
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
 
选择16.04 ,然后把内容更新到 /etc/apt/source.list 文件中。
 
  
 +
=='''开发环境部署'''==
 +
*安装一些常用软件为yocto工程做准备,执行如下命令:
 +
<pre style="color: #3e45a9">
 +
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev u-boot-tools
 +
</pre>
 +
:如果是Ubuntu 12.04或14.04,执行如下命令:
 +
<pre style="color: #3e45a9">
 +
$ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
 +
</pre>
 +
 +
*将软件源替换成清华源
 
:备份源
 
:备份源
  cp /etc/apt/sources.list /etc/apt/sources.list-bak
+
<pre style="color: #3e45a9">
:复制16.04清华源内容到此/etc/apt/sources.list 文件,更新源
+
  $ sudo cp /etc/apt/sources.list /etc/apt/sources.list-bak
  apt-get update
+
</pre>
 +
:清华源网址:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ 选择16.04 ,然后把内容更新到 /etc/apt/source.list 文件中,更新源
 +
<pre style="color: #3e45a9">
 +
  $ sudo apt-get update
 +
</pre>
 +
*安装repo
 +
<pre style="color: #3e45a9">
 +
$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
 +
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
 +
$ chmod a+x ~/bin/repo
 +
$ export PATH=~/bin:$PATH
 +
</pre>
 +
*配置git
 +
<pre style="color: #3e45a9">
 +
$ git config --global user.name "Your Name"
 +
$ git config --global user.email "Your Email"
 +
$ git config --list
 +
</pre>
  
== 安装交叉编译工具链 ==
+
== '''安装交叉编译工具链''' ==
到网盘下载fsl-imx-xwayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.9.88-2.0.0.sh文件拷贝并解压到你的工作目录下,修改权限、执行脚本
+
到网盘下载fsl-imx-xwayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.14-sumo.sh文件拷贝并解压到你的工作目录下,修改权限、执行脚本
 
<pre style="color: #3e45a9">
 
<pre style="color: #3e45a9">
  $ chmod a+x fsl-imx-xwayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.9.88-2.0.0.sh
+
  $ chmod a+x fsl-imx-xwayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.14-sumo.sh
  $ ./fsl-imx-xwayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.9.88-2.0.0.sh
+
  $ ./fsl-imx-xwayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.14-sumo.sh
 
</pre>
 
</pre>
 
串口输出如下信息,安装目录默认为/opt/fsl-imx-xwayland,按回车继续安装
 
串口输出如下信息,安装目录默认为/opt/fsl-imx-xwayland,按回车继续安装
 
<pre style="color: #3e45a9">
 
<pre style="color: #3e45a9">
NXP i.MX Release Distro SDK installer version 4.9.88-2.0.0
+
NXP i.MX Release Distro SDK installer version 4.14-sumo
==========================================================
+
=======================================================
Enter target directory for SDK (default: /opt/fsl-imx-xwayland/4.9.88-2.0.0):  
+
Enter target directory for SDK (default: /opt/fsl-imx-xwayland/4.14-sumo):  
 
</pre>
 
</pre>
 
安装完成后,执行source指令使交叉编译器配置生效,查看交叉编译器版本
 
安装完成后,执行source指令使交叉编译器配置生效,查看交叉编译器版本
第39行: 第58行:
 
Using built-in specs.
 
Using built-in specs.
 
COLLECT_GCC=aarch64-poky-linux-gcc
 
COLLECT_GCC=aarch64-poky-linux-gcc
COLLECT_LTO_WRAPPER=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/lto-wrapper
+
COLLECT_LTO_WRAPPER=/home/ydf/tool/opt/fsl-imx-xwanyland/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/lto-wrapper
 
Target: aarch64-poky-linux
 
Target: aarch64-poky-linux
Configured with: ../../../../../../work-shared/gcc-7.3.0-r0/gcc-7.3.0/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=aarch64-poky-linux --prefix=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr --bindir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --sbindir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --libexecdir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux --datadir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/com --localstatedir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/var --libdir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux --includedir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/opt/fsl-imx-xwayland/4.9.88-2.0.0/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/duxy/linux_4.9.88_2.0.0/build-ori-wayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=aarch64-poky-linux- --without-local-prefix --enable-lto --enable-libssp --enable-libitm --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/7.3.0 --with-build-time-tools=/home/duxy/linux_4.9.88_2.0.0/build-ori-wayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot-native/usr/aarch64-poky-linux/bin --with-sysroot=/not/exist --with-build-sysroot=/home/duxy/linux_4.9.88_2.0.0/build-ori-wayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --without-long-double-128 --enable-poison-system-directories --with-mpfr=/home/duxy/linux_4.9.88_2.0.0/build-ori-wayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --with-mpc=/home/duxy/linux_4.9.88_2.0.0/build-ori-wayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --enable-nls --enable-initfini-array --enable-__cxa_atexit
+
Configured with: ../../../../../../work-shared/gcc-7.3.0-r0/gcc-7.3.0/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=aarch64-poky-linux --prefix=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr --bindir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --sbindir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --libexecdir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux --datadir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/com --localstatedir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/var --libdir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux --includedir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/ydf/yocto_project/4.14.98/build-xwayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=aarch64-poky-linux- --without-local-prefix --enable-lto --enable-libssp --enable-libitm --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/7.3.0 --with-build-time-tools=/home/ydf/yocto_project/4.14.98/build-xwayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot-native/usr/aarch64-poky-linux/bin --with-sysroot=/not/exist --with-build-sysroot=/home/ydf/yocto_project/4.14.98/build-xwayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --without-long-double-128 --enable-poison-system-directories --with-mpfr=/home/ydf/yocto_project/4.14.98/build-xwayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --with-mpc=/home/ydf/yocto_project/4.14.98/build-xwayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --enable-nls --enable-initfini-array --enable-__cxa_atexit
 
Thread model: posix
 
Thread model: posix
gcc version 7.3.0 (GCC)
+
gcc version 7.3.0 (GCC)  
 
</pre>
 
</pre>

2019年12月21日 (六) 11:30的最新版本

Linux系统部署

开发前需要在PC安装好Linux操作系统,推荐使Ubuntu 16.04 或者更高版本,150G(推荐500G以上) 空闲硬盘。

可到网盘下载Vmware 14、Ubuntu 16.04镜像文件,以及《vmware14虚拟机安装教程》

开发环境部署

  • 安装一些常用软件为yocto工程做准备,执行如下命令:
 $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev u-boot-tools
如果是Ubuntu 12.04或14.04,执行如下命令:
 $ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
  • 将软件源替换成清华源
备份源
 $ sudo cp /etc/apt/sources.list /etc/apt/sources.list-bak
清华源网址:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ 选择16.04 ,然后把内容更新到 /etc/apt/source.list 文件中,更新源
 $ sudo apt-get update
  • 安装repo
 $ mkdir ~/bin (this step may not be needed if the bin folder already exists)
 $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
 $ chmod a+x ~/bin/repo
 $ export PATH=~/bin:$PATH
  • 配置git
 $ git config --global user.name "Your Name"
 $ git config --global user.email "Your Email"
 $ git config --list

安装交叉编译工具链

到网盘下载fsl-imx-xwayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.14-sumo.sh文件拷贝并解压到你的工作目录下,修改权限、执行脚本

 $ chmod a+x fsl-imx-xwayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.14-sumo.sh
 $ ./fsl-imx-xwayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.14-sumo.sh

串口输出如下信息,安装目录默认为/opt/fsl-imx-xwayland,按回车继续安装

NXP i.MX Release Distro SDK installer version 4.14-sumo
=======================================================
Enter target directory for SDK (default: /opt/fsl-imx-xwayland/4.14-sumo): 

安装完成后,执行source指令使交叉编译器配置生效,查看交叉编译器版本

 $ source /opt/fsl-imx-xwayland/4.9.88-2.0.0/environment-setup-aarch64-poky-linux
 $ $CC -v

串口输出如下,交叉编译器安装成功

Using built-in specs.
COLLECT_GCC=aarch64-poky-linux-gcc
COLLECT_LTO_WRAPPER=/home/ydf/tool/opt/fsl-imx-xwanyland/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/lto-wrapper
Target: aarch64-poky-linux
Configured with: ../../../../../../work-shared/gcc-7.3.0-r0/gcc-7.3.0/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=aarch64-poky-linux --prefix=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr --bindir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --sbindir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --libexecdir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux --datadir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/com --localstatedir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/var --libdir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux --includedir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/ydf/yocto_project/4.14.98/build-xwayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=aarch64-poky-linux- --without-local-prefix --enable-lto --enable-libssp --enable-libitm --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/7.3.0 --with-build-time-tools=/home/ydf/yocto_project/4.14.98/build-xwayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot-native/usr/aarch64-poky-linux/bin --with-sysroot=/not/exist --with-build-sysroot=/home/ydf/yocto_project/4.14.98/build-xwayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --without-long-double-128 --enable-poison-system-directories --with-mpfr=/home/ydf/yocto_project/4.14.98/build-xwayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --with-mpc=/home/ydf/yocto_project/4.14.98/build-xwayland/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --enable-nls --enable-initfini-array --enable-__cxa_atexit
Thread model: posix
gcc version 7.3.0 (GCC)