GNAT Recompiling Libray files / how to force recompile all

Viewed 171

I have an error where I get that file X (in the standard library) needs recompiling as another file has changed. It had changed, as I accidentally changed it but corrected the change (confirmed with md5sum check). However the timestamp has changed, so now other items won't compile due to this. Short of reinstalling (which surely isn't necessary, but is possible) what's the solution to this?

I've tried adding the -f option to gprbuild when building to force recompiling and I get the same result.

Exact error:

error: "a-direct.adb" must be recompiled ("a-calfor.ads" has been modified)
error: "a-calfor.adb" must be recompiled ("a-calfor.ads" has been modified)
error: "g-calend.adb" must be recompiled ("a-calfor.ads" has been modified)
...
2 Answers

When invoked on a user project, gprbuild knows about compiling that project (and its dependencies), not the runtime.

AdaCore’s customers are provided, I think, with support to recompile the runtime, and there are GPRs and a daunting Makefile in the GCC sources.

gnatmake has a switch -a which forces any necessary recompilation of runtime sources into your object directory. I don’t think gprbuild supports it, and in any case you’d need to invoke it for all your projects.

If I were you I would just go ahead and reinstall.

Ok, this is probably not the intention of the warnings, but I just needed to get going. So I added (as per the help for gnatbind) -- adding the -t option for the binder with the following in gprbuild.

gprbuild -<options> -P <project_file>.gpr -bargs -t

which changed the error into a warning and produced my executable.

Obviously not the "right" way to solve the error, but that part wasn't critical, and I needed to get on.

Related