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: Sun, 9 Apr 2017 12:57:25 +0200
Date: 2017-04-09T12:57:25+02:00	[thread overview]
Message-ID: <ekuiclF163U1@mid.individual.net> (raw)
In-Reply-To: <ly60if8fry.fsf@pushface.org>

On 04/08/2017 10:28 AM, Simon Wright wrote:
> hreba <f_hreba@yahoo.com.br> writes:
>
>> The missing function is declared in src/gsl_gsl_integration_h.ads as
>>
>>    function gsl_integration_qng
>>      (f : access constant gsl_gsl_math_h.gsl_function;
>>       a : double;
>>       b : double;
>>       epsabs : double;
>>       epsrel : double;
>>       result : access double;
>>       abserr : access double;
>>       neval : access stddef_h.size_t) return int;
>>    pragma Import (C, gsl_integration_qng, "gsl_integration_qng");
>
> What the pragma Import says is that gsl_integration_qng is imported from
> some place else, presumably the C library you've asked gcc to generate a
> skinny binding to.
>
> Here, gsl 2.3, the symbol is in libgsl.
>
>   nm -Aa libgl.a | grep gsl_integration_qng
>
> says
>
>   libgsl.a:qng.o: 00000000000000c0 T _gsl_integration_qng
>
> I don't think the leading underscore is your problem, GNAT knows when
> the platform (macOS here) needs the leading underscore.
>

My directory structure is

└── Num                                    <-- thick bindings
     ├── gsl.gpr
     ├── GSL_Raw                            <-- thin bindings
     │   ├── gsl_raw.gpr
     │   ├── lib
     │   │   ├── alloca_h.ali
     │   │   ├── gsl_gsl_integration_h.ali
             ...
     │   ├── obj
     │   │   ├── alloca_h.ali
     │   │   ├── alloca_h.o
             ...
     │   ├── readme.txt
     │   └── src
     │       ├── alloca_h.ads
     │       ├── gsl_gsl_integration_h.ads
             ...
     ├── lib
     │   ├── gsl.ali
     │   └── libgsl.a
     ├── num.gpr
     ├── obj
     │   ├── auto.cgpr
     │   ├── b__gsl.adb
         ...
     ├── src
     │   ├── gsl.adb
     │   ├── gsl.ads
     │   ├── numfunc.adb
     │   └── numfunc.ads
     ...

So, sitting in directory Num:

nm -Aa GSL_Raw/lib/libgsl_raw.a | grep gsl_integration_qng
says nothing.
nm -Aa lib/libgsl.a | grep gsl_integration_qng
says nothing
nm -Aa /usr/lib/libgsl.a | grep gsl_integration_qng
says /usr/lib/libgsl.a:qng.o:0000000000000000 T gsl_integration_qng

> I hate to ask this, but have you actually linked with -lgsl?
>
Where, how? I have 3 project files now:
1. in Num/GSL_Raw for the thin binding
2. in Num for the thick binding
3. in the directory of my test program
To the first one using your suggestion on 04/05/2017, I added:

    package Builder is
       for Default_Switches ("C") use ("-lgsl");
    end Builder;

but it didn't help. (Sigh)
-- 
Frank Hrebabetzky		+49 / 6355 / 989 5070

  reply	other threads:[~2017-04-09 10:57 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
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 [this message]
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