comp.lang.ada
 help / color / mirror / Atom feed
* Re: Multiple partitions with GNAT 3.12p
  2000-11-15  0:00 Multiple partitions with GNAT 3.12p Vincent Smeets
  2000-11-15  0:00 ` Gisle Sælensminde
@ 2000-11-15  0:00 ` Robert Dewar
  1 sibling, 0 replies; 7+ messages in thread
From: Robert Dewar @ 2000-11-15  0:00 UTC (permalink / raw)


In article <3A1284C8.58C2405D@CCI.de>,
  Vincent Smeets <Vincent.Smeets@CCI.de> wrote:
> Hallo,
>
> I'm using GNAT 3.12p. How can I compile and link a program
with multiple
> partitions? What must I do to create the partitions?

Programs with multiple partitions are in the realm of the
distributed systems annex. Obtain and consult the GLADE
documentation for your machine (and in future be sure to
say what machine you are using). Also, if you can, update
to a later version of GNAT and GLADE.


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Multiple partitions with GNAT 3.12p
@ 2000-11-15  0:00 Vincent Smeets
  2000-11-15  0:00 ` Gisle Sælensminde
  2000-11-15  0:00 ` Robert Dewar
  0 siblings, 2 replies; 7+ messages in thread
From: Vincent Smeets @ 2000-11-15  0:00 UTC (permalink / raw)


Hallo,

I'm using GNAT 3.12p. How can I compile and link a program with multiple
partitions? What must I do to create the partitions?

As an example, I want package A to be a separate partition from the main
program B.

package A is
   procedure P (I : String);
end A;

with Ada.Text_IO;
package body A is
   procedure P (I : String) is
   begin
      Ada.Text_IO.Put_Line (I);
   end P;
end A;

with A;
procedure B is
begin
   A.P ("Testing partitions.");
end B:

-- Vincent Smeets                 Competence Center Informatik GmbH
-- Tel. : +49-5931-805461         Postfach 1225
-- Fax  : +49-5931-805175         49702 Meppen, Germany
-- EMail: Vincent.Smeets@CCI.de   http://www.CCI.de/
-- PGP fingerprint: 53 1C 3B 6F B6 9A EB 83  B4 7E 25 08 78 BD 5C 2C




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Multiple partitions with GNAT 3.12p
  2000-11-15  0:00 Multiple partitions with GNAT 3.12p Vincent Smeets
@ 2000-11-15  0:00 ` Gisle Sælensminde
  2000-11-15  0:00   ` Vincent Smeets
  2000-11-17  0:00   ` Robert Dewar
  2000-11-15  0:00 ` Robert Dewar
  1 sibling, 2 replies; 7+ messages in thread
From: Gisle Sælensminde @ 2000-11-15  0:00 UTC (permalink / raw)


In article <3A1284C8.58C2405D@CCI.de>, Vincent Smeets wrote:
>Hallo,
>
>I'm using GNAT 3.12p. How can I compile and link a program with multiple
>partitions? What must I do to create the partitions?
>
>As an example, I want package A to be a separate partition from the main
>program B.
>
>package A is
>   procedure P (I : String);
>end A;
>
>with Ada.Text_IO;
>package body A is
>   procedure P (I : String) is
>   begin
>      Ada.Text_IO.Put_Line (I);
>   end P;
>end A;
>
>with A;
>procedure B is
>begin
>   A.P ("Testing partitions.");
>end B:

I presume you mean compilation unit, and not partition, that means
something else in Ada95 terminology (Distributed programming)

Run the program gnatchop that comes with GNAT.

% gnatchop adafile

This produce the files a.ads a.adb and b.adb, containing the expected
units. GNAT expect it that way. Then run gnatmake on B.

% gnatmake b.adb

Gnatmake will the compile a and then b, and link the whole thing into
an executable file. This works because the "right" filenames are used.
If you of some reason want to use other filenames (e.g. for legacy code)
Then this can be specified throgh an adc-file, but you usally don't want
to do this. All of this is documented in the documentation following GNAT.

If you use Linux, "The Big Online Book of Linux Ada Programming"
may be useful (esp ch 4). 

http://www.vaxxine.com/pegasoft/homes/book.html


-- 
--
Gisle S�lensminde ( gisle@ii.uib.no )   

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going
to land, and it could be dangerous sitting under them as they fly
overhead. (from RFC 1925)




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Multiple partitions with GNAT 3.12p
  2000-11-15  0:00 ` Gisle Sælensminde
@ 2000-11-15  0:00   ` Vincent Smeets
  2000-11-15  0:00     ` Gisle Sælensminde
  2000-11-17  0:00   ` Robert Dewar
  1 sibling, 1 reply; 7+ messages in thread
From: Vincent Smeets @ 2000-11-15  0:00 UTC (permalink / raw)


Gisle S�lensminde wrote:
> 
> In article <3A1284C8.58C2405D@CCI.de>, Vincent Smeets wrote:
> >Hallo,
> >
> >I'm using GNAT 3.12p. How can I compile and link a program with multiple
> >partitions? What must I do to create the partitions?
> >
> >As an example, I want package A to be a separate partition from the main
> >program B.
> >
> >package A is
> >   procedure P (I : String);
> >end A;
> >
> >with Ada.Text_IO;
> >package body A is
> >   procedure P (I : String) is
> >   begin
> >      Ada.Text_IO.Put_Line (I);
> >   end P;
> >end A;
> >
> >with A;
> >procedure B is
> >begin
> >   A.P ("Testing partitions.");
> >end B:
> 
> I presume you mean compilation unit, and not partition, that means
> something else in Ada95 terminology (Distributed programming)

