Build apm in windows10 by cuwin

when I build apm source in windows bu cywin, I got a problem. i follow the steps in : http://ardupilot.org/dev/docs/building-setup-windows-cygwin.html#building-setup-windows-cygwin.
but it shown in screen below.

please help me thank u !!!

$ ./waf list_boards
aero aerofc-v1 bbbmini bebop bhat blue dark disco erleboard erlebrain2 linux minlure navio navio2 px4-v1 px4-v2 px4-v3 px4-v4 pxf pxfmini raspilot sitl urus zynq
‘list_boards’ finished successfully (0.001s)

Tong guoxun@Tongguoxun ~/apm2/ardupilot
$ ./waf configure --board=px4-v2
Setting top to : /home/Tong guoxun/apm2/ardupilot
Setting out to : /home/Tong guoxun/apm2/ardupilot/build
Autoconfiguration : enabled
Setting board to : px4-v2
Checking for program ‘arm-none-eabi-ar’ : /cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q2-update/bin/arm-none-eabi-ar
Using toolchain : arm-none-eabi
Checking for ‘g++’ (C++ compiler) : /cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q2-update/bin/arm-none-eabi-g++
Checking for ‘gcc’ (C compiler) : /cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q2-update/bin/arm-none-eabi-gcc
Checking for HAVE_CMATH_ISFINITE : no
Checking for HAVE_CMATH_ISINF : no
Checking for HAVE_CMATH_ISNAN : no
Checking for NEED_CMATH_ISFINITE_STD_NAMESPACE : no
Checking for NEED_CMATH_ISINF_STD_NAMESPACE : no
Checking for NEED_CMATH_ISNAN_STD_NAMESPACE : no
Checking for header endian.h : not found
Checking for header byteswap.h : not found
Checking for program ‘cmake’ : /usr/bin/cmake
Checking cmake version : 3.6.2
Checking for program ‘ninja, ninja-build’ : not found
Checking for program ‘make’ : /usr/bin/make
Checking for program ‘python’ : /usr/bin/python
Checking for python version >= 2.7.0 : 2.7.16
Checking for program ‘python’ : /usr/bin/python
Checking for python version >= 2.7.0 : 2.7.16
Source is git repository : yes
Update submodules : yes
Checking for program ‘git’ : /usr/bin/git
Gtest : PX4 boards currently don’t support compiling gtest
Checking for program ‘arm-none-eabi-size’ : /cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q2-update/bin/arm-none-eabi-size
Benchmarks : disabled
Unit tests : disabled
‘configure’ finished successfully (4.850s)

