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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c1bdceb867926fdb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z10g2000yqb.googlegroups.com!not-for-mail From: Ada novice Newsgroups: comp.lang.ada Subject: Re: Interfacing Ada with C Date: Mon, 26 Jul 2010 07:01:27 -0700 (PDT) Organization: http://groups.google.com Message-ID: <604b2eed-c351-4fa5-95e4-9e2ec714b694@z10g2000yqb.googlegroups.com> References: <0ee9eec7-6024-4fb8-8df0-f65c146e4b84@i28g2000yqa.googlegroups.com> <143ef70b-7e74-426b-a621-a5fd157849be@x21g2000yqa.googlegroups.com> NNTP-Posting-Host: 193.11.22.91 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1280152887 24571 127.0.0.1 (26 Jul 2010 14:01:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 26 Jul 2010 14:01:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z10g2000yqb.googlegroups.com; posting-host=193.11.22.91; posting-account=Rr9I-QoAAACS-nOzpA-mGxtAlZ46Nb6I User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:12577 Date: 2010-07-26T07:01:27-07:00 List-Id: On Jul 26, 1:21 am, Simon Wright wrote: > I've encoded a general complex eigenvalues function, interfacing to the > LAPACK procedure zgeev, starting from a demo athttp://www.physics.oregonstate.edu/~rubin/nacphy/lapack/codes/eigen-c... > & copying bits and pieces from within the GNAT implementation of > Ada.Numerics.Generic_Complex_Arrays. > Find it athttp://public.me.com/simon.j.wright(folder numerics). Thank you very much for your commendable efforts. This is a very good example to demonstrate how Ada can be binded with LAPACK. >(b) the results > are the same with GNAT GPL 2010 and GCC 4.5.0, (c) the output looks good > (from your inputs) .. > $ ./test_zgeev > 2.00000000000000E+00 4.00000000000000E+00 > 2.00000000000000E+00 -4.00000000000000E+00 > 9.99999999999996E-01 2.07319734774360E-16 I have Win XP and gcc (GCC) 4.3.6 20100603 for GNAT GPL 2010 (20100603). I get slightly different output: 1.99999999999999E+00 3.99999999999999E+00 2.00000000000000E+00 -4.00000000000000E+00 1.00000000000000E+00 -3.45920620709768E-16 Your GCC version is more recent than mine. Maybe this is causing the discrepancies or maybe it's because of your different OS. Did you install your GCC separately? I got mine bundled with the GNAT GPL 2010. >I get the strong impression that to know what the arguments of the BLAS >& LAPACK subprograms are you have to buy the book or read the code! On a side note, there's this book: Handbook for Automatic Computation: Volume 2: Linear Algebra (Grundlehren der mathematischen Wissenschaften) by John H. Wilkinson, C. Reinsch, Alston S. Householder, and Friedrich L. B which has lots of test matrix cases to check whether algorithms are performing correctly. > This all worked without any need for additional link-time arguments on > Mac OS X, but YMMV on Windows. If not, I *think* that if you with > Ada.Numerics.Long_Complex_Arrays (no need to use anything from it) that > would be enough to bring in the necessary libraries. It works fine on Windows too without anything to add. And I get the same compilation warnings. YC