Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

problems with makefile

milenko1976
Beginner
777 Views
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,fnode,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 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 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?
0 Kudos
4 Replies
milenko1976
Beginner
777 Views
Mistake:
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
0 Kudos
milenko1976
Beginner
777 Views
I have tried this:
findiff2d.o: findiff2d.f expand.f sort.f stencils2d.f fside.f pass.f fd.par fd.com
$(FC) -c $(FCFLAGS) findiff2d.f -o findiff2d.o
But it is the same.
0 Kudos
Steven_L_Intel1
Employee
777 Views
I don't understand what you are asking for. Can you explain it another way?
0 Kudos
mecej4
Honored Contributor III
777 Views
"What should I change?"

For starters, the way in which you try to describe a problem. I deliberately refrained from replying days ago because I felt that I could make only such a caustic comment, and chose to wait to see if someone else could understand what you wrote.

You describe small disconnected pieces of a problem. The parts of the problem that you have not even mentioned are probably quite important, but we have no idea what they are. The pieces that you did describe are depicted with statements that are either incomprehensible or are obviously false. For example, you asked how to tell "them" to look for 6 subroutines. I understand from that statement that the linker (the incarnation of the anonymous "them") could not build your program because some subroutines could not be found. The preceding sentence conflicts with this conclusion, because it said that the calculations were "not good". Most readers would at this point ask how you could perform any calculations, good or bad, with a program that could not be built. Faced with many instances of such inconsistencies in your problem description, they would move on, seeing how difficult progressing would be.

If English is not your language, you may do better by writing your problem description in your own language, and using software such as that at http://babelfish.yahoo.com/ to translate the description into English, and posting the results here.
0 Kudos
Reply