Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added compilation steps #5117

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
28 changes: 23 additions & 5 deletions dev/source/docs/building-the-code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,36 @@ Setting up the Build Environment
- :ref:`Setup the Build Environment on Windows <building-setup-windows>`
- :ref:`Setup the Build Environment on MacOSX <building-setup-mac>`


Building / Compiling
--------------------

**Linux / MacOSX users:**
Once the build environment is set up as above, run the following commmands prior to the initial build. (For Windows users, this is under WSL, as set up above):

- Linux and MacOSX users should build with waf as described in `BUILD.md <https://github.com/ArduPilot/ardupilot/blob/master/BUILD.md>`__.
- `git submodule init`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required to avoid the following error message:

Build failed
 -> task in 'dronecan' failed (exit status 2):
        {task 140083940872752: dronecangen  -> }
 (run with -v to display more information)

- `git submodule update --recursive`
- `./Tools/gittools/submodule-sync.sh`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should only be used in case of emergency....its a sledge hammer....please remove it....we can add a note in the branching doc about using it in case of emergency where you cant get the modules updated correctly

Copy link
Contributor Author

@David-OConnor David-OConnor May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule init line removed It seems the other two are required for me. The first line prevents this error:

Build failed -> task in 'dronecan' failed (exit status 2): {task 140083940872752: dronecangen -> } (run with -v to display more information)

The second prevents this:

Build failed
 -> task in 'ChibiOS_lib' failed (exit status 2):
        {task 140009737052320: ChibiOS_lib hwdef.h,hw.dat,include_dirs,board.c,board.h,bouncebuffer.c,bouncebuffer.h,chconf.h,crashdump.c,ffconf.h,flash.c,flash.h,halconf.h,hrt.c,hrt.h,malloc.c,mcuconf.h,poll.h,ppm.h,spi_hook
        // ... (many lines of red text)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed on fresh build

- `python3 waf configure --board *BoardName*`
- `python3 waf clean`

`*BoardName*` above is the name of the board, as labeled by its associated folder in
`/ardupiot/libraries/AP_HAL_ChibiOS/hwdef`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, board name isn't restricted to Chibios boards.
./waf list_boards show all the boards


Run the following command, each time you wish to build:
`python3 waf copter`

(Substitute `plane`, `rover` etc for `copter` as required)

.. youtube:: lNSvAPZOM_o

**Windows users:**
**Details**

- Additional detailed information is available in this document: `BUILD.md <https://github.com/ArduPilot/ardupilot/blob/master/BUILD.md>`__.


- This video demonstrates building on a Linux PC:

.. youtube:: lNSvAPZOM_o

- Windows users should fellow the directions described on :ref:`Setup Build Environment on Windows <building-setup-windows>`.

**Board specific instructions:**

Expand Down