[petsc-dev] syntax error in petscmat.h90/petscvec.h90

Barry Smith bsmith at mcs.anl.gov
Wed Sep 21 20:11:39 CDT 2011


   It is a funny corner case where the token that would take the line up to 72 is the \n to end the line.

   I added a check to not go to the next line if it is a \n causing the continuation. 

   Seems to work. 

   Satish, here is the new bfort.c please update the sowing tarball. (sorry not a nice patch file).

    Thanks

    Barry



[see attached file: bfort.c]
On Sep 20, 2011, at 2:49 AM, Jed Brown wrote:

> On Tue, Sep 20, 2011 at 09:36, Alexander Grayver <agrayver at gfz-potsdam.de> wrote:
> Hello Petsc team,
> 
> Since petsc-3.1-p7 I observe insignificant but annoying syntax error which occurs in petscmat.h90/petscvec.h90 and have to fix it manually when make petsc.
> I use Intel Fortran 11.1 compiler and errors is following:
> 
> /home/lib/petsc-3.2-p2/include/finclude/ftn-auto/petscvec.h90(620): error #5153: Illegal continuation. No valid non_commentary source following &.
> &
> 
> It looks like the line length calculation has an off-by-one error, so it incorrectly puts a continuation when none is needed. Not sure why the compiler chokes on this (does the standard actually disallow it?), but the fix is to fix the line length calculation.
> 
>         subroutine VecGhostUpdateBegin(g, insertmode, scattermode ,ierr)&
>      &
> 
>  
> ------^
> /home/lib/petsc-3.2-p2/include/finclude/ftn-auto/petscvec.h90(621): error #5082: Syntax error, found '=' when expecting one of: ) ,
>       integer(kind=selected_int_kind(10)) g ! integer(kind=selected_int_kind(10))
> -------------------^
> 
> It happens due to this:
> 
>        subroutine VecGhostUpdateBegin(g, insertmode, scattermode ,ierr)&
> & ! <<<<<<<<<<<< ERROR
>       Vec g ! Vec
>       InsertMode insertmode ! InsertMode
>       ScatterMode scattermode ! ScatterMode
>       integer ierr
>       end subroutine
>        subroutine VecGhostUpdateEnd(g, insertmode, scattermode ,ierr)
>       Vec g ! Vec
>       InsertMode insertmode ! InsertMode
>       ScatterMode scattermode ! ScatterMode
>       integer ierr
>       end subroutine
> 
> If I delete & everything is ok. Moreover, I don's see any reason to have it there...
> Is it my specific compiler options or what?
> 
> Regards,
> Alexander
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfort.c
Type: application/octet-stream
Size: 78914 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110921/9beab8b2/attachment.obj>


More information about the petsc-dev mailing list