Re: can somebody verify this C program which calls dsaupd_ ? (longish)



Apparently, _Madhusudan Singh_, on 03/04/05 03:10,typed:
First, FORTRAN refers to the language upto and including f77. This newsgroup
discusses all aspects of Fortran, including FORTRAN.

More importantly, if your libraries compiled correctly, they were fine. The
problem would then lie in the C code. And that is not (please do not use
caps - use * * instead to emphasize) relevant to a Fortran newsgroup.

OK. I was under the impression that is how the name is actually written btw.


ARPACK library comes with a very well documented Makefile, which has been
tested by hundreds (if not thousands) of people (including myself). Its
illogical to assume that a untested / not adequately tested C wrapper is
ok, but the Makefiles are not.

It could be true, but it certainly would not be the first thing to suspect.

I compiled two Fortran libs separately. One ARPACK and the other BLAS. Since there are some points to be taken care of (one that I am sure of is the "_" appended by some compilers to Fortran functions), I wasn't sure I had taken care of everything. Moreover, there have been instances where gcc has exhibited incorrect behavior when it's code is optimized(at least till a few years ago, IIRC). For all I know, similar things could be possible in g77. Are you willing to go over the makefiles of each of these libraries that I used and confirm I am on the right track?





If you used the Makefile included in the library (with the correct settings in ARmakes.inc - it would not even compile correctly if those settings were wrong), that is the wrong place to start looking for bugs.

See above.



Test what you wrote first (or whatever is the "weakest" in terms of
testing). If that is sanity checked by some means, only then start casting
the net wider. As a scientist, I am sure you can understand what logical
elimination and sound experimental sequence means.

I am not sure if you read my original post carefuly. The C/C++ code is not what I wrote. I obtained it from the URL I mentioned. The code, when it was written, was running correctly. It's expected output is given in the comments at the top of one of the files (.c or .h). I only made a few minor changes, the changes were only in syntax to get it compiled with the new gcc compiler. (If you really want to find out the modifications, diff is your friend)


So, given this and the reasoning I gave at the top, either the gcc compiler is wrong or the g77 compiler is wrong or my syntax changes are wrong or the way I compiled Fortran libs is wrong.

Now, if you are saying that there is *no* way I could have made a mistake while compiling Fortran libs, then I am sure the problem is in the C code. Of course, this is with the assumption that both compilers do not have any bugs.


Further, as you partially realized when you made the post (assuming you
tested your C code first), it would be better to first ask if someone was
willing to test the code and only then send it to them off group. Posting a
bunch of non-Fortran code and irritating people is not the most polite or
even conducive way to get them to help you.

This is contradictory to you wrote in one of your earlier posts. So lets just not discuss this.



To better understand what I wrote, let me cast the choice in C :

If you were writing a piece of code using the GNU C library, and found
unexpected behaviour, would you test your program first (and say consult
someone on comp.lang.c) or start asking people if your glibc is compiled
correctly ? The GNU C library is a widely used and extremely well-tested
piece of code. Its the wrong thing to suspect first.

I am not questioning the g77 compiler itself mind it. See above.


Annnyy hoooowww .... originally I had assumed it wouldnt' be too hard for anyone who is familiar with programming
1. to copy the two files into a directory,
2. use the two commands I gave (with proper path to Fortran libs)
3. And type "dsaupd" on the command line
4. and report if it worked or not.


Hardly any work. Sigh!

->HS



--
Please remove the underscores ( the '_' symbols) from my email address to obtain the correct one. Apologies, but the fudging is to remove spam.
.




Relevant Pages

  • Re: DFPORT
    ... I work on a Windows XP platform. ... We normally use F77 Fortran and for this one problematic program we ... Since we also have the Intel Fortran compiler, we also had a lot of ... Windows Fortran comper (with appropriate libraries). ...
    (comp.lang.fortran)
  • Re: A question on Newtons Method
    ... >> I can't believe you'd advise a noob to use a compiler which is still ... > production codes and codes from textbooks. ... > The Fortran standard generally does not specify the required behavior ... >> another important class of hassle which most numerical programmers ...
    (sci.math.num-analysis)
  • Re: can somebody verify this C program which calls dsaupd_ ? (longish)
    ... > I compiled two Fortran libs separately. ... One ARPACK and the other BLAS. ... > makefiles of each of these libraries that I used and confirm I am on the ... > with the new gcc compiler. ...
    (sci.math.num-analysis)
  • Fortran Resources (July 2004)
    ... and the standard for the Fortran language and its derivatives. ... WHERE CAN I OBTAIN A FORTRAN 95 COMPILER? ... Absoft Fortran compilers, debuggers, and development tools for Windows, ... are available for Linux systems. ...
    (comp.lang.fortran)
  • Fortran Resources (August 2004)
    ... and the standard for the Fortran language and its derivatives. ... Absoft Fortran compilers, debuggers, and development tools for Windows, ... and Linux include source-compatible Fortran 95 compiler suites ... are available for Linux systems. ...
    (comp.lang.fortran)