|
|
Up |
|
|
  |
Author: Ron FordRon Ford Date: Sep 18, 2008 18:37
I downloaded lapack recently and wanted to put a dent in it by calling one
of its subroutines. I hoped to call one that would determine the
eigenvalues of a real matrix, but that doesn't seem to be on the menu. A
person seems to need to put quite a bit of effort to determine exactly what
the subroutines do, and deciphering the titles is one step on that path.
I found SGEHRD.f, where I think the S is single precision, the GE is a
general matrix, the H is Hessenberg and RD might be reduction. So I'll be
hoping to take a eal matrix and use lapack to give me the Hessenberg form,
which, I can then use for bigger and better things.
With the fortran, so far I've got:
implicit none
integer, parameter ::n = 5
integer, dimension(n,n):: a
integer, dimension(n,n):: b
|
| Show full article (4.34Kb) |
|
| | 10 Comments |
|
  |
Author: e p chandlere p chandler Date: Sep 18, 2008 22:03
On Sep 18, 9:37Â pm, Ron Ford wrote:
> I downloaded lapack recently and wanted to put a dent in it by calling one
> of its subroutines. Â I hoped to call one that would determine the
> eigenvalues of a real matrix, but that doesn't seem to be on the menu. Â A
> person seems to need to put quite a bit of effort to determine exactly what
> the subroutines do, and deciphering the titles is one step on that path.
>
> I found SGEHRD.f
[snip]
> I'm hoping to get this done by putting sgehrd.f where I keep the source for
> gfortran. Â I would like to write the caller in f90 or f95 but certainly in
> free form. Â sgehrd.f looks like fixed form f77.
>
> My first question is how do I deal with calling an f77 routine with main
> compiled in contemporary gfortran?
gfortran (like g95) will compile both types of source from the same
command line:
|
| Show full article (2.09Kb) |
|
| | no comments |
|
  |
Author: Ron FordRon Ford Date: Sep 18, 2008 23:25
On Thu, 18 Sep 2008 22:03:46 -0700 (PDT), e p chandler posted:
> A second issue is do you want to compile individual files, adding more
> files until you have exhausted dependencies, OR build the whole
> library? I've had zero luck building large ANYTHING on Windows from
> source, so I add pieces until it works.
I hadn't noticed that there's a half dozen calls to other routines, not all
of which are in the same folder.
EXTERNAL SAXPY, SGEHD2, SGEMM, SLAHR2, SLARFB, STRMM,
$ XERBLA
We'll see if it cascades much farther. I suppose I could put them all in a
module. It would be about 30 megs, 1500 files: yikes. I think I'm finding
out why NAG, for example, makes an f08 version of this.
I'll just keep muddling. Thanks, elliot.
--
It is impossible to imagine Goethe or Beethoven being good at billiards or
golf.
H. L. Mencken
|
| |
| no comments |
|
  |
Author: Ron FordRon Ford Date: Sep 19, 2008 00:09
On Thu, 18 Sep 2008 22:03:46 -0700 (PDT), e p chandler posted:
> A second issue is do you want to compile individual files, adding more
> files until you have exhausted dependencies, OR build the whole
> library? I've had zero luck building large ANYTHING on Windows from
> source, so I add pieces until it works.
I've gone through the files and collected the ones I think I need. It was
nothing short of tedious:
C:\Program Files\University Of Tennessee\LAPACK 3.1.1\src\depend>dir
Volume in drive C has no label.
Volume Serial Number is 486B-CFF3
Directory of C:\Program Files\University Of Tennessee\LAPACK
3.1.1\src\depend
09/19/2008 12:06 AM .
09/19/2008 12:06 AM ..
07/19/2007 11:02 AM 1,496 saxpy.f
07/19/2007 11:02 AM 18,082 slarfb.f
07/19/2007 11:02 AM ...
|
| Show full article (2.12Kb) |
| no comments |
|
  |
Author: michael.caracotsiosmichael.caracotsios Date: Sep 19, 2008 03:01
I prefer to compile LAPACK and create a library. I then, create a
module with interfaces to LAPACK subroutines. For instance I have
created a function for the eigenvalues and eigenvectors of a real or a
real symmetric matrix. So when I want to calculate, say, the
eigenvectors of a real matrix A I type v=eigVectors(A), or if I want
the eigenvectors of a symmetric matrix A I type
v=eigVectors(A,sym="Y"). In this way the cumbersome argument list of
the LAPACK routines does not appear, or have to be used anywhere.
Michael
|
| |
| no comments |
|
  |
Author: JayBeeJayBee Date: Sep 19, 2008 04:13
On 2008-09-19, Ron Ford wrote:
> So, the arguments are well-documented and aren't a whole lot more than what
> I have in my little prog.
> I'm hoping to get this done by putting sgehrd.f where I keep the source for
> gfortran. I would like to write the caller in f90 or f95 but certainly in
> free form. sgehrd.f looks like fixed form f77.
>
> My first question is how do I deal with calling an f77 routine with main
> compiled in contemporary gfortran?
As others explained, that's no problem. Though LAPACK95 is nice in that
it provides explicit interfaces, that among other things helps protect
the programmer from his own fumbling.
--
JayBee
|
| |
| no comments |
|
  |
Author: e p chandlere p chandler Date: Sep 19, 2008 06:16
On Sep 19, 3:09Â am, Ron Ford wrote:
> On Thu, 18 Sep 2008 22:03:46 -0700 (PDT), e p chandler posted:
>
>> A second issue is do you want to compile individual files, adding more
>> files until you have exhausted dependencies, OR build the whole
>> library? I've had zero luck building large ANYTHING on Windows from
>> source, so I add pieces until it works.
>
> I've gone through the files and collected the ones I think I need. Â It was
> nothing short of tedious:
>
> C:\Program Files\University Of Tennessee\LAPACK 3.1.1\src\depend>dir
> Â Volume in drive C has no label.
> Â Volume Serial Number is 486B-CFF3
>
> Â Directory of C:\Program Files\University Of Tennessee\LAPACK
> 3.1.1\src\depend
>
> 09/19/2008 Â 12:06 AM Â Â Â Â Â Â Â .
> 09/19/2008 Â 12:06 AM Â Â Â Â Â Â Â .. ...
|
| Show full article (3.31Kb) |
| no comments |
|
  |
Author: tegteg Date: Sep 19, 2008 07:47
Den Thu, 18 Sep 2008 19:37:28 -0600 skrev Ron Ford:
> I downloaded lapack recently and wanted to put a dent in it by calling
> one of its subroutines. I hoped to call one that would determine the
> eigenvalues of a real matrix, but that doesn't seem to be on the menu.
> A person seems to need to put quite a bit of effort to determine exactly
> what the subroutines do, and deciphering the titles is one step on that
> path.
>
> I found SGEHRD.f, where I think the S is single precision, the GE is a
> general matrix, the H is Hessenberg and RD might be reduction. So I'll
> be hoping to take a eal matrix and use lapack to give me the Hessenberg
> form, which, I can then use for bigger and better things.
>
Hi,
Lapack has both driver routines and expert routines. If you just want to
get started with for example eigenvalue systems then drivers like DGEEV
or DSYEV are a good choice. They will do the transformations to
triangular form and other stuff for you.
|
| Show full article (0.99Kb) |
| no comments |
|
  |
Author: user1user1 Date: Sep 19, 2008 12:22
Ron Ford wrote:
> On Thu, 18 Sep 2008 22:03:46 -0700 (PDT), e p chandler posted:
>
>> A second issue is do you want to compile individual files, adding more
>> files until you have exhausted dependencies, OR build the whole
>> library? I've had zero luck building large ANYTHING on Windows from
>> source, so I add pieces until it works.
>
> I've gone through the files and collected the ones I think I need. It was
> nothing short of tedious:
>
> C:\Program Files\University Of Tennessee\LAPACK 3.1.1\src\depend>dir
> Volume in drive C has no label.
> Volume Serial Number is 486B-CFF3
>
> Directory of C:\Program Files\University Of Tennessee\LAPACK
> 3.1.1\src\depend
>
> 09/19/2008 12:06 AM .
> 09/19/2008 12:06 AM .. ...
|
| Show full article (2.31Kb) |
| no comments |
|
  |
|
|
  |
Author: Ron FordRon Ford Date: Sep 22, 2008 18:34
On Fri, 19 Sep 2008 15:22:51 -0400, user1 posted:
> Ron Ford wrote:
>> I'm sure I left a couple out, which is something my compiler will not
>> likely miss. Given that I've herded the dependencies into this directory,
>> how do I best build this module?
>
>
> Netlib has a nice interface for fetching the driver routine you need
> plus all dependencies - e.g. "dsyev plus dependencies" from
> http://www.netlib.org/lapack/double/
That's a good link. I bookmarked it.
I think I've got the upper hand on it now. I can paste them into a module
that's written in fixed form by Plato III. The IDE handles all the spacing
madness. I added a contains statement and "end subroutine" where Plato
says I need to elaborate on the end statement in this context.
I chose a routine that has no further dependencies, and it compiles:
module routines_from_lapack
contains
SUBROUTINE SAXPY(N,SA,SX,INCX,SY,INCY)
* .. Scalar Arguments ..
REAL SA
INTEGER INCX,INCY,N
* ..
* .. Array Arguments...
|
| Show full article (2.71Kb) |
| no comments |
|
|
|
|