comp.lang.ada
 help / color / mirror / Atom feed
* what to use in place of old gnatbl in newer GNAT ?
@ 2012-07-05  0:44 Nasser M. Abbasi
  2012-07-05  8:38 ` Simon Wright
  2012-07-05 10:47 ` Simon Wright
  0 siblings, 2 replies; 6+ messages in thread
From: Nasser M. Abbasi @ 2012-07-05  0:44 UTC (permalink / raw)


I am trying to build some tests for the ada lapack binding that I
obtained from

ftp://ftp.cs.kuleuven.be/pub/Ada-Belgium/mirrors/gnu-ada/OLD/contrib/lapack-ada/

One of the tests (in the folder lapada/test/interf/ after extracting
the above tar file) uses a Makefile which uses an old GNAT command
which is no longer available in newer gnat 2012.

This command is gnatbl as described here

http://www.adahome.com/Resources/Compilers/GNAT-info.html#3

The makefile does this:

------------------
cxbi: cxbi.ali ifinc.o
	gnatbl cxbi.ali ifinc.o $(LIBF)
-------------------

So, I need to replace the above command based on what I
understood gnatbl did. But my attempts to that all are
not working (trying gnatbind/gnatlink, gnatmake, etc...) I
am not sure how to duplicate what the above line is supposed
to be doing.  My $(LIBF) is

LIBF = -lgfortran -lm -static

I am not really familiar with details of these commands. I only use
gnatmake.

I was wondering if someone knows what is the correct sequence of
gnat 2012 commands to replace gnatbl with? Or better, is there a way
to download gnatbl to use with gnat 2012? I googled and not able
to find one.

thanks,
--Nasser



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

* Re: what to use in place of old gnatbl in newer GNAT ?
  2012-07-05  0:44 what to use in place of old gnatbl in newer GNAT ? Nasser M. Abbasi
@ 2012-07-05  8:38 ` Simon Wright
  2012-07-05 10:47 ` Simon Wright
  1 sibling, 0 replies; 6+ messages in thread
From: Simon Wright @ 2012-07-05  8:38 UTC (permalink / raw)


"Nasser M. Abbasi" <nma@12000.org> writes:

> I am trying to build some tests for the ada lapack binding that I
> obtained from
>
> ftp://ftp.cs.kuleuven.be/pub/Ada-Belgium/mirrors/gnu-ada/OLD/contrib/lapack-ada/
>
> One of the tests (in the folder lapada/test/interf/ after extracting
> the above tar file) uses a Makefile which uses an old GNAT command
> which is no longer available in newer gnat 2012.
>
> This command is gnatbl as described here
>
> http://www.adahome.com/Resources/Compilers/GNAT-info.html#3
>
> The makefile does this:
>
> ------------------
> cxbi: cxbi.ali ifinc.o
> 	gnatbl cxbi.ali ifinc.o $(LIBF)
> -------------------
>
> So, I need to replace the above command based on what I
> understood gnatbl did. But my attempts to that all are
> not working (trying gnatbind/gnatlink, gnatmake, etc...) I
> am not sure how to duplicate what the above line is supposed
> to be doing.  My $(LIBF) is
>
> LIBF = -lgfortran -lm -static
>
> I am not really familiar with details of these commands. I only use
> gnatmake.

Does the EXAMPLES section of
http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/u_man/cat1/gnatbl.z help?



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

* Re: what to use in place of old gnatbl in newer GNAT ?
  2012-07-05  0:44 what to use in place of old gnatbl in newer GNAT ? Nasser M. Abbasi
  2012-07-05  8:38 ` Simon Wright
@ 2012-07-05 10:47 ` Simon Wright
  2012-07-05 11:39   ` Nasser M. Abbasi
  2012-07-05 11:41   ` Simon Wright
  1 sibling, 2 replies; 6+ messages in thread
From: Simon Wright @ 2012-07-05 10:47 UTC (permalink / raw)


