From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,6b26adc021beff24 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!fdn.fr!gegeweb.org!aioe.org!nospam From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: Ada binding to GMP and MPFR Date: Thu, 28 May 2009 20:30:34 -0400 Organization: The Wasteland Message-ID: References: <72dd0e4d-1378-4cca-a72f-637f83f21686@e20g2000vbc.googlegroups.com> <4deb49a5-6d19-49dd-a7a8-ceed7adcb661@r3g2000vbp.googlegroups.com> <9fb53bdb-eb6a-4f59-8e8f-988071c07b5e@u9g2000pre.googlegroups.com> <0d5120bf-7581-4d4b-bdb4-e9d758e3a963@z5g2000yqn.googlegroups.com> NNTP-Posting-Host: ib4TTflHUauJidfWP/+Rjw.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.7.9 Cancel-Lock: sha1:Ats1zCLgk7eQ6W9CA1PIqh89W+Y= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Xref: g2news2.google.com comp.lang.ada:6093 Date: 2009-05-28T20:30:34-04:00 List-Id: In article , "vincent.diemunsch@gmail.com" wrote: > On 28 mai, 21:41, "John B. Matthews" wrote: > > In article > > , > > > >  "vincent.diemun...@gmail.com" wrote: > > > > [...] > > > > > > > > > I have now added the files in the svn source tree ! > > > > It's visible now. > > > > > I will add a little comment for Mac OS X users. > > > > Excellent! > > > > > I still have a little trouble in my sample program for the > > > "translation" of the C sample program, with the function mpfr_out_str > > > BUT I find the example of the Thick Ada Binding quite convincing : > > > > Looks good. I saw only two anomalies: > > > > 1) In mpfr_example.adb, line 75 should perhaps invoke New_Line, rather > > than Skip_Line. > > > > 2) Inmpfr.ads, line 686, I had to specify a different external name: > > > >    pragma Import (C, mpfr_out_str, "__gmpfr_out_str"); [...] > Thanks John for your help ! ;-) > I have corrected the sources and added some little improvements. Looks good. Thank you for your fine binding. Here is a simple Makefile I've been using; feel free to adapt it to your project: TARG = mpfr_example CARGS = -cargs -O2 BARGS = -bargs -shared LARGS = -largs -dead_strip -lmpfr -lgmp UNAME = $(shell uname) GCCV = $(shell gcc -dumpversion) .SUFFIXES: .PHONY: clean cleaner debug run $(TARG): $(TARG).ad[bs] @echo $(UNAME): gcc $(GCCV) gnatmake $(TARG) $(CARGS) $(BARGS) $(LARGS) debug: $(TARG).ad[bs] gnatmake -g $(TARG) $(LARGS) run:$(TARG) ./$(TARG) clean: rm -f *.o *.ali b~* core cleaner: clean rm -f *.s $(TARG) [Note, make requires tab for indent.] -- John B. Matthews trashgod at gmail dot com