r/ada • • 9d ago

Learning ada programming setup

i am planning to do setup for Ada. Bit confused on Alire/GNat/Gnat Studio.

Just downloaded GNat studio thinking its 'all in one' but its asking 'gpr build missing'

Can someone point to basic tutorial on how to setup the environment?

Thanks

9 Upvotes

7 comments sorted by

View all comments

7

u/jordansrowles 9d ago

I'd recommend installing Alire first, then running alr toolchain --select to install GNAT and GPRbuild.

You can then create a project with alr init --bin hello, enter the directory and run alr run to build and execute it.

Once that's working, you can use alr edit to open the project in GNAT Studio, assuming you've installed Studio and it's available on your PATH.

Edited for more info:

Most of this is different stuff:

  • gnat is the compiler
  • gprbuild is the build system
  • gnat studio is the ide
  • alire is the package manager

1

u/DiligentBill2936 9d ago

Thanks. I see below error when running toolchain --select command.

curl failed to verify the legitimacy of the server and therefore could not

establish a secure connection to it. To learn more about this situation and

how to fix it, please visit the webpage mentioned above.

File not found - C:\Users\Admin\AppData\Local\alire\cache\toolchains\alr-6280-tyti.tmp\*

2

u/jordansrowles 9d ago

Someone else had a similar issue to you, https://forum.ada-lang.io/t/alire-really-curl-certificate-problem-on-windows/1683

Are you using an antivirus like Norton or Kaspersky? In their case it was interfering with cert verification

Do where curl and curl I https://github.com to see if you have it, and can connect with TLS

1

u/DiligentBill2936 9d ago

Yes. Using Kaspersky. Need to shutdown for some time then.

2

u/DiligentBill2936 9d ago

It worked. where is gnat and gprbuild are installed ? GNAT studio needs it.

2

u/DiligentBill2936 9d ago

OK. got it. Its at C:\Users\Admin\AppData\Local\alire\cache\toolchains\. Executables inside it must be in the PATH.