Svetlana Tkachenko <[email protected]> writes: > On Thu, 7 Nov 2013, at 10:22, Jed Brown wrote: >> Svetlana Tkachenko <[email protected]> writes: >> > Right. I have spent half of an hour now trying to imagine what to do >> > to link trying everything like a headless chicken and it did not >> > work. >> >> You always have to send the error message. >> >> > I would appreciate if you could come up with something that links, not >> > just runs a single program. >> >> The makefiles we suggested link a program of the same name as the source >> file. Do you have multiple source files? You only have to edit the one >> line and run "make". >> >> program: several.o object.o files.o >> ${CLINKER} -o $@ $^ ${PETSC_LIB} >> >> include ${PETSC_DIR}/conf/variables >> include ${PETSC_DIR}/conf/rules >> Email had 1 attachment: >> + Attachment2 >> 1k (application/pgp-signature) > > ~/dev/test/petsc $ cat makefile > myexample: myexample.o solver.o > ${CLINKER} -o $@ $^ ${PETSC_LIB} > > include ${PETSC_DIR}/conf/variables > include ${PETSC_DIR}/conf/rules > ~/dev/test/petsc $ cat solver.f > subroutine solver() > #include <finclude/petscsys.h>
Name your source file solver.F so that the Fortran compiler preprocesses it. (Or add the option -cpp, but that is more confusing and less portable, so rename the source file.)
pgpXoN197wB7v.pgp
Description: PGP signature