"Nasser M. Abbasi" <nma@12000.org> writes:

> I am trying to build some tests for the ada lapack binding that I
> obtained from
>
> ftp://ftp.cs.kuleuven.be/pub/Ada-Belgium/mirrors/gnu-ada/OLD/contrib/lapack-ada/
>
> One of the tests (in the folder lapada/test/interf/ after extracting
> the above tar file) uses a Makefile which uses an old GNAT command
> which is no longer available in newer gnat 2012.
>
> This command is gnatbl as described here
>
> http://www.adahome.com/Resources/Compilers/GNAT-info.html#3
>
> The makefile does this:
>
> ------------------
> cxbi: cxbi.ali ifinc.o
> 	gnatbl cxbi.ali ifinc.o $(LIBF)
> -------------------
>
> So, I need to replace the above command based on what I
> understood gnatbl did. But my attempts to that all are
> not working (trying gnatbind/gnatlink, gnatmake, etc...) I
> am not sure how to duplicate what the above line is supposed
> to be doing.  My $(LIBF) is
>
> LIBF = -lgfortran -lm -static
>
> I am not really familiar with details of these commands. I only use
> gnatmake.
>
> I was wondering if someone knows what is the correct sequence of
> gnat 2012 commands to replace gnatbl with? Or better, is there a way
> to download gnatbl to use with gnat 2012? I googled and not able
> to find one.

I would use gnatmake!

cxbi: cxbi.adb ifinc.o
      gnatmake cxbi.adb -largs ifinc.o -lgfortran

or if you prefer

cxbi: cxbi.adb ifinc.o
      gnatmake cxbi.adb =static -largs ifinc.o -lgfortran -lm

However, neither seems to work! With GCC:

Target: x86_64-apple-darwin11
Configured with: ../gcc-4.7.0/configure --prefix=/opt/gcc-4.7.0 --disable-bootstrap --disable-multilib --enable-languages=c,ada,fortran,c++ --build=x86_64-apple-darwin11
Thread model: posix
gcc version 4.7.0 (GCC) 

I get

$ ./cxbi 
Integer number passing:
mode: in out in/out
Ada send:
          1          1          1
 Fortran get:
           1           1           1
 Fortran send:
           2           2           2
Ada recieve:
          1          2          2
Ada send:
         -1         -1         -1
 Fortran get:
          -1          -1          -1
 Fortran send:
           0           0           0
Ada recieve:
         -1          0          0




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

