Unable to build from source code due to task in 'mavlink' failed

Hello,

I am using RP3+NAVIO2 with Emild Rasbian 20170118 image (the latest) and trying to build from source code on my RP3. My building steps are as follows:

  1. Download the APM code and update submodules:

    git clone https://github.com/ArduPilot/ardupilot.git
    cd ardupilot
    git submodule update --init
    
  2. alias waf=“$PWD/modules/waf/waf-light”

  3. waf configure --board=navio


 pi@navio:~/ardupilot $ waf configure --board=navio

Setting top to : /home/pi/ardupilot
Setting out to : /home/pi/ardupilot/build
Autoconfiguration : enabled
Setting board to : navio
Checking for program ‘arm-linux-gnueabihf-ar’ : /usr/bin/arm-linux-gnueabihf-ar
Using toolchain : arm-linux-gnueabihf
Checking for ‘g++’ (C++ compiler) : /usr/bin/arm-linux-gnueabihf-g++
Checking for ‘gcc’ (C compiler) : /usr/bin/arm-linux-gnueabihf-gcc
Checking for program ‘arm-linux-gnueabihf-pkg-config’ : /usr/bin/arm-linux-gnuea bihf-pkg-config
Checking for need to link with librt : not necessary
Checking for ‘lttng-ust’ : not found
Testing link with lttng-ust : yes
Checking for library dl : yes
Checking for ‘libiio’ : not found
Testing link with libiio : yes
Checking for HAVE_CMATH_ISFINITE : yes
Checking for HAVE_CMATH_ISINF : yes
Checking for HAVE_CMATH_ISNAN : yes
Checking for NEED_CMATH_ISFINITE_STD_NAMESPACE : yes
Checking for NEED_CMATH_ISINF_STD_NAMESPACE : no
Checking for NEED_CMATH_ISNAN_STD_NAMESPACE : no
Checking for header endian.h : yes
Checking for header byteswap.h : yes
Checking for program ‘python’ : /usr/bin/python
Checking for python version >= 2.7.0 : 2.7.9
Source is git repository : yes
Update submodules : yes
Checking for program ‘git’ : /usr/bin/git
Checking for program ‘arm-linux-gnueabihf-size’ : /usr/bin/arm-linux-gnuea bihf-size
Benchmarks : disabled
Unit tests : enabled
‘configure’ finished successfully (7.879s)


  1. waf --targets bin/arducopter (Not waf --targets bin/arducopter-quad)

pi@navio:~/ardupilot $ waf --targets bin/arducopter
Waf: Entering directory `/home/pi/ardupilot/build/navio’
[2/2] Running Submodule update: mavlink
Submodule ‘pymavlink’ (git://github.com/ArduPilot/pymavlink.git) registered for path ‘pymavlink’
Submodule path ‘modules/mavlink/pymavlink’: checked out ‘b1663bac9ce9e9fa8868f59 e4b5f6d3de81cb2f3’

Cloning into ‘pymavlink’…

[3/4] Processing modules/mavlink/message_definitions/v1.0/ardupilotmega.xml
[4/4] Creating build/navio/ap_version.h
Traceback (most recent call last):
File “/home/pi/ardupilot/modules/mavlink/pymavlink/tools/mavgen.py”, line 16, in
from pymavlink.generator import mavgen
File “/home/pi/ardupilot/modules/mavlink/pymavlink/generator/mavgen.py”, line 12, in
from future import standard_library
ImportError: No module named future

mavgen returned 1 error code
Waf: Leaving directory `/home/pi/ardupilot/build/navio’
Build failed
→ task in ‘mavlink’ failed (exit status 1):
{task 1984627216: mavgen ardupilotmega.xml → }


  1. From “Master@59366b0 fails to build - Development Team - ArduPilot Discourse” , Fixed this by installing the following python libs

pip install lxml future

I did it , however, the result is the same as before. I donot what else I should do.

Could you please help me on this issue? your help would greatly appreciated.

Hello,

I have a successful Navio2 Arducopter compilation yesterday.

I have a Pi2 with Raspbian Jessie Lite (update of yesterday)

Dev install is from yesterday.

GCC and Python are in the distro.

gcc version 4.9.2 (Raspbian 4.9.2-10)

Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2

Pip installation

pi@raspberrypi:~ $ sudo apt-get install python-pip

Future installation

pi@raspberrypi:~ $ sudo pip install future

Git installation and Ardupilot clone Import

pi@raspberrypi:~ $ apt-get install git

pi@raspberrypi:~ $ git clone GitHub - ArduPilot/ardupilot: ArduPlane, ArduCopter, ArduRover, ArduSub source
Cloning into ‘ardupilot’…

Submodule update

pi@raspberrypi:~ $ cd ardupilot
pi@raspberrypi:~/ardupilot $ git submodule update --init

was config (error then Cp to right place)

