Servers by jDrones

Following manual to build code on windows make does not work

I follow manual instruction to build arducopter code in http://ardupilot.org/dev/docs/building-px4-with-make.html but no success.

steps:

  1. clone the source code from https://github.com/ArduPilot/ardupilot.git
  2. go to directory <base_folder>/ArduCopter
  3. open the PX4Console
  4. run this command:
    make px4-v2
  5. this error is shown:
    $ make px4-v2
    …/mk/apm.mk:25: /cygdrive/c/ardupilot/src/modules/uavcan/libuavcan/include.mk: No such file or directory
    make: *** No rule to make target ‘/cygdrive/c/ardupilot/src/modules/uavcan/libuavcan/include.mk’. Stop.

Can someone help me please where did I get it wrong?

Thank you!

did you update the submodules?

git submodule init
git submodule update --recursive

In any case, if you aim to fly the firmware you build, don’t use windows… Only few does.

Thanks Pete,
I did not, but when I do, I still end up with this different error:

$ make px4-v2
/usr/bin/find: paths must precede expression: AP_Rally.cpp
Usage: /usr/bin/find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path…] [expression]
/bin/sh: /cygdrive/c/ardupilot/src/Build.ArduCopter/make.flags.new: No such file or directory
…/mk/sketch_sources.mk:94: recipe for target ‘/cygdrive/c/ardupilot/src/Build.ArduCopter/make.flags’ failed
make: *** [/cygdrive/c/ardupilot/src/Build.ArduCopter/make.flags] Error 1

In any case, I saw after the git ‘submodule’ commands, significant ammoun of code and files being downloaded, notably on
<base_folder>/modules.

any clue? I wonder if latest commit is always ensured ‘build-able’?

Thanks @Andre-K, may I know which OS you are using?
I’d be glad to follow proven good OS for Ardupilot dev.

Also, could you enlighten me what is the main problem with windows to be used as development OS?

Windows, MAC and Linux are all ok for the development. ArduPilot firmware is not depended in anyways of the underlying OS.

We are now using waf based buildsystem, old px4-make is a bit outdated and we are working to update docs for it.

I would suggest to use cygwin environment if you want to build under Winxx OS. Just follow cygwin guide and you are fine.

Cygwin guide in here: http://ardupilot.org/dev/docs/building-setup-windows-cygwin.html

Base buildsystem works great under cygwin. For automatic upload (waf xx --upload), we made small patch that is fixing cygwin uploads and it will be in master soon.

Before that patch is in master, you can use it from here: https://github.com/ArduPilot/ardupilot/blob/343bc160219b08e58e5fd17abafc455d67f172de/Tools/ardupilotwaf/px_uploader.py

Just update px_uploader.py file to your Tools/ardupilotwaf folder and you are fine on the uploads too.

I am using Linux, (Ubuntu) but as pointed out, cygwin is as safe bet too.

Thanks guys, I switch to Ubuntu OS and I don’t have any issue anymore.

I believe Windows would still be ok, but I’d stick to Ubuntu this time round first.

Yes Ubuntu is fine for development. Cygwin is rather similar to ubuntu/*nix. I think if we look main developers, majority are doing it in Linux. Is it native or in virtual box is another thing. Also quite many are doing development in mac. I personally use all those 3 platforms. After python and compiler packets are properly installed, waf works exactly same way on all platforms.

Just for my two cents, Windows Subsystem for Linux Ubuntu in Windows 10 runs the build environment just fine.

Windows development environments work (Both Windows Subsystem for Linux Ubuntu in Windows 10 and cygwin) but you do need to read and correctly execute at the setup steps posted on the website. The problem is that you did not even install cygwin…

Thanks @amilcarlucas, as per docs in building the code,http://ardupilot.org/dev/docs/building-the-code.html,
there are several ways to build, for windows at least:

  1. Build environment on Windows using cygwin
    http://ardupilot.org/dev/docs/building-setup-windows-cygwin.html
  2. Building on windows with Make
    http://ardupilot.org/dev/docs/building-px4-with-make.html

I believed you refer to 1st one, but I was following 2nd option.

+1 @Eosbandi. I build ArduPlane almost daily under Ubuntu/WSL and it works fine.

Kelly

I’ve some problems too. I’ve follow instructions and cygwin64 or eclipse build doesn’t worm on my win10. Firmware is 4.0.1 for arducopter. in cygwin64 there is Errno 22
$ ./waf configure --board CubeBlack
Setting top to : D:\Ardupilot\cygwin64\home\Luki\ardupilot
Setting out to : D:\Ardupilot\cygwin64\home\Luki\ardupilot\build
Autoconfiguration : enabled
Setting board to : CubeBlack
Using toolchain : arm-none-eabi
Checking for ‘g++’ (C++ compiler) : D:\Ardupilot\GNU Tools ARM Embedded\6 2017-q2-update\bin\arm-none-eabi-g++.exe
Checking for ‘gcc’ (C compiler) : D:\Ardupilot\GNU Tools ARM Embedded\6 2017-q2-update\bin\arm-none-eabi-gcc.exe
Checking for c flags ‘-MMD’ : yes
Checking for cxx flags ‘-MMD’ : yes
Checking for program ‘make’ : D:\Ardupilot\cygwin64\bin\make.exe
Checking for program ‘arm-none-eabi-objcopy’ : D:\Ardupilot\GNU Tools ARM Embedded\6 2017-q2-update\bin\arm-none-eabi-objcopy.exe
C:\Users\kowal\AppData\Local\Programs\Python\Python38-32\python.exe: can’t open file ‘‘D:\Ardupilot\cygwin64\home\Luki\ardupilot\libraries\AP_HAL_ChibiOS\hwdef\scripts\chibios_hwdef.py’’: [Errno 22] Invalid argument
Failed to process hwdef.dat ret=2
(complete log in D:\Ardupilot\cygwin64\home\Luki\ardupilot\build\config.log)

And in eclipse compiler just hangs after few proccesses with build command(eclipse is still working).
Do somebody knows how get it to work? I need to add some lines to bindings.desc file, for my script lua

Forget cygwin… use WSL with Ubuntu and Visual Studio Code.

After 2 days of installing , configuring and so on of Hyper-V and Ubuntu on virtual machine, finaly i’ve compiler run and… there are errors too when compiling copter (configure was OK):

Pip install future

I have installed pip, wit python 2.7 and 3, and alias made pip for 3 and pip2 for 2.7.

But you did not install the module named “future” as it says in the last line.

Sorry didn’t understad (linux i have used on colage 20years ago). Yes, i have ‘future’ (requirement already satisfied…).
But, but, i’ve experimented with mavproxy (with no luck on hyper-v), reinstalled gcc compiler, and now compilation is done… I don’t know what was the isue, but now it’s OK. (p.s. 5m28s on my Razen 7 3.7GHz not expected from me).

Servers by jDrones