Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width60%

Introduction

The old GitBash build environment is depreciated deprecated and we use now the Msys2 that supports a package system for updates.

Column
width40%
Panel
titleIn this page
 
Table of Contents

...

Section
Column
width50%
  • Install Msys2 following the instructions on the web site.
  • You can either install the i686 (32 bit) or x86_64 (64 bit) version, this applies to host used. Both installers support Win32 and Win64 shells.
  • Update Msys2 to the latest available binaries following steps 5 to 7 of Msys2 installation guide.
 


Code Block
languagepowershell
themeEmacs
pacman -Syu

If you get build errors when pulling new code later, always try re-running "pacman -Syu" as that will often resolve build problems.

 


Warning
titleUsername / Home directory

Msys2 creates the home directory using the current Username from Windows.
Be sure the home directory does not contains spaces and rename it if needed.

Check your home directory:

Code Block
themeEmacs
cd ~
pwd
Column
width50%

 

 

 


...


Section
Column
width50%

Add LibrePilot MinGW repository

Add the following lines at the end of your /etc/pacman.conf file:

Code Block
languagepowershell
themeEmacs
[librepilot-mingw]
SigLevel = Optional TrustAll
Server = http://download.librepilot.org/repo/mingw

Paste this code into the bash-window to add the above lines to /etc/pacman.conf

Code Block
languagebash
themeEmacs
echo "[librepilot-mingw]" >> /etc/pacman.conf
echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf
echo "Server = http://download.librepilot.org/repo/mingw" >> /etc/pacman.conf
Column
width50%

 

 

...



...


Section
Column
width50%

Install required packages

If you followed the previous instructions from the msys2 website, you have now a fresh build environment.

  • Start a MinGW-w64 Win32 Shell or MinGW-w64 Win64 Shell but not a MSYS2 Shell
  • Install the dependent packages that match your MinGW shell.

For 32 bit:

Code Block
languagepowershell
themeEmacs
pacman -Sy
pacman -S --needed git unzip tar mingw-w64-i686-toolchain mingw-w64-i686-ccache mingw-w64-i686-qt5 mingw-w64-i686-SDL mingw-w64-i686-mesa mingw-w64-i686-openssl mingw-w64-i686-gdal-minimal mingw-w64-i686-OpenSceneGraph mingw-w64-i686-osgearth
pacman -S --needed mingw-w64-i686-graphite2 mingw-w64-i686-nghttp2

Optionally install debug packages:

Code Block
languagepowershell
themeEmacs
pacman -S --needed mingw-w64-i686-OpenSceneGraph-debug mingw-w64-i686-osgearth-debug

For 64 bit:

Code Block
languagepowershell
themeEmacs
pacman -Sy
pacman -S --needed git unzip tar mingw-w64-x86_64-toolchain mingw-w64-x86_64-ccache mingw-w64-x86_64-qt5 mingw-w64-x86_64-SDL mingw-w64-x86_64-mesa mingw-w64-x86_64-openssl mingw-w64-x86_64-gdal-minimal mingw-w64-x86_64-OpenSceneGraph mingw-w64-x86_64-osgearth

Optionally install debug packages:

Code Block
languagepowershell
themeEmacs
pacman -S --needed mingw-w64-x86_64-OpenSceneGraph-debug mingw-w64-x86_64-osgearth-debug

 


When pacman ask for default selection=All, hit Enter and next step  you should say 'Y' to start download.

This can take a while, fast internet connection preferred !

After download pacman will install all packages automatically.

 


Note
titleNote

Every time you need a 'make' command you need to run the mingw version of make, which is `mingw32-make`

To make this easier, you can execute this once:

Code Block
languagebash
themeEmacs
echo "alias make=mingw32-make" >> ~/.bashrc && . ~/.bashrc

and just use 'make'.

Column
width50%




 

 

 

 

 

 

 




...


Section
Column
width50%

Get the code using Msys2

  • Start a Win32 or Win64 shell
  • By default the shell start in home/[username], if you want to return back to home dir type: cd ~
  • Clone repository using git command :
Code Block
languagepowershell
themeEmacs
git clone https://bitbucket.org/librepilot/librepilot.git
 
Column
width50%

Section
Column
width50%


 

Go into librepilot directory just created using git clone and check out the "next" source code branch, you can choose any other like "master" or "rel-15.09"

 

Code Block
languagepowershell
themeEmacs
cd librepilot
git checkout next
Column
width50%

    

...

Section
Column
width50%

Using mingw32-make:

Code Block
languagepowershell
themeEmacs
mingw32-make all_sdk_install

 (NOTE:  Network transfers may fail.  If you see errors just keep re-executing the command until if completes successfully.  If asked to replace files, answer 'y' or 'A')

 
ToolApprox. sizeUsed for
Arm compiler~94Mb

firmware build

Nsis~2,1MbWindows installer
Mesa~13MbOpenGL software driver
ccache~350KbBuild faster
gtest~1,1Mb
uncrustify~250KbFormat code
doxygen~4MbDocumentation

 

 



Column
width50%


 

...


...

Building the LibrePilot software

Section
 
Column
width60%


Basically you just need to type:

Code Block
languagepowershell
themeEmacs
mingw32-make package
Info

See also the Make basics page and learn more about 'make' commands, just replace the make command with mingw32-make.

 


It will build the UAVObjGenerator utility and all firmwares:

Column
width40%

   

Section

 

 
Column
width60%



 Then GCS software:

Column
width40%

    

Section
Column
width40%

Finally all files are packaged using the Nsis software installer. 


At end, the LibrePilot software installer can be found in ~/librepilot/build/ directory. 


     

 


Column
width60%

   

...

Congrats !

Congratulations! You have setup the build environment and built the complete LibrePilot software suite!