Compiling in ubuntu 18.10

I am unable to run waf ./waf
I am trying to run
./waf configure --board px4-v3
in the tutorial


i get
/Downloads/ardupilot-master$ ./waf configure --board px4-v3
/usr/bin/python: can’t open file ‘/home/josheeg/Downloads/ardupilot-master/modules/waf/waf-light’: [Errno 2] No such file or directory
Missing waf submodule. Trying to get it
fatal: not a git repository (or any of the parent directories): .git
Could not update submodule

I’d suggest starting here: http://ardupilot.org/dev/docs/where-to-get-the-code.html
and working through the guide.
It looks as though you either don’t have git installed, or downloaded the zip file rather than clone the repository.
Have a go using the procedure I linked, and it should work.

1 Like

you are correct I didn’t use git to download and work with the ardupilot folder that is new and different.
I am much further with a bug in the make part of sitl

I have tried building the different ardupilot builds as shown in this step
./waf configure --board px4-v3

I get
Setting top to : /home/josheeg/ardupilot-master
Setting out to : /home/josheeg/ardupilot-master/build
Autoconfiguration : enabled
Setting board to : px4-v3
Using toolchain : arm-none-eabi
Checking for ‘g++’ (C++ compiler) : /usr/bin/arm-none-eabi-g++
Checking for ‘gcc’ (C compiler) : /usr/bin/arm-none-eabi-gcc
Checking for c flags ‘-MMD’ : yes
Checking for cxx flags ‘-MMD’ : yes
Traceback (most recent call last):
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Scripting.py”, line 159, in waf_entry_point
run_commands()
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Scripting.py”, line 252, in run_commands
ctx = run_command(cmd_name)
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Scripting.py”, line 236, in run_command
ctx.execute()
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Configure.py”, line 159, in execute
super(ConfigurationContext, self).execute()
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Context.py”, line 204, in execute
self.recurse([os.path.dirname(g_module.root_path)])
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Context.py”, line 286, in recurse
user_function(self)
File “/home/josheeg/ardupilot-master/wscript”, line 233, in configure
cfg.get_board().configure(cfg)
File “Tools/ardupilotwaf/boards.py”, line 751, in configure
super(px4, self).configure(cfg)
File “Tools/ardupilotwaf/boards.py”, line 44, in configure
self.configure_env(cfg, env)
File “Tools/ardupilotwaf/boards.py”, line 755, in configure_env
super(px4, self).configure_env(cfg, env)
File “Tools/ardupilotwaf/boards.py”, line 219, in configure_env
cfg.srcnode.find_dir(‘modules/uavcan/libuavcan/include’).abspath()
AttributeError: ‘NoneType’ object has no attribute ‘abspath’

Now I figured try the other options see if I get the same result?
Setting top to : /home/josheeg/ardupilot-master
Setting out to : /home/josheeg/ardupilot-master/build
Autoconfiguration : enabled
Setting board to : px4-v3
Using toolchain : arm-none-eabi
Checking for ‘g++’ (C++ compiler) : /usr/bin/arm-none-eabi-g++
Checking for ‘gcc’ (C compiler) : /usr/bin/arm-none-eabi-gcc
Checking for c flags ‘-MMD’ : yes
Checking for cxx flags ‘-MMD’ : yes
Traceback (most recent call last):
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Scripting.py”, line 159, in waf_entry_point
run_commands()
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Scripting.py”, line 252, in run_commands
ctx = run_command(cmd_name)
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Scripting.py”, line 236, in run_command
ctx.execute()
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Configure.py”, line 159, in execute
super(ConfigurationContext, self).execute()
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Context.py”, line 204, in execute
self.recurse([os.path.dirname(g_module.root_path)])
File “/home/josheeg/ardupilot-master/modules/waf/waflib/Context.py”, line 286, in recurse
user_function(self)
File “/home/josheeg/ardupilot-master/wscript”, line 233, in configure
cfg.get_board().configure(cfg)
File “Tools/ardupilotwaf/boards.py”, line 751, in configure
super(px4, self).configure(cfg)
File “Tools/ardupilotwaf/boards.py”, line 44, in configure
self.configure_env(cfg, env)
File “Tools/ardupilotwaf/boards.py”, line 755, in configure_env
super(px4, self).configure_env(cfg, env)
File “Tools/ardupilotwaf/boards.py”, line 219, in configure_env
cfg.srcnode.find_dir(‘modules/uavcan/libuavcan/include’).abspath()
AttributeError: ‘NoneType’ object has no attribute ‘abspath’

That one seemed to work so I figured why not try sitl at least
well I get this error
osheeg@josheeg-Vostro-220-Series:~/ardupilot-master$ ./waf copter
Waf: Entering directory `/home/josheeg/ardupilot-master/build/sitl’
Command [’/usr/bin/git’, ‘rev-parse’, ‘–short=8’, ‘HEAD’] returned 128

What an I doing wrong?

hello,

In ardupilot directory, type :

git submodule update --init --recursive

2 Likes

I think git is not the git website release but the ubuntu level release and I went to the git page and it is installing from their instructions.

I didn’t see a responce from it but I tried this and got a download sudo apt install git-all

still the same error I also tried installing mavproxy incase something it had allowed the person to compile.
If someone has done this. a virtual ubuntu 18 system could compile sitl and show eatch step by screencast or just coppied and paste into a quickstart.

https://ardupilot.github.io/MAVProxy/html/getting_started/download_and_installation.html
still doesnt compile
how do I update waf? How should I install it?

how do I update waf? How should I install it?

Try doing a

git submodule update

that solves 95% of the build problems I experienced.

If you are not already, I recommend only working with git. Do not waste too much time on tar or zip source code releases.

If you want to work efficiently with source code, you will need to have a basic git understanding in any case.

To answer your question, waf is build tool, which “comes” with the ardupilot source code, as a submodule. To update it, see above. You can of course also go to https://gitlab.com/ita1024/waf/ and try to get the newest version there, but I don’t recommend that, as the tested/working waf version will be the submodule version.

I installed git from git website not Ubuntu I got a newer version ran all scripts copter built.

So you are saying it is working for you?

If you use Ubuntu I’d recommend installing via apt. Downloading via websites works. but is time consuming.

I think you mean like apt like how git is installed on gits site

I had the same problem where it was telling me it couldn’t find the submodules. Everyone here in this thread that answered with updating your git repository is totally right, because you are missing the files in the modules/waf folder. BUT for me, updating the git repo wasn’t loading in those files because they are posted online on a different commit number than what I was updating to (if that makes any sense) See image.

Anyways, if you’re really stuck, just try manually downloading all the files from here (https://github.com/ArduPilot/waf/tree/337b0a96beeac517ecde081fb76dedd039089734) and pasting them into your waf subfolder. This is JUST to see if not having the files is the problem. You can go back later and put in a good reference to the updated versions of the files.

This is magic! It should be in the ArduPilot docs!

1 Like

Hi Tim,
It’s already there: build setup

Even I was able to find it (RTFM)

But not here: ardupilot/BUILD.md at master · ArduPilot/ardupilot · GitHub
Which is what I read.

Yes I know the --recursive is on the git clone command, but I had missed that.

Excuse, have you solved it?

ubutun 18.10 is depreacted, please update to 20.04 or 22.04 and follow wiki instruction for installation