• Linked Applications
    Loading…

Windows: Building and Packaging

Contents

The main difference between Windows and other supported operating systems is that Windows does not provide a bash environment like other systems do. We prepackaged most of tools to make the installation as friendly as possible. All you need to install manually is the msysGit package. Then you run two scripts and should have complete build environment ready. More info about the OpenPilot build system.

Tutorial video walk through explaining process of setting up Git Bash and building GCS software.

Get Adobe Flash player

Install required software

Icon

This section explains how to install the minimum set of development tools required to build the whole OpenPilot software package. If you are a developer and want to contribute or debug software, you may need some extra tools and utilities.

Download and install msysGit version control system using default options except the path to install:


Icon

You must install git into a path without spaces, for example, into C:\Git.

By default, the installer suggests to install it into C:\Program Files\Git or C:\Program Files (x86)\Git. In this case you will later have weird errors like "File not found: C:\Program". This is a known limitation.

    

Use default settings

By default, the installer suggest the 1st option - Use Git Bash only (no git in the PATH). If you only want to use command line builds, you may keep that option. Optionally you can choose the 2nd option, then git will be added to the PATH. It may be desired if you later want to install Qt Creator IDE and want to build GCS from it.

  

Use default settings

Open Git Bash window using Start menu or Windows explorer context menu.


Clone the OpenPilot repository into a path without spaces for example: C:\code\OpenPilot.

Icon

Note that in a git bash you use forward slashes.


Icon

After typing in each command line below you have to push the enter key on your keyboard.

E.G.

mkdir c:/code     (press Enter)

cd c:/code     (press Enter)


Icon

This process will also download the remote objects from the OpenPilot repository and will take between 15-30mins depending on your download speed of your internet connection.

This process is a one off and does not have to run each time you build the software.


Check out the "next" source code branch:

Install Windows version of make utility:

Install toolchains used to build the software:

When the process finishes, you should have all tools to build OpenPilot software:

Icon

This process will take approximately 15-30min to complete depending on your internet connection and computer speed.

It will be completed when you see the green & yellow command prompt similar to below (the green writing will be your computer name and user name and not the example shown below)

vmware@VMWARE-WIN7  /c/code/OpenPilot  (next)

If all went well, you may optionally remove downloaded toolchain distribution files to free up some disk space:

Build the OpenPilot software

To build absolutely all - firmware (including bootloaders, bootloader updaters, flight firmware), Ground Control Station (GCS) and Windows installer package - just type:

Icon

Using the above command the first time will build the software with the latest files.

Subsequent builds will require you to update the local files (on your computer) which the software is compiled from, to do this use the following commands below:

Icon

The process can take 30 to 120 minutes to build all software depending on your computer.

It will build the UAVObjGenerator utility:

Then firmware:

Then GCS, including automatically generated UAVObject source files (created by UAVObjGenerator):

And finally the Windows installer:

All will be built in the build sub-directory.

The GCS software will be placed into the build/openpilotgcs_release sub-directory. The firmware is embedded into the GCS code, but also can be found in the build sub-directory in corresponding folders.

Icon

GCS can be run directly without installation:

And the Windows installer can be found in the build sub-directory:

Congratulations! You have built the complete OpenPilot software suite!

More build hints

Tired typing tools/bin/make every time? Create a new directory called bin in your profile folder.

Copy make.exe from tools/bin sub-directory of your OpenPilot folder to the bin folder you just created.

This folder is in the PATH already, then you may use just make:

Complete list of available make targets is available by using make help. You can build anything you want. The build system will automatically build all prerequisites if necessary.

If you have enough RAM (5-6GB or more) and multi-core CPU, you may build the software using parallel builds. To do so add -j option to the make command line:

In this case you may build all in 5-10 minutes.

Use clean_package target if you want to rebuild all from scratch:

Finally, to remove all build results use:

Troubleshooting

Due to automated toolchain installation, the install and build process should be straightforward. But if it fails, you should save build logs and ask for help on the OpenPilot forum in this thread.

  1. Use V=1 make command line option. It provides more verbose output including command lines and full paths.
  2. Use clean_package target. It removes the build directory first, so gets rid of such problems as wrong paths in object files or broken dependencies.
  3. Save complete build log to a file using redirection of standard output and standard error streams. Then the log can be posted on forums.

This is the recommended command line for troubleshooting:

In the example above we build clean package (that is, build directory will be removed before build) using verbose output (V=1), sending standard error stream to the standard output stream (2>&1) and making a copy of both in make_log.txt text file using pipe. Note that use -j for troubleshooting is probably a bad idea.

As you may notice, V=1 adds a lot of useful for troubleshooting info which the rest of command line copies to a text file:

 

 

  • No labels

Powered by Atlassian - Copyright © 2012 OpenPilot Foundation