[R-pkg-devel] Obscure-to-me parallel make issue

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Fri Apr 1 18:36:12 CEST 2022


On Fri, 1 Apr 2022 16:46:51 +0100
Peter Green <mapjg using bristol.ac.uk> wrote:

> f2cio.mod: f2cio.o
> fef2cio.mod: fef2cio.o f2cio.o
> Nmix-sub3z.o: f2cio.mod fef2cio.mod

What rule does Make use for the f2cio.o -> f2cio.mod transition? GNU
Make could have a built-in rule for .mod files and get confused thinking
it has a circular dependency:

Nmix/src$ make -n Nmix-sub3z.o -f Makevars
make: Circular f2cio.o <- f2cio.mod dependency dropped.
m2c    -o f2cio.o
make: Circular fef2cio.o <- fef2cio.mod dependency dropped.
m2c    -o fef2cio.o
f77   -c -o Nmix-sub3z.o Nmix-sub3z.f

In my experience, it can be easier to express the Fortran module
dependencies by lying to Make and telling it that the .o file depends
on the .o file corresponding to the .mod file, not the .mod file
itself. This way, the dependent rule shouldn't be started until the
parent rule is finished producing both files.

If you have a quick way of reproducing the problem, does it help to use

Nmix-sub3z.o: f2cio.o fef2cio.o

in your dependencies and avoid mentioning *.mod at all?

-- 
Best regards,
Ivan



More information about the R-package-devel mailing list