- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
FCFLAGS = $(DFLAGS) -I$(INTEL_INC) -fpp -g
LDFLAGS = $(FCFLAGS)
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 fd.com
$(F77) $(FLAGS) -o main main.o model.o time.o findiff2d.o misc.o blkdat.o
# Object files
main.o: main.f fd.par fd.com
$(F77) $(FLAGS) -c main.f -o main.o
model.o: model.f fd.par fd.com
$(F77) $(FLAGS) -c model.f -o model.o
time.o: time.f fd.par fd.com
$(F77) $(FLAGS) -c time.f -o time.o
findiff2d.o: findiff2d fd.par fd.com
$(F77) $(FLAGS) -c findiff2d.f -o findiff2d.o
misc.o: misc.f fd.par fd.com
$(F77) $(FLAGS) -c misc.f -o misc.o
blkdat.o: blkdat.f fd.par fd.com
$(F77) $(FLAGS) -c blkdat.f -o blkdat.o
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)
FCFLAGS = $(DFLAGS) -I$(INTEL_INC) -fpp -g
LDFLAGS = $(FCFLAGS)
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 fd.com
$(F77) $(FLAGS) -o main main.o model.o time.o findiff2d.o misc.o blkdat.o
# Object files
main.o: main.f fd.par fd.com
$(F77) $(FLAGS) -c main.f -o main.o
model.o: model.f fd.par fd.com
$(F77) $(FLAGS) -c model.f -o model.o
time.o: time.f fd.par fd.com
$(F77) $(FLAGS) -c time.f -o time.o
findiff2d.o: findiff2d fd.par fd.com
$(F77) $(FLAGS) -c findiff2d.f -o findiff2d.o
misc.o: misc.f fd.par fd.com
$(F77) $(FLAGS) -c misc.f -o misc.o
blkdat.o: blkdat.f fd.par fd.com
$(F77) $(FLAGS) -c blkdat.f -o blkdat.o
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tim.
Regarding -lmkl_intel_lp64,I copied makefile from my another program.Changing findiff2d.o: findiff2d.f doesn't solve the problem.
Regarding -lmkl_intel_lp64,I copied makefile from my another program.Changing findiff2d.o: findiff2d.f doesn't solve the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 fd.com
by
findiff2d.o: findiff2d.f fd.par fd.com
To see how make applies built in rules, try the command
make misc
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 fd.com
by
findiff2d.o: findiff2d.f fd.par fd.com
To see how make applies built in rules, try the command
make misc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Mecej,now I see what is wrong.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page