# Fortran makefile problem!

• Fortran
I have made and compiled a programme,but the calculations are not good,because it has somehow problems with findfiff2d.o file(calulates travel-times on nodes).May be the problem is that findiff2d calls 6 other subroutines.So main=>findiff2d=>expand,sort,pass,stensilcs2d,fnod e,fside.So how to tell them to look for these 6 subroutines?
My makefile:
FC= ifort
LD = ifort
FCFLAGS = -O2 -g
LDFLAGS = $(FCFLAGS) # Executables main: main.o model.o findiff2d.o findnode.o timenearsrc.o readsrc.o fnode.o expand.o fside.o sort.o pass.o stencils2d.o find.o timeinterp.o timeinterp2d.o timelinear.o time1d.o timeb2d.o timec2d.o blkdat.o fd.par fd.com$(FC) $(FCLAGS) -o main main.o model.o findiff2d.o findnode.o timenearsrc.o readsrc.o fnode.o expand.o fside.o sort.o pass.o stencils2d.o find.o timeinterp.o timeinterp2d.o timelinear.o time1d.o timeb2d.o timec2d.o blkdat.o What should I change? ## Answers and Replies Related Programming and Computer Science News on Phys.org Is there a built-in rule for converting fortran source files to .o files? You may need to add one. It's been a long time...ah here, for .c files: %.o : %.c$(CC) $(CFLAGS)$(INCLUDE) \$<

Or else you can make explicit dependencies something like:

main.o: main.c

Or maybe that wasn't actually your question. If it all links and doesn't run correctly perhaps your code is wrong? I guess I need clarification...