> > > mod A uses mod B
> > > mod B uses mod C
> > > mod C uses mod A
> >
> > The compiler would not catch it, but mod A could never compile,
> > because B would not exist.
> Not necessarily so. Perhaps in some other world where code springs
> to life complete and never gets modified. In this life, however,
> it is quite easy to incrementally introduce such a circular dependency
> by adding the final USE in some modification after the earlier,
> non-circular code had been compiled, so that a module file would
> exist.
I had not considered that, so one should do "make clean" occasionally
to clean out those little messes.
> I don't recall that the original poster mentioned how his makefile
> was generated;
Actually, it was generated with a Unix shell script I wrote. We use
it with Linux and SGI compilers. The script generates only the
dependencies and the assosiated compile commands, such as the
following (for IRIX):
../IRIX/decon.o ../IRIX/DECON.kmo: decon.f90 ../../caps_lib/IRIX/FILES.kmo ../../common/IRIX/INTMOD.kmo
$(COMPILE.f90) $(FFLAGS) -o ../IRIX/decon.o $(IPATH) decon.f90
mv DECON.kmo ../IRIX/
Having the dependencies would help, but he said the recompilation
problem only occurred on the IRIX (SGI) system, not on Linux. This
could happen (and has happened to me) if the source files are on one
system and the object files are on another, and the clocks are not
synchronized.
-jack
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|