comp.lang.ada
 help / color / mirror / Atom feed
From: hreba <f_hreba@yahoo.com.br>
Subject: Re: Example Ada calling Gnu Scientific Library (GSL)
Date: Tue, 4 Apr 2017 23:25:48 +0200
Date: 2017-04-04T23:25:48+02:00	[thread overview]
Message-ID: <ekihasFjum4U1@mid.individual.net> (raw)
In-Reply-To: <obh45r$p0s$1@franka.jacob-sparre.dk>

On 03/29/2017 10:07 PM, Randy Brukardt wrote:
> "hreba" <f_hreba@yahoo.com.br> wrote in message
> news:ek15faF6958U1@mid.individual.net...
>> On 03/29/2017 03:29 AM, Leo Brewin wrote:
>>> Hi Folks,
>>>
>>> I've been following the discussion about the thin bindings to the GSL
>>> library (and thanks to all for the useful information).
>>>
>>
>> Thanks for the example. Nevertheless, I think it is only a first step,
>> because I would prefer an interface to the C library where the client does
>> not have to use the type Interfaces.C.double, or even import Interfaces.
>
> Surely. But the point is that you can use these steps to relatively easily
> make a working thin binding. You then write your intended interface (the
> thick binding) by directly using the thin binding in Ada. That should work
> without stressing the Ada compiler and causing weird failures. (That's how
> the best Ada bindings are built; you have a direct thin binding and then a
> thicker binding that makes the thin binding more appropriate for Ada by
> introducing exceptions, generics, default parameters, sensible Ada naming
> (no camel case!), and so on.)
>
>                                   Randy.
>


Ok, I did this and now I am struggling with the project files. The first 
one handles the thin binding:

library project GSL_Raw is
    for Source_Dirs use ("src");
    for Library_Dir use ".";
    for Library_Name use "gsl_raw";
    for Library_Kind use "static";
    for Externally_Built use "true";
end GSL_Raw;

Directory src contains the output from g++ -c -fdump-ada-spec -C...
There is another directory, obj, which holds the result from
gcc -c -gnat05 ../src/*.ads.

Then there is the project of the thick binding in another directory:

with "GSL_Raw/gsl_raw";
library project GSL is
    for Source_Dirs use ("src");
    for Library_Name use "gsl";
    for Library_Dir use ".";
    for Object_Dir use "obj";
    for Library_Interface use ("gsl");
    for Library_Kind use "static";
    for externally_built use "false";
    package Compiler is
       for Default_Switches ("Ada") use ("-g", "-gnat05");
    end Compiler;
end GSL;

Now when a 3. project, for an executable program, imports project GSL I get:
error: "gsl_gsl_integration_h.ali" not found, 
"gsl_gsl_integration_h.ads" must be compiled

The missing file is present in the directory obj mentioned above, but 
how/where do I specify this?

I included the line

    for Object_Dir use "obj";

in the GSL_Raw project, but to no avail.
-- 
Frank Hrebabetzky		+49 / 6355 / 989 5070


  reply	other threads:[~2017-04-04 21:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29  1:29 Example Ada calling Gnu Scientific Library (GSL) Leo Brewin
2017-03-29  7:01 ` gautier_niouzes
2017-03-29  7:23   ` Dmitry A. Kazakov
2017-03-30 12:39     ` gautier_niouzes
2017-03-30 14:22       ` Dmitry A. Kazakov
2017-03-30 20:44         ` Randy Brukardt
2017-03-31 18:31         ` G.B.
2017-03-31 18:50           ` Dmitry A. Kazakov
2017-03-29  7:19 ` hreba
2017-03-29 20:07   ` Randy Brukardt
2017-04-04 21:25     ` hreba [this message]
2017-04-05 16:29       ` Simon Wright
2017-04-05 20:21         ` hreba
2017-04-06  7:30           ` Simon Wright
2017-04-07 18:45             ` hreba
2017-04-08  8:28               ` Simon Wright
2017-04-09 10:57                 ` hreba
2017-04-09 15:17                   ` Simon Wright
2017-04-10  8:53                     ` hreba
2017-04-10  9:47                       ` Dmitry A. Kazakov
2017-04-10 15:39                         ` hreba
2017-04-10 17:16                           ` Dmitry A. Kazakov
2017-04-10 17:43                           ` Simon Wright
2017-04-10 15:44                       ` Simon Wright
2017-04-11 17:31                         ` hreba
2017-04-11 18:45                           ` Simon Wright
2017-04-11 19:46                             ` Dmitry A. Kazakov
replies disabled

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