From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 08 Jan 2018 14:13:32 -0600 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: Ada download Date: Mon, 08 Jan 2018 15:13:33 -0500 Organization: IISS Elusive Unicorn Message-ID: References: <397e0653-1512-4111-b321-edde0c024bc8@googlegroups.com> <2462e55d-57d1-4753-b3e2-cd0a0b0f28e0@googlegroups.com> <9bedbd9c-94d3-4aaa-ab92-0b2e8648e403@googlegroups.com> <9c4d5a06-086d-41b0-96c8-27fbf1c71b5d@googlegroups.com> <194af3eb-d3f5-4587-a568-509e19a4971b@googlegroups.com> User-Agent: ForteAgent/8.00.32.1272 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.68.178.232 X-Trace: sv3-iIlLF99gJRjTbJQNq34Oq/R79aYH/mVmBATb0ARkM2pCt7jJcHV9zAL8cD+daQGD3K6Dq6TyKbuztnL!SN0Y7IZcfp6SGFUJuETetIfodXYWRqrD6EUQP5LuQDK9g4tfxW/c9ZYDA+JJI6jbiSNO2NpUPjXg!MqrFsqaILtU0XTH50T6u7zPCGjFy X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 8079 Xref: reader02.eternal-september.org comp.lang.ada:49813 Date: 2018-01-08T15:13:33-05:00 List-Id: 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: :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/