第四章-使用易于编译的BaseJay开始编写程序

2020, Oct 19    

这篇文章是介器开源十一章节PlayBook的一部分,欢迎来给我们的提PR,我们的git地址是:https://github.com/Jieqiio/BaseJay/wiki


如何使用您的工业边缘计算单元:第四章-使用易于编译的BaseJay开始编写程序

BaseJay 是介器开源计划的部分,将JayBox开发的SDK整体的使用 Docker 集成在一起,避免的开发应用过程环境搭建的问题。Docker通过在容器中增加一个抽象层,将BlueJayOS的SDK开发环境部署到容器中,确保从开发到产品发布整个过程环境的一致性,可以让开发者在开发到产品发布的整个过程中使用相同的容器来确保没有任何差异或者人工干预。实现在工业生产中的环境标准化和版本控制一致性,同时提供更好的开发安全性。

同时,使用BaseJay SDK的环境,可以让开发者很好的隔离编写程序的过程,可以更好的专注于程序的开发。在编译的时候节约时间,与虚拟机相比,VM启动一般是分钟级,docker容器启动是秒级,丢给BaseJay后,程序员可以轻松的去做其他的事情。

1 环境需求

  • docker
  • 标准的 *nix 环境

我们没有在windows环境下的docker测试过,也欢迎提PR来增加

1.1 准备Docker环境

可以使用brew cask来安装Docker

$ brew cask install docker

或者可以去下载Docker Desktop on Mac的安装包安装, 具体安装过程可以参考 Docker Desktop for Mac user manual. 使用Docker过程,可以阅读Docker 技术入门与实战这本开源的书。

1.2 Install visual studio code IDE

IDE编辑器,我们推荐使用Visual Studio Code,这是一个相当赞的IDE,网站地址是:https://code.visualstudio.com,直接下载安装就行了。

2. BaseJay SDK编译指南

2.1 获取BaseJay

BaseJay已经开源,所有代码都放在github上,地址是:https://github.com/Jieqiio/BaseJay。使用git clone可以获得所有源代码及目前支持的软件包。

git clone https://github.com/Jieqiio/BaseJay.git
cd basejay

2.2 BaseJay介绍

其文件结构是这样的:

packages       # 软件包文件夹
    helloworld     # helloworld示例文件
    libmodbus      # modbus 
    iperf          # iperf
    SOEM           # EtherCAT Master
    fanuc-control  # Fanuc control
    p-net          # P-net Profinet device stack
    MQTT-C         # MQTT
    zstd           # Zstandard - Fast real-time compression algorithm
external       # 外部文件库文件
build          # docker编译好的文件会自动复制到这个文件夹
docker_scripts # 在docker使用的用来编译的脚本,使用的时候会拷贝到docker中去执行
scripts        # 在宿主机中执行的脚本
dockerfile     # BaseJay 环境的docker文件

dockerfile是最重要的文件之一,里面设置了BaseJay创建docker环境时所要执行的脚本,其内容如下:

 
 # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd.
 # SPDX-License-Identifier: GPL 3.0
 # Change Logs:
 # Date           Author       Notes
 # 2019-07-31     tr.yang      the first version
 # 2020-08-09     Yong         the second version


FROM ubuntu:18.04
RUN apt-get update
# RUN apt-get install apt-transport-https ca-certificates gnupg software-properties-common wget -y
# RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
# RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
RUN apt-get update 
RUN apt-get install -y gcc git make screen vim nmap python perl cpio automake libtool pkg-config liblzo2-2 cmake clang-tools doxygen graphviz wget libboost-all-dev libxml2-dev

COPY external/sdk /sdk
COPY external/sdk/environment-setup-armv7a-vfp-neon-oe-linux-gnueabi /
RUN export PERL_MM_USE_DEFAULT=1 && cpan -i FindBin
RUN echo "escape \`\`" > /root/.screenrc
RUN echo "defshell -bash" >> /root/.screenrc
RUN cd /sdk && ./oecore-x86_64-armv7a-vfp-neon-toolchain-nodistro.0.sh -y

