comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: Ada download
Date: Mon, 08 Jan 2018 15:13:33 -0500
Date: 2018-01-08T15:13:33-05:00	[thread overview]
Message-ID: <ndh75dtg13vnmt7lf5h1mps37kei449lkf@4ax.com> (raw)
In-Reply-To: 194af3eb-d3f5-4587-a568-509e19a4971b@googlegroups.com

On Mon, 8 Jan 2018 10:53:12 -0800 (PST), sophia.adampour@gmail.com
declaimed the following:


>
>
>
>   GNAT GPL is now installed. To launch it, you must put
>      /usr/local/gnat2017/bin
>   in front of your PATH environment variable. The following
>   commands enable you to do this:
>      PATH="/usr/local/gnat2017/bin:$PATH"; export PATH  (Bourne shell)
>      setenv PATH "/usr/local/gnat2017/bin:$PATH"        (C shell)
>   Thank you for installing GNAT GPL Edition!
>
>Adampours-MacBook-Pro:~ adampour$ export PATH=/usr/local/gnat2017/bin:$PATH


	Note: since you likely do not want to enter that command every time you
log into the computer (or open a new shell window), you probably want to
modify whatever startup script is used by the Mac. I don't Mac OS, so don't
know where it differs from the systems I do have...

	Candidate (Linux, using BASH shell)file would be to add the line to:

~/.bashrc

using whatever programming/text editor is available (I tend to use vim, but
given your questions that would be too much to inflict upon you).


>Adampours-MacBook-Pro:~ adampour$ gcc --version
>gcc (GCC) 6.3.1 20170510 (for GNAT GPL 2017 20170515)
>Copyright (C) 2016 Free Software Foundation, Inc.
>This is free software; see the source for copying conditions.
>See your AdaCore support agreement for details of warranty and support.
>If you do not have a current support agreement, then there is absolutely
>no warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>PURPOSE.
>
>Adampours-MacBook-Pro:~ adampour$ Hello.World
>-bash: Hello.World: command not found
>Adampours-MacBook-Pro:~ adampour$ Ada.Text_IO.Put_Line("Hello world!");
>-bash: !": event not found
>Adampours-MacBook-Pro:~ adampour$ 
>
>
>But how do I use the program? Do I have gps now? If yes, how do I open it? 
>I am so sorry for all these questions, I just really want to learn programming and we're using Ada at our school
>

	You are now in the realm where your questions are about how to
use/administer the Mac OS and no longer have anything to do with Ada or
GNAT.

	On a Debian install (in a virtual machine, and where the package
manager handling install/build) I find GNAT Programming Studio shows up on
the
	Applications
		Development
menu. No idea what Mac does for those.

	From a command shell

wulfraed@stretch:/$ which gps
wulfraed@stretch:/$ which gnatmake
/usr/bin/gnatmake
wulfraed@stretch:/$ ls /usr/bin/gnat*
/usr/bin/gnat             /usr/bin/gnatfind-6   /usr/bin/gnatls-6
/usr/bin/gnat-6           /usr/bin/gnatgcc      /usr/bin/gnatmake
/usr/bin/gnatbind         /usr/bin/gnat-gps     /usr/bin/gnatmake-6
/usr/bin/gnatbind-6       /usr/bin/gnathtml     /usr/bin/gnatname
/usr/bin/gnatchop         /usr/bin/gnathtml-6   /usr/bin/gnatname-6
/usr/bin/gnatchop-6       /usr/bin/gnatinspect  /usr/bin/gnatprep
/usr/bin/gnatclean        /usr/bin/gnatkr       /usr/bin/gnatprep-6
/usr/bin/gnatclean-6      /usr/bin/gnatkr-6     /usr/bin/gnatspark
/usr/bin/gnatcoll_db2ada  /usr/bin/gnatlink     /usr/bin/gnatxref
/usr/bin/gnatdoc          /usr/bin/gnatlink-6   /usr/bin/gnatxref-6
/usr/bin/gnatfind         /usr/bin/gnatls
wulfraed@stretch:/$ 

there is 

wulfraed@stretch:/$ which gnat-gps
/usr/bin/gnat-gps
wulfraed@stretch:/$ 

	Though I do not recommend running it from a command shell if you can
