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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.50.142.33 with SMTP id rt1mr20701740igb.7.1419909894068; Mon, 29 Dec 2014 19:24:54 -0800 (PST) X-Received: by 10.50.66.141 with SMTP id f13mr424713igt.17.1419909893980; Mon, 29 Dec 2014 19:24:53 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h15no19011798igd.0!news-out.google.com!qk8ni6425igc.0!nntp.google.com!h15no19011792igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 29 Dec 2014 19:24:53 -0800 (PST) In-Reply-To: <85ioguu7zw.fsf@stephe-leake.org> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.117.194.10; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG NNTP-Posting-Host: 97.117.194.10 References: <74a567c4-eb60-4bc1-b03a-4c3a7be7676f@googlegroups.com> <0880c93b-81ff-4aaf-ae3b-91d82f76a23f@googlegroups.com> <85ioguu7zw.fsf@stephe-leake.org> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Help linking to Octave (mathematical) functions From: Jerry Injection-Date: Tue, 30 Dec 2014 03:24:53 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:24283 Date: 2014-12-29T19:24:53-08:00 List-Id: On Monday, December 29, 2014 2:21:09 AM UTC-7, Stephen Leake wrote: > Jerry writes: >=20 > >> Despite the documentation said it is like "shared library or shared=20 > >> object", it is referring to Octave itself "An oct-file is a dynamical= =20 > >> extension of the Octave interpreter". > >> On MacOS, even with GNAT, at the end, all object files are loaded by l= d=20 > >> but I haven't seen that oct files are supported by ld. > > > > That's not good. I wonder if the internal structure of an oct file is > > similar to other files known by ld. I suppose this is a question for > > the Octave developer list. >=20 > Yes. Or a Mac list; the problem seems to be with the "bundle" stuff. Yes. I hope to get back to this soon, one way or another. >=20 > Can you try this on a Linux distribution? Not easily. I don't have Linux installed on my Mac. But I see what you're g= etting at--the bundle stuff might be a Mac anomaly; I've seen MH_BUNDLE dis= cussed on other lists but mostly it goes over my head. >=20 >=20 > Since this is all open source, you could try compiling the bessel > library from source using GNAT, and either creating a more standard > library or just include it in your main project. I hadn't thought of that. Seems reasonable and obvious now that you mention= it. OTOH the Numerical Recipes book has a very quick solution based on Abr= amowitz & Stegun. >=20 >=20 > Another option is to link the Octave interpreter to the Ada program, and > then tell it to load the oct-file. >=20 > There may be an Octave library that lets you do this, hopefully with an > Ada binding available. Not sure how that would proceed. But for an earlier case where I needed a b= it of Octave in an Ada program I did a hilariously crude thing: I had the A= da program write out the Octave source script to a text file then called Oc= tave with pragma Import(C, system) (not sure why I didn't use GNAT.OS_Lib.S= pawn), had Octave write out the answer to a new text file, and read that te= xt file with the Ada program. A tad slow I would surmise but I then needed = only one call to Octave. Jerry >=20 > --=20 > -- Stephe