Tong guoxun@Tongguoxun ~/apm2/ardupilot
$ ./waf copter
Waf: Entering directory `/home/Tong guoxun/apm2/ardupilot/build/px4-v2’
[ 5/15] Processing modules/mavlink/message_definitions/v1.0/ardupilotmega.xml
[ 7/15] Processing uavcangen: modules/uavcan/dsdl/uavcan/CoarseOrientation.uavcan modules/uavcan/dsdl/uavcan/Timestamp.uavcan modules/uavcan/dsdl/uavcan/equipment/actuator/1010.ArrayCommand.uavcan modules/uavcan/dsdl/uavcan/equipment/actuator/1011.Status.uavcan modules/uavcan/dsdl/uavcan/equipment/actuator/Command.uavcan modules/uavcan/dsdl/uavcan/equipment/ahrs/1000.Solution.uavcan modules/uavcan/dsdl/uavcan/equipment/ahrs/1001.MagneticFieldStrength.uavcan modules/uavcan/dsdl/uavcan/equipment/air_data/1020.TrueAirspeed.uavcan modules/uavcan/dsdl/uavcan/equipment/air_data/1021.IndicatedAirspeed.uavcan modules/uavcan/dsdl/uavcan/equipment/air_data/1025.AngleOfAttack.uavcan modules/uavcan/dsdl/uavcan/equipment/air_data/1026.Sideslip.uavcan modules/uavcan/dsdl/uavcan/equipment/air_data/1028.StaticPressure.uavcan modules/uavcan/dsdl/uavcan/equipment/air_data/1029.StaticTemperature.uavcan modules/uavcan/dsdl/uavcan/equipment/camera_gimbal/1040.AngularCommand.uavcan modules/uavcan/dsdl/uavcan/equipment/camera_gimbal/1041.GEOPOICommand.uavcan modules/uavcan/dsdl/uavcan/equipment/camera_gimbal/1044.Status.uavcan modules/uavcan/dsdl/uavcan/equipment/camera_gimbal/Mode.uavcan modules/uavcan/dsdl/uavcan/equipment/esc/1030.RawCommand.uavcan modules/uavcan/dsdl/uavcan/equipment/esc/1031.RPMCommand.uavcan modules/uavcan/dsdl/uavcan/equipment/esc/1034.Status.uavcan modules/uavcan/dsdl/uavcan/equipment/gnss/1060.Fix.uavcan modules/uavcan/dsdl/uavcan/equipment/gnss/1061.Auxiliary.uavcan modules/uavcan/dsdl/uavcan/equipment/gnss/1062.RTCMStream.uavcan modules/uavcan/dsdl/uavcan/equipment/hardpoint/1070.Command.uavcan modules/uavcan/dsdl/uavcan/equipment/hardpoint/1071.Status.uavcan modules/uavcan/dsdl/uavcan/equipment/indication/1080.BeepCommand.uavcan modules/uavcan/dsdl/uavcan/equipment/indication/1081.LightsCommand.uavcan modules/uavcan/dsdl/uavcan/equipment/indication/RGB565.uavcan modules/uavcan/dsdl/uavcan/equipment/indication/SingleLightCommand.uavcan modules/uavcan/dsdl/uavcan/equipment/power/1090.PrimaryPowerSupplyStatus.uavcan modules/uavcan/dsdl/uavcan/equipment/power/1091.CircuitStatus.uavcan modules/uavcan/dsdl/uavcan/equipment/power/1092.BatteryInfo.uavcan modules/uavcan/dsdl/uavcan/equipment/range_sensor/1050.Measurement.uavcan modules/uavcan/dsdl/uavcan/equipment/safety/1100.ArmingStatus.uavcan modules/uavcan/dsdl/uavcan/protocol/1.GetNodeInfo.uavcan modules/uavcan/dsdl/uavcan/protocol/2.GetDataTypeInfo.uavcan modules/uavcan/dsdl/uavcan/protocol/341.NodeStatus.uavcan modules/uavcan/dsdl/uavcan/protocol/4.GetTransportStats.uavcan modules/uavcan/dsdl/uavcan/protocol/4.GlobalTimeSync.uavcan modules/uavcan/dsdl/uavcan/protocol/5.Panic.uavcan modules/uavcan/dsdl/uavcan/protocol/5.RestartNode.uavcan modules/uavcan/dsdl/uavcan/protocol/6.AccessCommandShell.uavcan modules/uavcan/dsdl/uavcan/protocol/CANIfaceStats.uavcan modules/uavcan/dsdl/uavcan/protocol/DataTypeKind.uavcan modules/uavcan/dsdl/uavcan/protocol/HardwareVersion.uavcan modules/uavcan/dsdl/uavcan/protocol/SoftwareVersion.uavcan modules/uavcan/dsdl/uavcan/protocol/debug/16370.KeyValue.uavcan modules/uavcan/dsdl/uavcan/protocol/debug/16383.LogMessage.uavcan modules/uavcan/dsdl/uavcan/protocol/debug/LogLevel.uavcan modules/uavcan/dsdl/uavcan/protocol/dynamic_node_id/1.Allocation.uavcan modules/uavcan/dsdl/uavcan/protocol/dynamic_node_id/server/30.AppendEntries.uavcan modules/uavcan/dsdl/uavcan/protocol/dynamic_node_id/server/31.RequestVote.uavcan modules/uavcan/dsdl/uavcan/protocol/dynamic_node_id/server/390.Discovery.uavcan modules/uavcan/dsdl/uavcan/protocol/dynamic_node_id/server/Entry.uavcan modules/uavcan/dsdl/uavcan/protocol/enumeration/15.Begin.uavcan modules/uavcan/dsdl/uavcan/protocol/enumeration/380.Indication.uavcan modules/uavcan/dsdl/uavcan/protocol/file/40.BeginFirmwareUpdate.uavcan modules/uavcan/dsdl/uavcan/protocol/file/45.GetInfo.uavcan modules/uavcan/dsdl/uavcan/protocol/file/46.GetDirectoryEntryInfo.uavcan modules/uavcan/dsdl/uavcan/protocol/file/47.Delete.uavcan modules/uavcan/dsdl/uavcan/protocol/file/48.Read.uavcan modules/uavcan/dsdl/uavcan/protocol/file/49.Write.uavcan modules/uavcan/dsdl/uavcan/protocol/file/EntryType.uavcan modules/uavcan/dsdl/uavcan/protocol/file/Error.uavcan modules/uavcan/dsdl/uavcan/protocol/file/Path.uavcan modules/uavcan/dsdl/uavcan/protocol/param/10.ExecuteOpcode.uavcan modules/uavcan/dsdl/uavcan/protocol/param/11.GetSet.uavcan modules/uavcan/dsdl/uavcan/protocol/param/Empty.uavcan modules/uavcan/dsdl/uavcan/protocol/param/NumericValue.uavcan modules/uavcan/dsdl/uavcan/protocol/param/Value.uavcan
[ 7/15] Creating build/px4-v2/ap_version.h
[ 8/15] CMake Configure px4
[ 9/15] PX4: Copying rc.APM to px4-extra-files/ROMFS/init.d/rc.APM
[10/15] PX4: Copying rc.error to px4-extra-files/ROMFS/init.d/rc.error
[11/15] PX4: Copying rcS to px4-extra-files/ROMFS/init.d/rcS
[12/15] PX4: Copying startup to px4-extra-files/ROMFS/tones/startup
[13/15] PX4: Copying px4fmuv2_bl.bin to px4-extra-files/ROMFS/bootloader/fmu_bl.bin
– nuttx-px4fmu-v2-apm
/usr/bin/python: can’t open file ‘/home/Tong’: [Errno 2] No such file or directory

uavcangen returned 2 error code
– could not find gdbtui
– Configuring incomplete, errors occurred!
CMake Error at cmake/toolchains/Toolchain-arm-none-eabi.cmake:62 (message):
could not find patch
Call Stack (most recent call first):
/usr/share/cmake-3.6.2/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt:204 (project)

CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage

Validation skipped for /home/Tong guoxun/apm2/ardupilot/modules/mavlink/message_definitions/v1.0/ardupilotmega.xml.
Parsing /home/Tong guoxun/apm2/ardupilot/modules/mavlink/message_definitions/v1.0/ardupilotmega.xml
Note: message DATA64 is longer than 64 bytes long (74 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message DATA96 is longer than 64 bytes long (106 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message REMOTE_LOG_DATA_BLOCK is longer than 64 bytes long (214 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message DEVICE_OP_READ_REPLY is longer than 64 bytes long (143 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message DEVICE_OP_WRITE is longer than 64 bytes long (187 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Validation skipped for /home/Tong guoxun/apm2/ardupilot/modules/mavlink/message_definitions/v1.0/common.xml.
Parsing /home/Tong guoxun/apm2/ardupilot/modules/mavlink/message_definitions/v1.0/common.xml
Note: message GPS_STATUS is longer than 64 bytes long (109 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message ATTITUDE_QUATERNION_COV is longer than 64 bytes long (80 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message GLOBAL_POSITION_INT_COV is longer than 64 bytes long (189 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message LOCAL_POSITION_NED_COV is longer than 64 bytes long (233 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message HIL_ACTUATOR_CONTROLS is longer than 64 bytes long (89 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message HIGHRES_IMU is longer than 64 bytes long (70 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message HIL_SENSOR is longer than 64 bytes long (72 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message SIM_STATE is longer than 64 bytes long (92 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message FILE_TRANSFER_PROTOCOL is longer than 64 bytes long (262 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message HIL_STATE_QUATERNION is longer than 64 bytes long (72 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message LOG_DATA is longer than 64 bytes long (105 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message GPS_INJECT_DATA is longer than 64 bytes long (121 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message SERIAL_CONTROL is longer than 64 bytes long (87 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message ENCAPSULATED_DATA is longer than 64 bytes long (263 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message RESOURCE_REQUEST is longer than 64 bytes long (251 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message FOLLOW_TARGET is longer than 64 bytes long (101 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message CONTROL_SYSTEM_STATE is longer than 64 bytes long (108 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message AUTOPILOT_VERSION is longer than 64 bytes long (68 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message GPS_INPUT is longer than 64 bytes long (71 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message GPS_RTCM_DATA is longer than 64 bytes long (190 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message V2_EXTENSION is longer than 64 bytes long (262 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message CAMERA_INFORMATION is longer than 64 bytes long (94 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message CAMERA_IMAGE_CAPTURED is longer than 64 bytes long (263 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message LOGGING_DATA is longer than 64 bytes long (263 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message LOGGING_DATA_ACKED is longer than 64 bytes long (263 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Validation skipped for /home/Tong guoxun/apm2/ardupilot/modules/mavlink/message_definitions/v1.0/uAvionix.xml.
Parsing /home/Tong guoxun/apm2/ardupilot/modules/mavlink/message_definitions/v1.0/uAvionix.xml
Merged enum MAV_CMD
Found 208 MAVLink message types in 3 XML files
Generating C implementation in directory /home/Tong guoxun/apm2/ardupilot/build/px4-v2/libraries/GCS_MAVLink/include/mavlink/v2.0/ardupilotmega
Generating C implementation in directory /home/Tong guoxun/apm2/ardupilot/build/px4-v2/libraries/GCS_MAVLink/include/mavlink/v2.0/common
Generating C implementation in directory /home/Tong guoxun/apm2/ardupilot/build/px4-v2/libraries/GCS_MAVLink/include/mavlink/v2.0/uAvionix
Copying fixed headers for protocol 2.0 to /home/Tong guoxun/apm2/ardupilot/build/px4-v2/libraries/GCS_MAVLink/include/mavlink/v2.0

WARNING: Unable to load XML validator libraries. XML validation will not be performed

Waf: Leaving directory `/home/Tong guoxun/apm2/ardupilot/build/px4-v2’
Build failed
-> task in ‘uavcan’ failed (exit status 2):
{task 7696545519968: uavcangen CoarseOrientation.uavcan,Timestamp.uavcan,1010.ArrayCommand.uavcan,1011.Status.uavcan,Command.uavcan,1000.Solution.uavcan,1001.MagneticFieldStrength.uavcan,1020.TrueAirspeed.uavcan,1021.IndicatedAirspeed.uavcan,1025.AngleOfAttack.uavcan,1026.Sideslip.uavcan,1028.StaticPressure.uavcan,1029.StaticTemperature.uavcan,1040.AngularCommand.uavcan,1041.GEOPOICommand.uavcan,1044.Status.uavcan,Mode.uavcan,1030.RawCommand.uavcan,1031.RPMCommand.uavcan,1034.Status.uavcan,1060.Fix.uavcan,1061.Auxiliary.uavcan,1062.RTCMStream.uavcan,1070.Command.uavcan,1071.Status.uavcan,1080.BeepCommand.uavcan,1081.LightsCommand.uavcan,RGB565.uavcan,SingleLightCommand.uavcan,1090.PrimaryPowerSupplyStatus.uavcan,1091.CircuitStatus.uavcan,1092.BatteryInfo.uavcan,1050.Measurement.uavcan,1100.ArmingStatus.uavcan,1.GetNodeInfo.uavcan,2.GetDataTypeInfo.uavcan,341.NodeStatus.uavcan,4.GetTransportStats.uavcan,4.GlobalTimeSync.uavcan,5.Panic.uavcan,5.RestartNode.uavcan,6.AccessCommandShell.uavcan,CANIfaceStats.uavcan,DataTypeKind.uavcan,HardwareVersion.uavcan,SoftwareVersion.uavcan,16370.KeyValue.uavcan,16383.LogMessage.uavcan,LogLevel.uavcan,1.Allocation.uavcan,30.AppendEntries.uavcan,31.RequestVote.uavcan,390.Discovery.uavcan,Entry.uavcan,15.Begin.uavcan,380.Indication.uavcan,40.BeginFirmwareUpdate.uavcan,45.GetInfo.uavcan,46.GetDirectoryEntryInfo.uavcan,47.Delete.uavcan,48.Read.uavcan,49.Write.uavcan,EntryType.uavcan,Error.uavcan,Path.uavcan,10.ExecuteOpcode.uavcan,11.GetSet.uavcan,Empty.uavcan,NumericValue.uavcan,Value.uavcan -> }
‘’

Try “ git submodule update —init —recursive —force”, then “./waf configure —board fmuv3” (or fmuv2).
Afaik px4 builds are deprecated on Master.

The PX4 builds under Cygwin fail if there’s a space in the build path /home/Tong guoxun/apm2/ardupilot

You’ll need to move the APM source to a different folder - one without a space in it’s name.

thank you it’s working! thank you very much!

but i have another problem.
I want to build copter-3.5.7 in windows 10 by cywin,but it output:

Waf: Entering directory `/home/apm-3.5…7/ardupilot/build/px4-v3’
[14/15] CMake Build px4 msg_gen
make: *** No rule to make target ‘msg_gen’. Stop.

Waf: Leaving directory `/home/apm-3.5…7/ardupilot/build/px4-v3’
Build failed
-> task in ‘px4_msg_gen’ failed (exit status 2):
{task 7696528246656: cmake_build_task -> }
[’/usr/bin/cmake’, ‘–build’, ‘/home/apm-3.5…7/ardupilot/build/px4-v3/modules/PX4Firmware’, ‘–target’, ‘msg_gen’]

there is some answers in google or somewhere,but it can’t work at all.
please help me , thank you!!!