AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

gprbuild can't locate gprconfig for auto-configuration #98

Closed coffeebe4code closed 3 years ago

coffeebe4code commented 3 years ago
gprbuild --version
GPRBUILD Community 2021 (20210519) (x86_64-pc-linux-gnu)
Copyright (C) 2004-2021, AdaCore
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gprconfig --version
GPRCONFIG Community 2021 (20210519) (x86_64-pc-linux-gnu)
Copyright (C) 2006-2021, AdaCore
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

they are clearly accessible and on my path.

echo $PATH
~/opt/GNAT/2021/bin

I installed this version from the Ada Core Website.

https://community.download.adacore.com/v1/f3a99d283f7b3d07293b2e1d07de00e31e332325?filename=gnat-2021-20210519-x86_64-linux-bin&rand=1389

However, I did not select to install the visual GNAT studio, as i planned to use vim only.

Here is the build.gpr file

project Build is
   for Main use ("main.adb"); -- renamed the greet.adb to main.adb
   for Languages use ("Ada");

   package Compiler is
      for Default_Switches ("Ada") use ("-g", "-O0", "-gnata", "-gnatwa");
   end Compiler;

   package Builder is
      for Default_Switches ("Ada") use ("-g");
      for Global_Configuration_Pragmas use "main.adc";
   end Builder;

end Build;

I pulled that directly from your websites first example source code. https://learn.adacore.com/courses/intro-to-ada/chapters/imperative_language.html

Here is the command I ran, and finally the output

gprbuild -q -P build.gpr
gprbuild: could not locate gprconfig for auto-configuration
coffeebe4code commented 3 years ago

I reinstalled with the studio. After having an error with libtinfo.so.5 not existing and linking a version i had like this. sudo ln -s /lib/x86_64-linux-gnu/libtinfo.so.6 /lib/x86_64-linux-gnu/libtinfo.so.5

I ran gnatstudio. and was able to get a simple hello project compiling with ease.

with Ada.Text_IO; use Ada.Text_IO;

procedure main is
begin
   Put_Line ("hello");
end main;

here is the run command. gprbuild -d -P/home/christopher/default.gpr /home/christopher/main.adb and output.

/home/christopher/main
hello

So I thought that whatever magic the studio did, my next terminal session would work, this was not the case. I still get the same error.

t-14 commented 3 years ago

I don't think gnatstudio comes with any particular magic that would affect command line tools, so this must be a problem in your environment (which apparently changes into a correct one if you run from gnatstudio). What you can try to do to troubleshoot it is open a terminal under gnatstudio control (View->OS Shell) and run your command from there. If it works, you can try checking what's different with your regular console, by running e.g. "set" etc. Let us know what it gives.

coffeebe4code commented 3 years ago

ahh, wow. I'm an idiot. On my path.

~/opt/GNAT/2021/bin:$PATH it's obviously, $HOME/opt/GNAT/2021/bin:$PATH

t-14 commented 3 years ago

Ok, happy to hear you figured out the problem.