Section |
---|
Column |
---|
| IntroductionThe old GitBash build environment is depreciated deprecated and we use now the Msys2 that supports a package system for updates.
|
|
...
Section |
---|
Column |
---|
| - 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 |
---|
language | powershell |
---|
theme | Emacs |
---|
| 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 |
---|
title | Username / 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: |
|
Column |
---|
| |
|
...
Section |
---|
Column |
---|
| Add LibrePilot MinGW repositoryAdd the following lines at the end of your /etc/pacman.conf file: Code Block |
---|
language | powershell |
---|
theme | Emacs |
---|
| [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 |
---|
| echo "[librepilot-mingw]" >> /etc/pacman.conf
echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf
echo "Server = http://download.librepilot.org/repo/mingw" >> /etc/pacman.conf |
|
|
...
...
Section |
---|
Column |
---|
| Install required packagesIf 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 |
---|
language | powershell |
---|
theme | Emacs |
---|
| 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 |
---|
language | powershell |
---|
theme | Emacs |
---|
| pacman -S --needed mingw-w64-i686-OpenSceneGraph-debug mingw-w64-i686-osgearth-debug |
For 64 bit:
Code Block |
---|
language | powershell |
---|
theme | Emacs |
---|
| 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 |
---|
language | powershell |
---|
theme | Emacs |
---|
| 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 |
---|
| 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 |
---|
| echo "alias make=mingw32-make" >> ~/.bashrc && . ~/.bashrc |
and just use 'make'. |
|
Column |
---|
|
|
|
...
Section |
---|
Column |
---|
| 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 |
---|
language | powershell |
---|
theme | Emacs |
---|
| git clone https://bitbucket.org/librepilot/librepilot.git |
|
Column |
---|
|
|
|
Section |
---|
Column |
---|
|
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 |
---|
language | powershell |
---|
theme | Emacs |
---|
| cd librepilot
git checkout next |
|
|
...
Section |
---|
Column |
---|
|
Using mingw32-make: Code Block |
---|
language | powershell |
---|
theme | Emacs |
---|
| 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') Tool | Approx. size | Used for |
---|
Arm compiler | ~94Mb | firmware build | Nsis | ~2,1Mb | Windows installer | Mesa | ~13Mb | OpenGL software driver | ccache | ~350Kb | Build faster | gtest | ~1,1Mb | |
| uncrustify | ~250Kb | Format code | doxygen | ~4Mb | Documentation |
|
Column |
---|
|
|
|
...
...
Building the LibrePilot software
Section |
---|
Column |
---|
| |
Basically you just need to type: Code Block |
---|
language | powershell |
---|
theme | Emacs |
---|
| 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 |
---|
|
|
|
Section |
---|
Column |
---|
| |
Then GCS software: |
|
Section |
---|
Column |
---|
| Finally all files are packaged using the Nsis software installer.
At end, the LibrePilot software installer can be found in ~/librepilot/build/ directory.
|
Column |
---|
| |
|
...
Congrats !
Congratulations! You have setup the build environment and built the complete LibrePilot software suite!