<div dir="ltr">Thank you so much. Now it works! Thanks again!<div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 13, 2019 at 10:10 PM Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
  Put the use petscksp starting in column 7 of the file<br>
<br>
<br>
<br>
> On Mar 13, 2019, at 9:05 PM, Maahi Talukder via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br>
> <br>
> Hi, <br>
> <br>
> Thank you all for your suggestions. I made the changes as suggested.  But now I get the following error-<br>
> .................................................................................................................................<br>
> [maahi@CB272PP-THINK1 egrid2d]$ make egrid2d<br>
> /home/maahi/petsc/arch-linux2-c-debug/bin/mpif90 -Wall -ffree-line-length-0 -Wno-unused-dummy-argument -g  -I/home/maahi/petsc/include -I/home/maahi/petsc/arch-linux2-c-debug/include -Ofast -fdefault-real-8 -c -I/home/maahi/petsc/include -I/home/maahi/petsc/arch-linux2-c-debug/include -Ofast -fdefault-real-8 main.F  -Wl,-rpath,/home/maahi/petsc/arch-linux2-c-debug/lib -L/home/maahi/petsc/arch-linux2-c-debug/lib -Wl,-rpath,/home/maahi/petsc/arch-linux2-c-debug/lib -L/home/maahi/petsc/arch-linux2-c-debug/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/7 -L/usr/lib/gcc/x86_64-redhat-linux/7 -lpetsc -lflapack -lfblas -lm -lpthread -lstdc++ -ldl -lmpifort -lmpi -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lstdc++ -ldl <br>
> main.F:6:1:<br>
> <br>
>  use petscksp<br>
>  1<br>
> Error: Non-numeric character in statement label at (1)<br>
> main.F:6:1:<br>
> <br>
>  use petscksp<br>
>  1<br>
> Error: Unclassifiable statement at (1)<br>
> make: *** [makefile:28: main.o] Error 1<br>
> <br>
> .............................................................................<br>
> Any idea how to fix that?<br>
> <br>
> Thanks,<br>
> Maahi Talukder<br>
> <br>
> <br>
> On Wed, Mar 13, 2019 at 8:44 PM Balay, Satish <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br>
> check petsc makefile format - for ex: src/tao/unconstrained/examples/tutorials/makefile<br>
> <br>
> Also rename your fortran sources that have petsc calls from .f to .F<br>
> <br>
> <br>
> On Wed, 13 Mar 2019, Matthew Knepley via petsc-users wrote:<br>
> <br>
> > On Wed, Mar 13, 2019 at 7:36 PM Maahi Talukder via petsc-users <<br>
> > <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br>
> > <br>
> > > Dear All,<br>
> > ><br>
> > > I am trying to compile a Fortran code. The make is as it follows-<br>
> > ><br>
> > ><br>
> > > ............................................................................................................................................................................................................................<br>
> > > # Makefile for egrid2d<br>
> > ><br>
> > > OBJS = main.o egrid2d.o<br>
> > ><br>
> > > FFLAGS = -I/home/maahi/petsc/include<br>
> > > -I/home/maahi/petsc/arch-linux2-c-debug/include -Ofast -fdefault-real-8<br>
> > ><br>
> > > #<br>
> > > # link<br>
> > > #<br>
> > > include ${PETSC_DIR}/lib/petsc/conf/variables<br>
> > > include ${PETSC_DIR}/lib/petsc/conf/rules<br>
> > ><br>
> > > egrid2d: $(OBJS)<br>
> > ><br>
> > > ${FLINKER}  $(OBJS)  -o egrid2d ${PETSC_LIB}<br>
> > ><br>
> > <br>
> > Move this above your includes<br>
> > <br>
> The location is fine. Can you change OBJS to a different name - say OBJ [or something else] and see if that works.<br>
> <br>
> Satish<br>
> <br>
> > <br>
> > ><br>
> > > #<br>
> > > # compile<br>
> > > #<br>
> > > main.o:<br>
> > >    ${FLINKER} -c $(FFLAGS) main.f  ${PETSC_LIB}<br>
> > ><br>
> > <br>
> > You should not need this rule.<br>
> > <br>
> >   Thanks,<br>
> > <br>
> >     Matt<br>
> > <br>
> > <br>
> > > #<br>
> > > # Common and Parameter Dependencies<br>
> > > #<br>
> > ><br>
> > > main.o:        main.f        par2d.f<br>
> > > egrid2d.o:     egrid2d.f     par2d.f<br>
> > ><br>
> > > .....................................................................................................................................................................................................................................<br>
> > ><br>
> > > But I get the following error-<br>
> > ><br>
> > ><br>
> > > ..............................................................................................................................................................................<br>
> > > /home/maahi/petsc/arch-linux2-c-debug/bin/mpif90 -Wall<br>
> > > -ffree-line-length-0 -Wno-unused-dummy-argument -g<br>
> > > -I/home/maahi/petsc/include -I/home/maahi/petsc/arch-linux2-c-debug/include<br>
> > > -Ofast -fdefault-real-8      -o egrid2d<br>
> > > -Wl,-rpath,/home/maahi/petsc/arch-linux2-c-debug/lib<br>
> > > -L/home/maahi/petsc/arch-linux2-c-debug/lib<br>
> > > -Wl,-rpath,/home/maahi/petsc/arch-linux2-c-debug/lib<br>
> > > -L/home/maahi/petsc/arch-linux2-c-debug/lib<br>
> > > -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/7<br>
> > > -L/usr/lib/gcc/x86_64-redhat-linux/7 -lpetsc -lflapack -lfblas -lm<br>
> > > -lpthread -lstdc++ -ldl -lmpifort -lmpi -lgfortran -lm -lgfortran -lm<br>
> > > -lgcc_s -lquadmath -lstdc++ -ldl<br>
> > > /*usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o: In function<br>
> > > `_start':*<br>
> > > *(.text+0x20): undefined reference to `main'*<br>
> > > collect2: error: ld returned 1 exit status<br>
> > > make: *** [makefile:18: egrid2d] Error 1<br>
> > ><br>
> > > ........................................................................................................................................<br>
> > ><br>
> > > Any idea how to fix it ?<br>
> > ><br>
> > > Thanks,<br>
> > > Maahi Talukder<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > <br>
> > <br>
> <br>
<br>
</blockquote></div>