No, I mean partitions (from appendix E, Distributed programming).


-- Vincent Smeets                 Competence Center Informatik GmbH
-- Tel. : +49-5931-805461         Postfach 1225
-- Fax  : +49-5931-805175         49702 Meppen, Germany
-- EMail: Vincent.Smeets@CCI.de   http://www.CCI.de/
-- PGP fingerprint: 53 1C 3B 6F B6 9A EB 83  B4 7E 25 08 78 BD 5C 2C




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Multiple partitions with GNAT 3.12p
  2000-11-15  0:00   ` Vincent Smeets
@ 2000-11-15  0:00     ` Gisle Sælensminde
  2000-11-16  6:03       ` Vincent Smeets
  0 siblings, 1 reply; 7+ messages in thread
From: Gisle Sælensminde @ 2000-11-15  0:00 UTC (permalink / raw)


In article <3A12AA18.87990C24@CCI.de>, Vincent Smeets wrote:
>Gisle S�lensminde wrote:
>> 
>> I presume you mean compilation unit, and not partition, that means
>> something else in Ada95 terminology (Distributed programming)
>
>No, I mean partitions (from appendix E, Distributed programming).

I'm so sorry.

I made the "hello world" of GLADE, It have a procedure that multiply 
its input by three, and returns it, using
a remote call interface. You must specify the pragma for this.
I used the following program:

package A is
  pragma remote_call_interface;

  function F(I : Integer) return Integer;
end A;

package body A is
   function F(I : Integer) return integer is
   begin
      return 3*I;
   end F;
end A;

with A;
with Ada.Text_IO;

procedure B is
begin
   Ada.Text_IO.Put_line(A.F(3)'img);
end B;



To make a distributed app, I must make a config file, and run gnat on it. 
This file is called b_conf.cfg. "gekko" and "anakonda" are computers on my 
local net. The configuartion as used here requere a .rhost file which is
a security risk. You can configure it to use ssh or start the partitions
manually. 


configuration Bconf is

  pragma Starter (Ada);

  pragma Boot_Location ("tcp", "gekko:5557");

  B_Part : Partition;
  for B_Part'Host use "gekko";

  A_Part : Partition := (A);
  for A_Part'Host use "anakonda";

  procedure B is in B_Part;

end Bconf;


Runing gnatdist I get:

gisle@gekko:218> gnatdist bconf.cfg
gnatdist: checking configuration consistency
 ------------------------------
 ---- Configuration report ----
 ------------------------------
Configuration :
   Name        : bconf
   Main        : b
   Starter     : Ada code
   Protocol    : tcp://gekko:5557

Partition b_part
   Main        : b
   Host        : gekko
   Units       : 
             - b (normal)

Partition a_part
   Host        : anakonda
   Units       : 
             - a (rci)

 -------------------------------
gnatdist:    a caller stubs is up to date
gnatdist:    a receiver stubs is up to date
gnatdist: building partition b_part
gnatdist: building partition a_part
gnatdist: generating starter b
Time: 0:49.88 real   3.010 user   2.060 sys   10.1%
gisle@gekko:219> b
 9
gisle@gekko:220> 


--
Gisle S�lensminde ( gisle@ii.uib.no )   

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going
to land, and it could be dangerous sitting under them as they fly
overhead. (from RFC 1925)




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Multiple partitions with GNAT 3.12p
  2000-11-15  0:00     ` Gisle Sælensminde
@ 2000-11-16  6:03       ` Vincent Smeets
  0 siblings, 0 replies; 7+ messages in thread
From: Vincent Smeets @ 2000-11-16  6:03 UTC (permalink / raw)


Gisle S�lensminde wrote:
> 
> I made the "hello world" of GLADE, It have a procedure that multiply
> its input by three, and returns it, using
> a remote call interface. You must specify the pragma for this.
> I used the following program:

Thanks,

GLADE was the magic word! I have installed it on my machine and found
the answers in that documentation.

Thanks,

-- Vincent Smeets                 Competence Center Informatik GmbH
-- Tel. : +49-5931-805461         Postfach 1225
-- Fax  : +49-5931-805175         49702 Meppen, Germany
-- EMail: Vincent.Smeets@CCI.de   http://www.CCI.de/
-- PGP fingerprint: 53 1C 3B 6F B6 9A EB 83  B4 7E 25 08 78 BD 5C 2C



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Multiple partitions with GNAT 3.12p
  2000-11-15  0:00 ` Gisle Sælensminde
  2000-11-15  0:00   ` Vincent Smeets
@ 2000-11-17  0:00   ` Robert Dewar
  1 sibling, 0 replies; 7+ messages in thread
From: Robert Dewar @ 2000-11-17  0:00 UTC (permalink / raw)


In article <slrn915522.fah.gisle@struts.ii.uib.no>,
  gisle@struts.ii.uib.no (Gisle =?iso-8859-1?Q?S=E6lensminde?=)
wrote:

> I presume you mean compilation unit, and not partition, that
> means something else in Ada95 terminology (Distributed
> programming)

You presumed wrong, just goes to show that you should not
automatically assume people do not mean what they say :-)


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-11-17  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-15  0:00 Multiple partitions with GNAT 3.12p Vincent Smeets
2000-11-15  0:00 ` Gisle Sælensminde
2000-11-15  0:00   ` Vincent Smeets
2000-11-15  0:00     ` Gisle Sælensminde
2000-11-16  6:03       ` Vincent Smeets
2000-11-17  0:00   ` Robert Dewar
2000-11-15  0:00 ` Robert Dewar

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