I went to a couple of sites that showed the packages that i needed to
download and install. but one of them
gnat-3.13p-8.i386.rpm
when I try to install it , it says there is a conflict with file xxx
from package
gcc-gnat-3.3.1-3.i386.rpm
now unless I'm misreading the 2 packages it sounds like the 2nd one is
just basically an updated version of the 1st one.
1st question: is the 2nd one just an updated version of the 1st one.
2nd question: does anyone here know anything about writing a program in
the language of Ada on a linux o/s. If so what would the command be to
compile the program in linux? I have taken 2 years of programming in
Ada from the local university but it's been several years since I have
written in Ada. And I have never done it under linux. I wrote in a unix
evironment in college. Which is very similar.I remember that I just
have to activate a text editor write the program, and save the file ..
but the command to actually compile the thing eludes me.
May have found it for you; to list the files belonging to a package:
rpm -ql gcc-gnat
/usr/bin/gnat
/usr/bin/gnatbind
/usr/bin/gnatbl
/usr/bin/gnatchop
/usr/bin/gnatfind
/usr/bin/gnatgcc
/usr/bin/gnatkr
/usr/bin/gnatlink
/usr/bin/gnatls
/usr/bin/gnatmake
/usr/bin/gnatprep
/usr/bin/gnatpsta
/usr/bin/gnatpsys
/usr/bin/gnatxref
Looks to me like "gnatgcc" is the compiler.
If so, how about posting the Ada version of the "Hello World" program
for me to compile. Have never seen or used Ada.
--
Regards,
RodgerH
---
Registered Linux User #285004
---
$rpm -q gcc-gnat
gcc-gnat-3.2.2-5
$rpm -qi gcc-gnat
Name : gcc-gnat Relocations: (not relocateable)
Version : 3.2.2 Vendor: Red Hat, Inc.
Release : 5 Build Date: Tue 25 Feb 2003
08:53:15 AM EST
Install Date: Tue 27 May 2003 05:01:48 PM EDT Build Host:
stripples.devel.redhat.com
Group : Development/Languages Source RPM: gcc-3.2.2-5.src.rpm
Size : 18312255 License: GPL
Signature : DSA/SHA1, Tue 25 Feb 2003 10:04:21 AM EST, Key ID
219180cddb42a60e
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL : http://gcc.gnu.org
Summary : Ada 95 support for GCC
Description :
GNAT is a GNU Ada 95 front-end to GCC. This package includes development
tools,
the documents and Ada 95 compiler.
$rpm -qi gnat
package gnat is not installed
$cat rh9_cd1 | grep gnat
$cat rh9_cd2 | grep gnat
gcc-gnat-3.2.2-5.i386.rpm
libgnat-3.2.2-5.i386.rpm
$cat rh9_cd3 | grep gnat
If you get file level naming conflicts trying to install a package, then
it appears to be an older or competing package. So if it is not coming
from the RH9 distro CD's, then you should probably not need it.
Try doing some Google searches and see what you come up with on what the
compiler command is.
RodgerH wrote:
> Andrew wrote:
>
>>
>> I need to write a program in Ada.
>>
>> I went to a couple of sites that showed the packages that i needed to
>> download and install. but one of them
>> gnat-3.13p-8.i386.rpm
>> when I try to install it , it says there is a conflict with file xxx
>> from package
<<<Snip>>>
>
> Looks to me like "gnatgcc" is the compiler.
>
> If so, how about posting the Ada version of the "Hello World" program
> for me to compile. Have never seen or used Ada.
>
here is a hello world program
type
emacs hello.adb
in the text editor type
with Ada.Text_Io; use Ada.Text_Io;
procedure Hello is
begin
Put_Line ("Hello, world!");
end Hello;
then save and exit
and type
gnatmake hello.adb
then type
./hello
and that should do it
by the way .. i'm still trying to remember if you need the
"use Ada.Text_Io;"
line, but i do know that it worked on my computer when i did the above
stated commands.
Andrew wrote:
>
>
> RodgerH wrote:
>
>> Andrew wrote:
>>
almost forgot, when you are finished compiling and have ran the hello
world program you will have 5 files in your directory.
-rwxrwxr-x 1 andrew andrew 20530 Sep 15 23:00 hello
-rw-rw-r-- 1 andrew andrew 210 Sep 15 23:00 hello.adb
-rw-rw-r-- 1 andrew andrew 118 Sep 15 22:11 hello.adb~
-rw-rw-r-- 1 andrew andrew 1338 Sep 15 23:00 hello.ali
-rw-rw-r-- 1 andrew andrew 1036 Sep 15 23:00 hello.o
that is copied from my terminal window when I typed ls
you can delete everything except
-rwxrwxr-x 1 andrew andrew 20530 Sep 15 23:00 hello
-rw-rw-r-- 1 andrew andrew 210 Sep 15 23:00 hello.adb
I would suggest keeping the hello.adb file since that is the source
code... *heh*
and the hello file is the executable file, but the other 3 files are
just created as the program is compiled.. I think there might be a way
for you to compile the program and have it clean up the garbage, but I'm
not to sure how to do that.
Yeah, Ada is used for military apps .. actually when I was taking the
classes in colllege, they told us that 'the' only place that uses the
language is the DOD (Dept. of Defense).
But it's good for certain apps because it's main power is number crunching.
Andrew wrote:
>
> I need to write a program in Ada.
>
ok I've run into a snag .. and i'm hoping that a programmer can help me
out.
here is a copy of my program (written in Ada)
====
-- computes Interest on money invested
with TEXT_IO;
use TEXT_IO;
procedure Interest is
Initialamt : Float;
Interest : Float;
TimeNWeeks : Integer;
DRate : Float;
Days : Integer;
Balance : Float;
package NUMBER_IO is new INTEGER_IO(INTEGER);
use NUMBER_IO;
package Float1_IO is new Float_IO(FLOAT);
use Float1_IO;
begin
New_Line;
Put ("How much money do you have-Please add cents? example 365.22 ");
Get (Initialamt);
Put ("What is the interest you will receive? ");
Get (Interest);
Put ("How long will it be invested in weeks? ");
Get (TimeNWeeks);
New_Line;
Days:=TimeNWeeks * 7;
DRate:=(Interest/100.0)/365.0;
Balance:=Initialamt * (1.0+DRate)**Days;
New_Line;
Put ("Your ending balance will be ");
Put (Balance);
New_Line;
end Interest;
========================================
now here is the output from when I try to run the program
How much money do you have-Please add cents? .02
What is the interest you will receive? 25
How long will it be invested in weeks? 4
Your ending balance will be 2.03872E-02
[andrew@stc program]$ ./interest
How much money do you have-Please add cents? .02
What is the interest you will receive? .25
How long will it be invested in weeks? 4
Your ending balance will be 2.00038E-02
============
now I realize that not many people here program in ada .. and i realize
that this is a linux group not a programming one..
but I'm hoping that this is just a simple case of I .. well *L* I'm
hoping this is a simple error that I'm overlooking..
sub-note : this program is directly copied from a printout of a program
that I wrote in college (and it worked on the colleges computers).