Circular dependency dropped

Circular dependency dropped

Again I have this problem.Trying to compile one program,changed it slightly but I get this:
make: Circular findiff2d <- findiff2d.o dependency dropped.
findiff2d calls 9 subroutines some of them are called from main program too.Is that problem?
This is my makefile:
77 = ifort
LD = ifort
CPPFLAGS = -C -traditional $(DFLAGS) -I$(INTEL_INC)
LIBS = -L$(INTEL_LIB) -lmkl_intel_lp64
OBJECTS_ARCHITECTURE = machine_intel.o

# Executables
main: main.o model.o time.o findiff2d.o misc.o blkdat.o fd.par
$(F77) $(FLAGS) -o main main.o model.o time.o findiff2d.o misc.o blkdat.o

# Object files
main.o: main.f fd.par
$(F77) $(FLAGS) -c main.f -o main.o
model.o: model.f fd.par
$(F77) $(FLAGS) -c model.f -o model.o
time.o: time.f fd.par
$(F77) $(FLAGS) -c time.f -o time.o
findiff2d.o: findiff2d fd.par
$(F77) $(FLAGS) -c findiff2d.f -o findiff2d.o
misc.o: misc.f fd.par
$(F77) $(FLAGS) -c misc.f -o misc.o
blkdat.o: blkdat.f fd.par
$(F77) $(FLAGS) -c blkdat.f -o blkdat.o

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

You appear to have introduced so many typos we can't judge accurately about your question.
Might the correct version involve

findiff2d.o: findiff2d.f ...... ?

Apparently, what you put there implies findiff2d.o depends on itself, a seemingly likely interpretation.

It doesn't make sense to introduce -lmkl_intel_lp64 by itself, but you don't show how you might use it.

Thanks Tim.
Regarding -lmkl_intel_lp64,I copied makefile from my another program.Changing findiff2d.o: findiff2d.f doesn't solve the problem.

The make utility does not concern itself with the contents of the source files it is about to hand over to compilers to process.

There is a built in make rule that says that linking xxxxx.o produces the executable xxxxx, in the absence of other information provided in the makefile for building xxxxx.

Since, because of you mistake in leaving out ".f" after findiff2d, as Tim18 pointed out already, findiff2d is declared a prerequisite to findiff2d.o, and make tries to figure out how to build it.

Since there is no explicit rule given to make this prerequisite, findiff2d, make uses the built-in rule, which in effect makes the following rules apply:

findiff2d.o: findiff2d # explicit rule
findiff2d: findiff2d.o # built-in rule

The circular dependency is now clearly seen.

The fix, as Tim18 stated, is to replace the erroneous line

findiff2d.o: findiff2d fd.par


findiff2d.o: findiff2d.f fd.par

To see how make applies built in rules, try the command

make misc

Thanks Mecej,now I see what is wrong.

Leave a Comment

Please sign in to add a comment. Not a member? Join today