* Re: what to use in place of old gnatbl in newer GNAT ?
  2012-07-05 10:47 ` Simon Wright
@ 2012-07-05 11:39   ` Nasser M. Abbasi
  2012-07-05 11:41   ` Simon Wright
  1 sibling, 0 replies; 6+ messages in thread
From: Nasser M. Abbasi @ 2012-07-05 11:39 UTC (permalink / raw)


On 7/5/2012 5:47 AM, Simon Wright wrote:

>
> I would use gnatmake!
>
> cxbi: cxbi.adb ifinc.o
>        gnatmake cxbi.adb -largs ifinc.o -lgfortran
>
> or if you prefer
>
> cxbi: cxbi.adb ifinc.o
>        gnatmake cxbi.adb =static -largs ifinc.o -lgfortran -lm
>

Thanks Simon!, yes this did it.

> However, neither seems to work! With GCC:
>
> Target: x86_64-apple-darwin11
<snip>
> gcc version 4.7.0 (GCC)
>
> I get
>
> $ ./cxbi
> Integer number passing:
> mode: in out in/out
> Ada send:
>            1          1          1
>   Fortran get:
>             1           1           1
>   Fortran send:
>             2           2           2
> Ada recieve:
>            1          2          2
> Ada send:
>           -1         -1         -1
>   Fortran get:
>            -1          -1          -1
>   Fortran send:
>             0           0           0
> Ada recieve:
>           -1          0          0
>

Yes, I got now the same result from the above one test. I am using
gfortran 5.6 and gnat 2012 on Linux.  But at least now it is possible
to build these tests, so now will be able to see what is the
problem. This lapack binding is _very_ old. It might have
bugs in it. It is also not complete, the lapada/test/interf/README
file mentions some issues not fixed at the end.

But at least one can build Ada program to call Lapack 77 function now.

I working on documenting all these things, and making
notes of all the changes made. When all is done, will make
a new tar file of the binding with the fixes (Assuming I can
fix the problems :)

-------------------------------------
>echo $LD_LIBRARY_PATH
/usr/lib/i386-linux-gnu/:/usr/lib/atlas-base/:/usr/lib/atlas-base/atlas/

>gnatmake -v
GNATMAKE GPL 2012 (20120509)

>gfortran -v
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

>gnatmake cxbi.adb -largs ifinc.o -lgfortran -lm
gnatbind -x cxbi.ali
gnatlink cxbi.ali ifinc.o -lgfortran -lm

>./cxbi
Integer number passing:
mode: in out in/out
Ada send:
           1          1          1
  Fortran get:
            1           1           1
  Fortran send:
            2           2           2
Ada recieve:
           1          2          2
Ada send:
          -1         -1         -1
  Fortran get:
           -1          -1          -1
  Fortran send:
            0           0           0
Ada recieve:
          -1          0          0
>
-------------------------------


thanks again Simon for your help.

--Nasser



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

* Re: what to use in place of old gnatbl in newer GNAT ?
  2012-07-05 10:47 ` Simon Wright
  2012-07-05 11:39   ` Nasser M. Abbasi
@ 2012-07-05 11:41   ` Simon Wright
  2012-07-05 12:02     ` Nasser M. Abbasi
  1 sibling, 1 reply; 6+ messages in thread
From: Simon Wright @ 2012-07-05 11:41 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> However, neither seems to work!

> I get
>
> $ ./cxbi 
> Integer number passing:
> mode: in out in/out
> Ada send:
>           1          1          1
>  Fortran get:
>            1           1           1
>  Fortran send:
>            2           2           2
> Ada recieve:
>           1          2          2
> Ada send:
>          -1         -1         -1
>  Fortran get:
>           -1          -1          -1
>  Fortran send:
>            0           0           0
> Ada recieve:
>          -1          0          0

Actually, aside from the spelling, this is correct; the first number is
passed by Ada as mode in, so the fact that the Fortran changes it has no
effect on the value seen by Ada after the call.



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

* Re: what to use in place of old gnatbl in newer GNAT ?
  2012-07-05 11:41   ` Simon Wright
@ 2012-07-05 12:02     ` Nasser M. Abbasi
  0 siblings, 0 replies; 6+ messages in thread
From: Nasser M. Abbasi @ 2012-07-05 12:02 UTC (permalink / raw)


On 7/5/2012 6:41 AM, Simon Wright wrote:
> Simon Wright <simon@pushface.org> writes:


> Actually, aside from the spelling, this is correct; the first number is
> passed by Ada as mode in, so the fact that the Fortran changes it has no
> effect on the value seen by Ada after the call.
>

fyi;

I put the log file of the result of all the Lapack-Ada interface
tests here

http://12000.org/my_notes/ada/ada_lapack_interface_tests.txt

I removed 2 tests from the Makefile which do not build.

The above using GNAT 2012 on linux, with Lapack 77 binding.
Will do full documenations later once I get to look
more into this.

--Nasser





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

end of thread, other threads:[~2012-07-05 12:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-05  0:44 what to use in place of old gnatbl in newer GNAT ? Nasser M. Abbasi
2012-07-05  8:38 ` Simon Wright
2012-07-05 10:47 ` Simon Wright
2012-07-05 11:39   ` Nasser M. Abbasi
2012-07-05 11:41   ` Simon Wright
2012-07-05 12:02     ` Nasser M. Abbasi

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