Prev: Dhrystone
Next: Learning Ada
From: Ada novice on 26 Jul 2010 10:01 On Jul 26, 1:21 am, Simon Wright <si...(a)pushface.org> 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
From: Dmitry A. Kazakov on 26 Jul 2010 10:52 On Mon, 26 Jul 2010 06:40:49 -0700 (PDT), Ada novice wrote: > On Jul 25, 10:04�pm, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de> > wrote: > >> At some point later when you decide to turn your bindings into a library >> (object/static and/or shared), you could change the IMSL project so that it >> would produce that library. Then it will become compilable. > > Would you be kind enough to elaborate on your above comments a little > more? Project IMSL as written does not describe any entity to build. It does a subcomponent of such an entity, like the test project, which defines an executable. An executable can be built, a component cannot. When bindings are mature and need to be redistributed, deployed, become a part of some large project like Linux distribution with it specific requirements etc, there is a need to pack the bindings code into a pre-built library, static, shared or both. A project that describes such a library is compilable, because a library has to be built. A library would most likely have at least two different projects: 1. compilable "implementation" used by the library developer to build the library from the sources. 2. non-compilable "interface" for library users who use the built library in their projects. They don't need to compile the sources. They will use *.ads, *.ali, *.lib/a files instead. A good thing about Ada and gnatmake/grpbuid is that it is fairly simple to do these things compared with the horrific make/configure. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de
From: sjw on 26 Jul 2010 11:46 On Jul 26, 12:21 am, Simon Wright <si...(a)pushface.org> wrote: > 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! Aha! http://www.cs.colorado.edu/~jessup/lapack/documentation.html .. OK, the subprogram documentation is in the form of UNIX man pages ..
From: Ada novice on 26 Jul 2010 13:08 On Jul 26, 4:52 pm, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de> wrote: > On Mon, 26 Jul 2010 06:40:49 -0700 (PDT), Ada novice wrote: > > Would you be kind enough to elaborate on your above comments a little > > more? > > Project IMSL as written does not describe any entity to build. It does a > subcomponent of such an entity, like the test project, which defines an > executable. An executable can be built, a component cannot. > > When bindings are mature and need to be redistributed, deployed, become a > part of some large project like Linux distribution with it specific > requirements etc, there is a need to pack the bindings code into a > pre-built library, static, shared or both. A project that describes such a > library is compilable, because a library has to be built. A library would > most likely have at least two different projects: > > 1. compilable "implementation" used by the library developer to build the > library from the sources. > > 2. non-compilable "interface" for library users who use the built library > in their projects. They don't need to compile the sources. They will use > *.ads, *.ali, *.lib/a files instead. > > A good thing about Ada and gnatmake/grpbuid is that it is fairly simple to > do these things compared with the horrific make/configure. Thanks. But the library would not be portable to another machine as we need more than the file imslcmath_dll.lib . IMSL runs because it's on my Windows environment path. As an engineer in another field, it's hard to grasp all that you're saying but I hope with time I'll understand better :). Can you recommend books/publications that discuss similar ideas that you have been mentioning? YC
From: Ada novice on 26 Jul 2010 13:14
On Jul 26, 4:52 pm, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de> wrote: - Hide quoted text - - Show quoted text - > On Mon, 26 Jul 2010 06:40:49 -0700 (PDT), Ada novice wrote: > > Would you be kind enough to elaborate on your above comments a little > > more? > Project IMSL as written does not describe any entity to build. It does a > subcomponent of such an entity, like the test project, which defines an > executable. An executable can be built, a component cannot. > When bindings are mature and need to be redistributed, deployed, become a > part of some large project like Linux distribution with it specific > requirements etc, there is a need to pack the bindings code into a > pre-built library, static, shared or both. A project that describes such a > library is compilable, because a library has to be built. A library would > most likely have at least two different projects: > 1. compilable "implementation" used by the library developer to build the > library from the sources. > 2. non-compilable "interface" for library users who use the built library > in their projects. They don't need to compile the sources. They will use > *.ads, *.ali, *.lib/a files instead. > A good thing about Ada and gnatmake/grpbuid is that it is fairly simple to > do these things compared with the horrific make/configure. Thanks. But the library would not be portable to another machine as we need more than the file imslcmath_dll.lib . IMSL runs because it's on my Windows environment path. I hope that I'm understanding you right. As an engineer in another field, it's hard to grasp all that you're saying but I hope with time I'll understand better :). Can you recommend books/publications that discuss similar ideas that you have been mentioning? YC |