## fix the arm-oe-linux-gnueabi-g++ -- broken issue when compile p-net
RUN mv /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so.old
RUN ln -s /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so.6 /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so
RUN apt-get install libc6-armhf-cross -y
# /lib/ld-linux.so.3: No such file or directory
RUN ln -s /usr/arm-linux-gnueabihf/lib/ld-linux.so.3 /lib/ld-linux.so.3
RUN cp /usr/arm-linux-gnueabihf/lib/* /usr/lib/

# COPY YOUR OWN CODE INTO THE DOCKER
COPY packages/* /
COPY docker_scripts/*  /

WORKDIR /
CMD ["bash"]

2.3 BaseJay镜像创建

在basejay文件夹下,执行:

docker build -t basejay:latest .

Sending build context to Docker daemon  1.165GB
Step 1/19 : FROM ubuntu:18.04
 ---> a2a15febcdf3
Step 2/19 : RUN apt-get update
 ---> Using cache
 ---> 17809a3dd5b2
Step 3/19 : RUN apt-get update
 ---> Using cache
 ---> 5205a6c5f03c
Step 4/19 : RUN apt-get install -y gcc git make screen vim nmap python perl cpio automake libtool pkg-config liblzo2-2 cmake clang-tools doxygen graphviz wget libboost-all-dev libxml2-dev
 ---> Using cache
 ---> 884ad16a2a6a
Step 5/19 : COPY external/sdk /sdk
 ---> Using cache
 ---> a45c8582b6ee
Step 6/19 : COPY external/sdk/environment-setup-armv7a-vfp-neon-oe-linux-gnueabi /
 ---> Using cache
 ---> 17d6fdb5b574
Step 7/19 : RUN export PERL_MM_USE_DEFAULT=1 && cpan -i FindBin
 ---> Using cache
 ---> ebb39d9a189f
Step 8/19 : RUN echo "escape \`\`" > /root/.screenrc
 ---> Using cache
 ---> 5c95de899aeb
Step 9/19 : RUN echo "defshell -bash" >> /root/.screenrc
 ---> Using cache
 ---> 3206ea47a56b
Step 10/19 : RUN cd /sdk && ./oecore-x86_64-armv7a-vfp-neon-toolchain-nodistro.0.sh -y
 ---> Using cache
 ---> 9aafc3b9733e
Step 11/19 : RUN mv /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so.old
 ---> Using cache
 ---> d0ce1ae686f7
Step 12/19 : RUN ln -s /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so.6 /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so
 ---> Using cache
 ---> 880a7cc8dd0f
Step 13/19 : RUN apt-get install libc6-armhf-cross -y
 ---> Using cache
 ---> c5d0e7360c8f
Step 14/19 : RUN ln -s /usr/arm-linux-gnueabihf/lib/ld-linux.so.3 /lib/ld-linux.so.3
 ---> Using cache
 ---> 2d7aaa1f2978
Step 15/19 : RUN cp /usr/arm-linux-gnueabihf/lib/* /usr/lib/
 ---> Using cache
 ---> 0741feb09429
Step 16/19 : COPY packages/* /
 ---> f27d497a1245
Step 17/19 : COPY docker_scripts/*  /
 ---> 7595723e994c
Step 18/19 : WORKDIR /
 ---> Running in b9125229a275
Removing intermediate container b9125229a275
 ---> a1f5d924ee46
Step 19/19 : CMD ["bash"]
 ---> Running in e1b614caa0c0
Removing intermediate container e1b614caa0c0
 ---> a74597ca9e3b
Successfully built a74597ca9e3b
Successfully tagged basejay:latest

进行镜像的创建,如果创建不成功,建议检查一下网络问题或者更换到国内的ubuntu源。

2.4 运行镜像

docker run -dt --name basejay basejay
docker ps
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS                          PORTS                    NAMES
b1961a96766b        9828027f7d20                     "bash"                   7 days ago          Up 2 seconds                                             basejay

这个时候我们的BaseJay SDK的开发环境就已经创建完毕了,可以进入看到一下:

docker exec -it b1961a96766b /bin/bash
root@b1961a96766b:/# ls
AUTHORS             MIGRATION     benchmark            config                                              helper.c         matchlist.h   programs          tests.c
BSDmakefile         Makefile      bin                  config.c                                            helper.h         media         root              tmp
CHANGELOG           Makefile.am   boot                 config.h                                            home             mf2b.8        run               tools
CHANGELOG.md        Makefile.in   bootstrap.sh         configure                                           include          mf2b.c        sample_app        usr
CMakeLists.txt      NEWS          build                configure.ac                                        iperf3.spec.in   mf2b.conf     sbin              var
CODE_OF_CONDUCT.md  README.md     build-fanuc.sh       contrib                                             lib              mf2b.conf.5   sdk               vcbuild.bat
CONTRIBUTING.md     RELNOTES.md   build-helloworld.sh  deps                                                lib32            mf2b.h        soem              version.h.in
COPYING             TESTING.md    build-iperf.sh       dev                                                 lib64            mnt           src               zlibWrapper
COPYING.LESSER      TODO          build-libmodbus.sh   doc                                                 libmodbus.pc.in  node          srv
ChangeLog           acinclude.m4  build-mqtt.sh        docs                                                logging.c        node.gyp      substr.c
Doxyfile            aclocal.m4    build-pnet.sh        drvcomment.txt                                      logging.h        opt           substr.h
INSTALL             action.c      build-soem.sh        environment-setup-armv7a-vfp-neon-oe-linux-gnueabi  m4               options.h.in  sys
ISSUE_TEMPLATE.md   action.h      build-zstd.sh        etc                                                 make_release     osal          test
LICENSE             appveyor.yml  cmake                examples                                            makefile         oshw          test_commands.sh
LICENSE.md          autogen.sh    common.gypi          helloworld.c                                        matchlist.c      proc          tests

3.编译软件包

新的软件包我们建议以子模块的方式加入到这个git里面,使用命令git submodule,比如我们需要iperf来测量我们以太网口的速率,可以用以下方式:

3.1 将iperf包加于软件包

git submodule add https://github.com/esnet/iperf.git packages/iperf

3.2 编译docker用编译脚本

接下来我们需要来完成编译脚本,首先将helloworld的docker脚本例子拷贝一份用来编译iperf:

cp docker_scripts/build-hellworld.sh docker_scripts/build-iperf.sh

build-helloworld.sh里面的内容:

 cat build-helloworld.sh

 # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd.
 # SPDX-License-Identifier: GPL 3.0
 # Change Logs:
 # Date           Author       Notes
 # 2019-07-31     tr.yang      the first version

#!/bin/bash
cd /helloworld && source /environment-setup-armv7a-vfp-neon-oe-linux-gnueabi && make clean && make

我们需要按照iperf软件包里面的编译要求,结合BaseJay的编译要求,做一下调整,

cat build-iperf.sh

 # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd.
 # SPDX-License-Identifier: GPL 3.0
 # Change Logs:
 # Date           Author       Notes
 # 2020-08-07     Yong      the first version

#!/bin/bash
cd /iperf \
    && sh bootstrap.sh \
    && source /environment-setup-armv7a-vfp-neon-oe-linux-gnueabi \
    && autoreconf -i \
    && ./configure --host=arm \
    && make clean && make

3.3 编译宿主机用脚本

cp scripts/deploy-hello.sh scripts/deploy-iperf.sh

原始的deploy-hello.sh内容:

cat deploy-helloworld.sh

 # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd.
 # SPDX-License-Identifier: GPL 3.0
 # Change Logs:
 # Date           Author       Notes
 # 2019-07-31     tr.yang      the first version

#!/bin/sh
docker cp packages/helloworld $1:/ \ #拷贝hellworld软件包到docker
    && docker cp ./docker_scripts/build-helloworld.sh $1:/ \ #拷贝build-hellworld.she脚本到docker
    && docker exec $1 bash -c "/build-helloworld.sh" \ # 执行编译脚本
    && rm -rf build/helloworld && mkdir build/hellworld \ #删除build里面的旧编译包
    && docker cp $1:/helloworld/helloworld build/hellworld/ #拷贝编译好的hellworld程序到build文件夹

我们需要修改一下:

cat deploy-iperf.sh

 # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd.
 # SPDX-License-Identifier: GPL 3.0
 # Change Logs:
 # Date           Author       Notes
 # 2020-08-07     Yong      the first version


#!/bin/sh
docker cp packages/iperf $1:/ \
    && docker cp ./docker_scripts/build-iperf.sh $1:/ \
    && docker exec $1 bash -c "/build-iperf.sh" \
    && rm -rf build/iperf && mkdir build/iperf \
    && docker cp $1:/iperf/src/iperf3 build/iperf/

3.4 编译iperf

执行以下命令就可以:

./scripts/deploy-iperf.sh basejay
+ libtoolize --copy --force --automake
+ aclocal -I config
+ autoheader
+ automake --add-missing --copy
configure.ac:40: installing 'config/compile'
configure.ac:38: installing 'config/missing'
examples/Makefile.am: installing 'config/depcomp'
+ autoconf
+ rm -rf config.cache
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
libtoolize: 'AC_PROG_RANLIB' is rendered obsolete by 'LT_INIT'
configure: loading site script /usr/local/oecore-x86_64/site-config-armv7a-vfp-neon-oe-linux-gnueabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-strip... arm-oe-linux-gnueabi-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-none
checking how to print strings... printf
checking for style of include used by make... GNU
checking for arm-gcc... arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi accepts -g... yes
checking for arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi option to accept ISO C89... none needed
checking whether arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi understands -c and -o together... yes
checking dependency style of arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi... gcc3
checking for a sed that does not truncate output... (cached) sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi... arm-oe-linux-gnueabi-ld  --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi
checking if the linker (arm-oe-linux-gnueabi-ld  --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... arm-oe-linux-gnueabi-nm
checking the name lister (arm-oe-linux-gnueabi-nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to arm-unknown-none format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for arm-oe-linux-gnueabi-ld  --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi option to reload object files... -r
checking for arm-objdump... arm-oe-linux-gnueabi-objdump
checking how to recognize dependent libraries... unknown
checking for arm-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-ar... arm-oe-linux-gnueabi-ar
checking for archiver @FILE support... @
checking for arm-strip... (cached) arm-oe-linux-gnueabi-strip
checking for arm-ranlib... arm-oe-linux-gnueabi-ranlib
checking command to parse arm-oe-linux-gnueabi-nm output from arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for arm-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... arm-oe-linux-gnueabi-gcc -E  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi
checking for ANSI C header files... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking for strings.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for unistd.h... (cached) yes
checking for dlfcn.h... (cached) yes
checking for objdir... .libs
checking if arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi supports -fno-rtti -fno-exceptions... no
checking for arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi option to produce PIC... -fPIC -DPIC
checking if arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi PIC flag -fPIC -DPIC works... yes
checking if arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi static flag -static works... no
checking if arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi supports -c -o file.o... yes
checking if arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi supports -c -o file.o... (cached) yes
checking whether the arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi linker (arm-oe-linux-gnueabi-ld  --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for arm-gcc... (cached) arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi
checking whether we are using the GNU C compiler... (cached) yes
checking whether arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi accepts -g... (cached) yes
checking for arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi option to accept ISO C89... (cached) none needed
checking whether arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi understands -c and -o together... (cached) yes
checking dependency style of arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi... (cached) gcc3
checking for arm-ranlib... (cached) arm-oe-linux-gnueabi-ranlib
checking whether ln -s works... yes
checking for ANSI C header files... (cached) yes
checking for library containing floor... -lm
checking for library containing socket... none required
checking for library containing inet_ntop... none required
checking for an ANSI C-conforming const... yes
checking for poll.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for netinet/sctp.h... no
checking for endian.h... (cached) yes
checking for arm-pkg-config... no
checking for pkg-config... pkg-config
checking for openssl/ssl.h in /usr/local/ssl... no
checking for openssl/ssl.h in /usr/lib/ssl... no
checking for openssl/ssl.h in /usr/ssl... no
checking for openssl/ssl.h in /usr/pkg... no
checking for openssl/ssl.h in /usr/local... no
checking for openssl/ssl.h in /usr... no
checking whether compiling and linking against OpenSSL works... no
checking TCP_CONGESTION socket option... yes
checking IPv6 flowlabel support... yes
checking for cpuset_setaffinity... no
checking for sched_setaffinity... yes
checking for SetProcessAffinityMask... no
checking for daemon... (cached) yes
checking for sendfile... yes
checking for getline... (cached) yes
checking SO_MAX_PACING_RATE socket option... yes
checking for library containing clock_gettime... none required
checking for clock_gettime... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/version.h
config.status: creating examples/Makefile
config.status: creating iperf3.spec
config.status: creating src/iperf_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Making clean in src
make[1]: Entering directory '/iperf/src'
 rm -f iperf3
test -z "libiperf.la                                   " || rm -f libiperf.la
rm -f ./so_locations
rm -rf .libs _libs
 rm -f t_timer t_units t_uuid t_api t_auth
rm -f *.o
test -z "t_timer.log t_units.log t_uuid.log t_api.log t_auth.log" || rm -f t_timer.log t_units.log t_uuid.log t_api.log t_auth.log
test -z "t_timer.trs t_units.trs t_uuid.trs t_api.trs t_auth.trs" || rm -f t_timer.trs t_units.trs t_uuid.trs t_api.trs t_auth.trs
test -z "test-suite.log" || rm -f test-suite.log
rm -f *.lo
make[1]: Leaving directory '/iperf/src'
Making clean in examples
make[1]: Entering directory '/iperf/examples'
rm -rf .libs _libs
 rm -f mic mis
rm -f *.o
rm -f *.lo
make[1]: Leaving directory '/iperf/examples'
make[1]: Entering directory '/iperf'
rm -rf .libs _libs
rm -f *.lo
make[1]: Leaving directory '/iperf'
Making all in src
make[1]: Entering directory '/iperf/src'
make  all-am
make[2]: Entering directory '/iperf/src'
  CC       cjson.lo
  CC       iperf_api.lo
  CC       iperf_error.lo
  CC       iperf_auth.lo
  CC       iperf_client_api.lo
  CC       iperf_locale.lo
  CC       iperf_server_api.lo
  CC       iperf_tcp.lo
  CC       iperf_udp.lo
  CC       iperf_sctp.lo
  CC       iperf_util.lo
  CC       iperf_time.lo
  CC       dscp.lo
  CC       net.lo
  CC       tcp_info.lo
  CC       timer.lo
  CC       units.lo
  CCLD     libiperf.la
  CC       iperf3-main.o
  CCLD     iperf3
  CC       t_timer-t_timer.o
  CCLD     t_timer
  CC       t_units-t_units.o
  CCLD     t_units
  CC       t_uuid-t_uuid.o
  CCLD     t_uuid
  CC       t_api-t_api.o
  CCLD     t_api
  CC       t_auth-t_auth.o
  CCLD     t_auth
make[2]: Leaving directory '/iperf/src'
make[1]: Leaving directory '/iperf/src'
Making all in examples
make[1]: Entering directory '/iperf/examples'
  CC       mic-mic.o
  CCLD     mic
  CC       mis-mis.o
  CCLD     mis
make[1]: Leaving directory '/iperf/examples'
make[1]: Entering directory '/iperf'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/iperf'

之后就可以在build文件夹里面找到编译好的iperf,将其使用scp拷贝进行就可以使用了。


以上为第四章节内容,我们陆续会推出以下新章节:

如何使用您的工业边缘计算单元

内容

第一章:了解您的JayBox 主板

第二章:开始使用您的JayBox 主板(仅需连接以太网电缆,24V电源)

第三章:使用你的JayBox 主板

第四章:使用易于编译的BaseJay开始编写程序

第五章:使用用Python编程

第六章:使用用C语言编程

第七章:使用BaseJay并编译你的应用

第八章:使用GPIO引脚进行物理计算

第九章:编程使用Modbus

第十章:编程使用OPC-UA

第十一章:使用MQTT的编程。

附录

附录A:命令行界面

附录B:JayBox 主板规格

附录C:JayBox主板4G及以太网带宽测试


联系我们

复杂的交给我们,简单的带给你们

hello@jieqi.io +86 (571) 8618 5263

地址

中国(杭州)人工智能小镇
文一西路1818-2号,杭州市
浙江,中国

申请试用