Fortran makefile problem!

  • Fortran
  • Thread starter Milentije
  • Start date
  • #1
48
0
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

  • #2
595
0
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...
 

Related Threads on Fortran makefile problem!

Replies
9
Views
2K
  • Last Post
Replies
4
Views
788
  • Last Post
2
Replies
34
Views
2K
  • Last Post
Replies
3
Views
5K
Replies
12
Views
643
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
3
Views
13K
Replies
2
Views
6K
  • Last Post
Replies
7
Views
5K
Top