Page 1 of 1

"make -jn" causes error: missing dependencies in Makefile

Posted: Sun May 06, 2007 2:47 am
by lahaye
Hi,

As I do with the make command for all software on my 4 CPUs system,
I also wanted to use the "make -j4" to speed up the compilation of VASP.
However, the make process ends with an error in that case:

Code: Select all

$ make -j4
[...snip...]
gfortran  -O3  -c pseudo.f
 In file pseudo.f:40

      USE radial
               1
Fatal Error: Can't open module file 'radial.mod' for reading at (1):
No such file or directory
This indicates that the Makefile has missing dependencies to guide
the make process. I bet this is the problem in the bottom part of all the
example makefiles provided in the vasp sources directory.
For example, in this case one needs to change the Makefile to have:

pseudo.o: pseudo.inc pseudo.F radial.o

But many more are needed to support the -j flag in make.
Being able to us "make -j" speeds up compilation considerably!

Regards,
Rob.

"make -jn" causes error: missing dependencies in Makefile

Posted: Tue May 08, 2007 7:15 am
by admin
please check (in your makefile) whether radial is compiled BEFORE pseudo. If not, please change the sequence of compilation

"make -jn" causes error: missing dependencies in Makefile

Posted: Wed May 09, 2007 7:51 am
by lahaye
I don't think it is a matter of ordering in the object list, when using
the "-j" flag with make.
With "make -jn", make scrambles the order of compilation into parallel
sessions, for as far the dependencies allow that.
Hence, the dependency is crucial in that case.

It seems that the following dependency list is sufficient to bring
"make -j" to a good end:

aedens.o: charge.o us.o
asa.o: constant.o
base.o: base.inc base.F
brent.o: base.o
broyden.o: charge.o
chain.o: poscar.o
charge.o: wave.o wave_mpi.o
chgloc.o: base.o
choleski2.o: dfast.o
cl_shift.o: pseudo.o
constant.o: constant.inc constant.F base.o
constr_cell_relax.o: base.o
constrmag.o: poscar.o wave.o
davidson.o: wave.o dfast.o
dfast.o: nonl.o
dipol.o: pseudo.o charge.o
dos.o: wave.o
dyna.o: chain.o ini.o
dynbr.o: chain.o ini.o
ebs.o: constant.o ini.o
edtest.o: wave.o dfast.o
electron.o: charge.o us.o
elf.o: wave.o
elpol.o: pseudo.o wave.o paw.o us.o
fft3dfurth.o: mgrid.o
fft3dlib.o: base.o
fileio.o: wave.o charge.o paw.o
finite_diff.o: lattice.o
force.o: pot.o
hamil.o: wave.o nonl.o
ini.o: xml.o
jacobi.o: base.o mpi.o
lattice.o: lattice.inc lattice.F base.o
lattlib.o: lattice.o symlib.o
LDApU.o: pseudo.o dfast.o
main.o: charge.o us.o writer.o
main_mpi.o: mpi.o base.o
metagga.o: pseudo.o wave.o
mgrid.o: mgrid.inc mgrid.F mpi.o base.o
mkpoints.o: base.o
mix.o: mgrid.o
mkpoints.o: mkpoints.inc mkpoints.F lattice.o
nonl.o: nonl.inc nonl.F pseudo.o wave.o
nonlr.o: nonlr.inc nonlr.F pseudo.o
opergrid.o: mgrid.o
optics.o: poscar.o wave.o nonl.o
optreal.o: ini.o
paircorrection.o: base.o
pardens.o: us.o
paw.o: pseudo.o LDApU.o
poscar.o: poscar.inc poscar.F lattice.o
pot.o: charge.o
potex1.o: mgrid.o setex.o
potex2.o: mgrid.o setex.o
pseudo.o: pseudo.inc pseudo.F radial.o
radial.o: setex.o
random.o: base.o
reader.o: wave_mpi.o
relativistic.o: constant.o radial.o
rmm-diis.o: wave.o dfast.o
scala.o: mpi.o base.o
setex.o: setexm.inc setex.F ini.o
setlocalpp.o: constant.o
shm.o: wave.o
smart_allocate.o: base.o
sphpro.o: pseudo.o wave.o nonl.o
steep.o: wave.o dfast.o
stepver.o: base.o
stm.o: poscar.o wave.o
stufak.o: poscar.o
subrot.o: wave_mpi.o dfast.o
symlib.o: base.o
symmetry.o: mgrid.o
tet.o: base.o
tutor.o: base.o
us.o: pseudo.o paw.o
wave_mpi.o: wave.o
wave.o: wave.inc wave.F pseudo.o
wavpre_noio.o: poscar.o wave.o wave_mpi.o choleski2.o
wavpre.o: poscar.o wave.o charge.o dfast.o choleski2.o
writer.o: poscar.o us.o pardens.o
xcgrad.o: lattice.o
xclib.o: base.o
xcspin.o: lattice.o
xml.o: base.o
xml_writer.o: wave_mpi.o

"make -jn" causes error: missing dependencies in Makefile

Posted: Wed May 23, 2007 1:09 pm
by job
What I do is that I replace the dependencies from the makefile with the line

include depend.mk

depend.mk is a file that I generate with the makedepf90 tool (you'll find it by searching on google), like so:

makedepf90 *.F > depend.mk

After that, make -j # works like a charm!
<span class='smallblacktext'>[ Edited Wed May 23 2007, 03:10PM ]</span>