pi@raspberrypi:~/ardupilot $ alias waf=“$PWD/modules/waf/waf-light”
pi@raspberrypi:~/ardupilot $ waf configure --board=navio2
Setting top to : /home/pi/ardupilot
Setting out to : /home/pi/ardupilot/build
Autoconfiguration : enabled
Setting board to : navio2
Checking for program ‘arm-linux-gnueabihf-ar’ : /usr/bin/arm-linux-gnueabihf-ar
Using toolchain : arm-linux-gnueabihf
Checking for ‘g++’ (C++ compiler) : /usr/bin/arm-linux-gnueabihf-g++
Checking for ‘gcc’ (C compiler) : /usr/bin/arm-linux-gnueabihf-gcc
Checking for program ‘arm-linux-gnueabihf-pkg-config’ : not found
Could not find the program [‘arm-linux-gnueabihf-pkg-config’]
(complete log in /home/pi/ardupilot/build/config.log)
pi@raspberrypi:~/ardupilot $ cp /usr/bin/arm-unknown-linux-gnueabihf-pkg-config /usr/bin/arm-linux-gnueabihf-pkg-config
cp: cannot create regular file ‘/usr/bin/arm-linux-gnueabihf-pkg-config’: Permission denied
pi@raspberrypi:~/ardupilot $ sudo cp /usr/bin/arm-unknown-linux-gnueabihf-pkg-config /usr/bin/arm-linux-gnueabihf-pkg-config
pi@raspberrypi:~/ardupilot $ waf configure --board=navio2
Setting top to : /home/pi/ardupilot
Setting out to : /home/pi/ardupilot/build
Autoconfiguration : enabled
Setting board to : navio2
Checking for program ‘arm-linux-gnueabihf-ar’ : /usr/bin/arm-linux-gnueabihf-ar
Using toolchain : arm-linux-gnueabihf
Checking for ‘g++’ (C++ compiler) : /usr/bin/arm-linux-gnueabihf-g++
Checking for ‘gcc’ (C compiler) : /usr/bin/arm-linux-gnueabihf-gcc
Checking for program ‘arm-linux-gnueabihf-pkg-config’ : /usr/bin/arm-linux-gnueabihf-pkg-config
Checking for need to link with librt : not necessary
Checking for ‘lttng-ust’ : not found
Testing link with lttng-ust : yes
Checking for library dl : yes
Checking for ‘libiio’ : not found
Testing link with libiio : yes
Checking for HAVE_CMATH_ISFINITE : yes
Checking for HAVE_CMATH_ISINF : yes
Checking for HAVE_CMATH_ISNAN : yes
Checking for NEED_CMATH_ISFINITE_STD_NAMESPACE : yes
Checking for NEED_CMATH_ISINF_STD_NAMESPACE : no
Checking for NEED_CMATH_ISNAN_STD_NAMESPACE : no
Checking for header endian.h : yes
Checking for header byteswap.h : yes
Checking for program ‘python’ : /usr/bin/python
Checking for python version >= 2.7.0 : 2.7.9
Source is git repository : yes
Update submodules : yes
Checking for program ‘git’ : /usr/bin/git
Checking for program ‘arm-linux-gnueabihf-size’ : /usr/bin/arm-linux-gnueabihf-size
Benchmarks : disabled
Unit tests : enabled
‘configure’ finished successfully (20.825s)

Compilation (start and end result)

pi@raspberrypi:~/ardupilot $ waf --targets bin/arducopter
Waf: Entering directory `/home/pi/ardupilot/build/navio2’
[2/2] Running Submodule update: mavlink
Submodule ‘pymavlink’ (git://github.com/ArduPilot/pymavlink.git) registered for path ‘pymavlink’
Submodule path ‘modules/mavlink/pymavlink’: checked out ‘b1663bac9ce9e9fa8868f59e4b5f6d3de81cb2f3’

Cloning into ‘pymavlink’…

[3/4] Processing modules/mavlink/message_definitions/v1.0/ardupilotmega.xml
[4/4] Creating build/navio2/ap_version.h
Validation skipped for /home/pi/ardupilot/modules/mavlink/message_definitions/v1.0/ardupilotmega.xml.
Parsing /home/pi/ardupilot/modules/mavlink/message_definitions/v1.0/ardupilotmega.xml
Note: message DATA64 is longer than 64 bytes long (74 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message DATA96 is longer than 64 bytes long (106 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message REMOTE_LOG_DATA_BLOCK is longer than 64 bytes long (214 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit……….
……
[815/823] Compiling libraries/AP_HAL_Linux/Scheduler.cpp
[816/823] Compiling libraries/AP_ADSB/AP_ADSB.cpp
[817/823] Compiling libraries/AP_HAL/HAL.cpp
[818/823] Compiling libraries/AP_Proximity/AP_Proximity_MAV.cpp
[819/823] Compiling libraries/AP_Notify/NavioLED.cpp
[820/823] Compiling libraries/AP_GPS/AP_GPS_NMEA.cpp
[821/823] Compiling libraries/AP_BoardConfig/AP_BoardConfig.cpp
[822/823] Linking build/navio2/lib/libArduCopter_libs.a
[823/823] Linking build/navio2/bin/arducopter
Waf: Leaving directory `/home/pi/ardupilot/build/navio2’

BUILD SUMMARY
Build directory: /home/pi/ardupilot/build/navio2
Target Text Data BSS Total

bin/arducopter 1041291 1288 35360 1077939

Build commands will be stored in build/navio2/compile_commands.json
‘build’ finished successfully (19m12.450s)

There is difference in future installation: future versus lxml future??

I do not think Raspbian Jessie version difference (Emlid Raspbian 2017018 on your config) is significant. I installed it on a spare Pi2 for dev only.

Marc

Thanks, guys!

future has been added to the distro.

Thanks so much. I gave a try this morning. The issue of ‘mavlink’ failed has been solved. However, it stops for any reason during the process of compiling. I will give an other try this evening and report the progress soon.

By following:

pi@raspberrypi:~ $ sudo apt-get install python-pip
pi@raspberrypi:~ $ sudo pip install future

It is success to build from source code. Thanks again!

1 Like