find a graphical start icon -- since you likely don't want to be spammed
with warning messages... Opening via an icon/menu means no stdout so the
warnings get dumped into the bit-bucket.

wulfraed@stretch:/$ gnat-gps

(gnat-gps:2222): Gtk-WARNING **: Theme parsing error:
gps-Adwaita.css:61:27: The :insensitive pseudo-class is deprecated. Use
:disabled instead.

(gnat-gps:2222): Gtk-WARNING **: Theme parsing error: <data>:1:16: Using
Pango syntax for the font: style property is deprecated; please use CSS
syntax
GPS:1: PyGIWarning: Gtk was imported without specifying a version first.
Use gi.require_version('Gtk', '3.0') before import to ensure that the right
version gets loaded.
Gtk-Message: GtkDialog mapped without a transient parent. This is
discouraged.

(gnat-gps:2222): Gtk-WARNING **: Allocating size to GtkAdaMDI
0x55bf84cb4270 without calling gtk_widget_get_preferred_width/height(). How
does the code know the size to allocate?

(gnat-gps:2222): Gtk-WARNING **: Allocating size to GtkNotebook
0x55bf85334730 without calling gtk_widget_get_preferred_width/height(). How
does the code know the size to allocate?


	Having created a sample program file

wulfraed@stretch:~$ ls
Desktop    Downloads       junk.txt  Pictures  Scratch  Templates
Documents  HelloWorld.adb  Music     Public    so.py    Videos
wulfraed@stretch:~$ cat HelloWorld.adb 
with ada.text_io;

procedure HelloWorld is

begin

   ada.Text_IO.Put_Line("Hello World?");

end HelloWorld;
wulfraed@stretch:~$ 

compiling/building from the command line (note: I am using the deprecated
gnatmake; AdaCore is phasing projects into a gpr-build system).

wulfraed@stretch:~$ gnatmake HelloWorld.adb 
gcc-6 -c HelloWorld.adb
HelloWorld.adb:3:11: warning: file name does not match unit name, should be
"helloworld.adb"
gnatbind-6 -x HelloWorld.ali
gnatlink-6 HelloWorld.ali
wulfraed@stretch:~$ 


	Heh... Looks like the Linux variant doesn't like mixed case names --
since the file is HelloWorld AND so is the procedure name in the source. To
run the program (most Linux are configured to not automatically include the
current directory when looking for programs to run, hence the use of the ./
to say "file is in current directory")

wulfraed@stretch:~$ HelloWorld
bash: HelloWorld: command not found
wulfraed@stretch:~$ 

wulfraed@stretch:~$ ./HelloWorld 
Hello World?
wulfraed@stretch:~$ 


	Building from GPS gave an error as the file I created is not defined in
a GPR project... Took me some time to create a project, recreate the file,
and then -- it would compile but not build an executable... I found I had
to edit the project properties in GPS to add the file as the "main"
program, and then rebuild to get the executable. Basically -- for short
test programs, GPS adds a lot of overhead to the build system... Use it to
edit a plain (non-project) file, save the file, and invoke gnatmake from a
command shell on the saved file may be quicker than learning to navigate
project properties. Projects become useful when you build up a program
containing many files with possibly odd options.



-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/


  reply	other threads:[~2018-01-08 20:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-06  0:54 Ada download sophia.adampour
2018-01-06 11:54 ` Brian Drummond
2018-01-06 12:42   ` sophia.adampour
2018-01-06 13:36     ` Simon Wright
2018-01-06 19:17       ` sophia.adampour
2018-01-06 20:05         ` Simon Wright
2018-01-08 12:21           ` sophia.adampour
2018-01-08 18:53             ` sophia.adampour
2018-01-08 20:13               ` Dennis Lee Bieber [this message]
2018-01-08 20:34               ` Anh Vo
2018-01-08 21:29             ` Simon Wright
2018-01-12  0:07               ` sophia.adampour
2018-01-12  9:39                 ` Simon Wright
2018-01-14 16:08                   ` sophia.adampour
2018-01-14 16:12                     ` sophia.adampour
2018-01-14 18:03                     ` Simon Wright
2018-01-15 18:42                       ` sophia.adampour
2018-01-15 19:13                         ` Dennis Lee Bieber
2018-01-15 20:16                           ` Simon Wright
2018-01-06 19:21       ` sophia.adampour
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox