Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

F95 question: non-standard code or gfortran bug?
Given this code:

do i=1,ntrax
write(*,'(10f8.2)')
. ((blobs(track(i)%lpts(j))%rx ,
.   blobs(track(i)%lpts(j))%ry),
.  j=1,track(i)%numpts)
enddo

I get this error with gfortran (cygwin under WinXP Pro):

$ /usr/local/gcc-4_1/bin/gfortran -ffixed-form hough3.f90
In file hough3.f90:257

. ((blobs(track(i)%lpts(j))%rx ,
1
Error: Expected a right parenthesis in expression at (1)

Have I hit a subtle extension of the standard (the code used to
compile on an Alpha UNIX box with F95 compiler) or is gfortran wrong?
Last time I tried a beta version of one of the f95 compilers (can't
remember which now) it also flagged this as an error.  Frankly I can't
see anything wrong myself but I would say that, wouldn't I?

Later: Ah, I think I see what it might be complaining about.
Changing to

do i=1,ntrax
write(*,'(10f8.2)')
. (blobs(track(i)%lpts(j))%rx ,
.  blobs(track(i)%lpts(j))%ry,
.  j=1,track(i)%numpts)
enddo

the error message disappears, but then it seems I have an installation
error:

$ /usr/local/gcc-4_1/bin/gfortran -ffixed-form hough3.f90
/cygdrive/c/DOCUME~1/Ivan/LOCALS~1/Temp/cc5qvAD3.o:hough3.f90:(.text+0x4457)
:
undefined reference to `_sppsv_'
/cygdrive/c/DOCUME~1/Ivan/LOCALS~1/Temp/cc5qvAD3.o:hough3.f90:(.text+0x44f9)
:
undefined reference to `_sgesv_'
collect2: ld returned 1 exit status

The original question still stands.

Relevant declarations (I hope...):
[Full code at http://ireid.home.cern.ch/ireid/hough3.f90 ]

===
module pathdefs
implicit none

integer, parameter:: maxlines=16, maxsegs=32, maxtrax=5000
integer, parameter:: nblobs=2500

type point !Basic unit - centre of a detected grain
integer :: x,y,z  !co-ordinates in pixels/planes
real    :: rx,ry,rz        !co-ordinates in microns
end type

type cluster !Agglomeration of points into a possible track
real    :: vxi(maxsegs),vyi(maxsegs) !individual distances to fit
integer :: lpts(maxsegs) !point numbers
integer :: xt,xb,yt,yb !initial top & bottom coordinates
integer :: numpts !number of points in cluster
real    :: ax,bx,cx,ay,by,cy,vx,vy !quadratic coefficients
logical :: valid !flag that cluster is still being considered
end type

end module pathdefs

program findpath
use pathdefs
implicit NONE

type (point)   :: blobs(nblobs) !Our points
type (cluster) :: track(100) !Our tracks
...

--
Ivan Reid, Electronic & Computer Engineering,     ___     CMS  Collaboration
,
Brunel University.     Ivan.Reid@brunel.ac.uk             Room 40-1-B12, CER
N
KotPT -- "for stupidity above and beyond the call of duty".

Report this thread to moderator Post Follow-up to this message
Old Post
Dr Ivan D. Reid
06-04-05 01:57 AM


Re: F95 question: non-standard code or gfortran bug?
In article <slrnda1lkj.dee.Ivan.Reid@loki.brunel.ac.uk>,
"Dr Ivan D. Reid" <Ivan.Reid@brunel.ac.uk> writes:


I can't help you with the 1st problem.

>
> 	the error message disappears, but then it seems I have an installation
> error:
>
> $ /usr/local/gcc-4_1/bin/gfortran -ffixed-form hough3.f90
> /cygdrive/c/DOCUME~1/Ivan/LOCALS~1/Temp/cc5qvAD3.o:hough3.f90:(.text+0x445
7):
> 	 undefined reference to `_sppsv_'
> /cygdrive/c/DOCUME~1/Ivan/LOCALS~1/Temp/cc5qvAD3.o:hough3.f90:(.text+0x44f
9):
> 	 undefined reference to `_sgesv_'
> collect2: ld returned 1 exit status
>

This looks like you need to give the LAPACK and BLAS libraries
on the command line.  After fixing your (mangled?) implied do-loop,
I can compile your code with

gfortran -o z -ffixed-form hough3.f90 -L/usr/kargl/lib -llapack -lblas


--
Steve
http://troutmask.apl.washington.edu/~kargl/

Report this thread to moderator Post Follow-up to this message
Old Post
Steven G. Kargl
06-04-05 01:57 AM


Re: F95 question: non-standard code or gfortran bug?
On Fri, 3 Jun 2005 22:42:21 +0000 (UTC),
Steven G. Kargl <kargl@troutmask.apl.washington.edu>
wrote in <d7qmcd$4kj$1@gnus01.u.washington.edu>:
> In article <slrnda1lkj.dee.Ivan.Reid@loki.brunel.ac.uk>,
> 	"Dr Ivan D. Reid" <Ivan.Reid@brunel.ac.uk> writes:
 

> This looks like you need to give the LAPACK and BLAS libraries
> on the command line.  After fixing your (mangled?) implied do-loop,
> I can compile your code with

> gfortran -o z -ffixed-form hough3.f90 -L/usr/kargl/lib -llapack -lblas

Thanks, looks like I need to get those libraries now, they didn't
come by default.

--
Ivan Reid, Electronic & Computer Engineering,     ___     CMS  Collaboration
,
Brunel University.     Ivan.Reid@brunel.ac.uk             Room 40-1-B12, CER
N
KotPT -- "for stupidity above and beyond the call of duty".

Report this thread to moderator Post Follow-up to this message
Old Post
Dr Ivan D. Reid
06-04-05 08:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:45 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.