[petsc-dev] openmp
Svetlana Tkachenko
svetlana.tkachenko at fastmail.fm
Wed Nov 6 21:26:16 CST 2013
On Thu, 7 Nov 2013, at 13:51, Jed Brown wrote:
> Svetlana Tkachenko <svetlana.tkachenko at fastmail.fm> writes:
>
> > On Thu, 7 Nov 2013, at 12:56, Jed Brown wrote:
> >> Svetlana Tkachenko <svetlana.tkachenko at fastmail.fm> writes:
> >>
> >> > ~/dev/test/petsc $ mv solver.f solver.F
> >> > ~/dev/test/petsc $ make
> >> > gfortran -c -fPIC -Wall -Wno-unused-variable -g -fopenmp -I/home/<username>/petsc/include -I/home/<username>/petsc/linux-amd64/include -I/home/<username>/petsc/include/mpiuni -o solver.o solver.F
> >> > solver.F:8.46:
> >> >
> >> > if (ierr .ne. 0) call MPI_Abort(PETSC_COMM_WORLD,ierr,ierr
> >> > 1
> >> > Error: Missing ')' in statement at or before (1)
> >>
> >> You indented so far that the expanded macro spilled over the
> >> 72-character line length needed to fit on a punch card in the 1950s. If
> >> you would like to modernize your Fortran dialect beyond the constraints
> >> of punch cards, you could consider naming your file .F90 or adding the
> >> option -ffree-form, perhaps also with -ffree-line-length-none.
> >> Email had 1 attachment:
> >> + Attachment2
> >> 1k (application/pgp-signature)
> >
> > Thank you for the advice.
> > I've named both files .F90 and now that's what it's got.
> >
> > ~/dev/test/petsc $ ls
> > makefile myexample.F90 solver.F90
> > ~/dev/test/petsc $ make
> > gfortran -c -fPIC -Wall -Wno-unused-variable -g -fopenmp -I/home/<username>/petsc/include -I/home/<username>/petsc/linux-amd64/include -I/home/<username>/petsc/include/mpiuni -o myexample.o myexample.F90
> > gfortran -c -fPIC -Wall -Wno-unused-variable -g -fopenmp -I/home/<username>/petsc/include -I/home/<username>/petsc/linux-amd64/include -I/home/<username>/petsc/include/mpiuni -o solver.o solver.F90
> > gcc -fopenmp -fopenmp -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -fno-inline -O0 -fopenmp -o myexample myexample.o solver.o -Wl,-rpath,/home/<username>/petsc/linux-amd64/lib -L/home/<username>/petsc/linux-amd64/lib -lpetsc -Wl,-rpath,/home/<username>/petsc/linux-amd64/lib -lflapack -lfblas -lX11 -lpthread -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -lgfortran -lm -lm -lstdc++ -lstdc++ -ldl -lgcc_s -ldl
> > /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o: In function `_start':
> > (.text+0x20): undefined reference to `main'
>
> What do you expect? Your file only contains a subroutine, no "program".
What do you mean? (I don't think the program name has to be 'main'.).
~/dev/test/petsc $ cat myexample.F90
program myexample
call solver
end
~/dev/test/petsc $
More information about the petsc-dev
mailing list