2003-11-13 02:46:27 +08:00
|
|
|
#!/bin/sh
|
2004-02-26 22:15:10 +08:00
|
|
|
# compute dependencies for the PWscf directory tree
|
2003-11-13 02:46:27 +08:00
|
|
|
|
2006-12-12 19:02:09 +08:00
|
|
|
# make sure there is no locale setting creating unneeded differences.
|
|
|
|
LC_ALL=C
|
|
|
|
export LC_ALL
|
2022-03-04 23:06:39 +08:00
|
|
|
# ensure that command echo understands escape characters
|
|
|
|
if test "`echo -e`" = "-e" ; then ECHO=echo ; else ECHO="echo -e" ; fi
|
2006-12-12 19:02:09 +08:00
|
|
|
|
2003-11-22 00:39:48 +08:00
|
|
|
# run from directory where this script is
|
2022-09-03 17:53:33 +08:00
|
|
|
cd `dirname $0`
|
2003-11-13 02:46:27 +08:00
|
|
|
TOPDIR=`pwd`
|
|
|
|
|
2006-10-20 05:17:24 +08:00
|
|
|
if test $# = 0
|
|
|
|
then
|
2022-03-04 23:06:39 +08:00
|
|
|
# this is the list of all directories for which we want to find dependencies
|
|
|
|
# upon include files *.h or *.fh or modules. Note that libraries that are
|
|
|
|
# externally maintained should not go into this list
|
|
|
|
|
|
|
|
dirs=" LAXlib FFTXlib/src UtilXlib \
|
|
|
|
dft-d3 \
|
|
|
|
KS_Solvers/Davidson KS_Solvers/Davidson_RCI KS_Solvers/CG \
|
|
|
|
KS_Solvers/PPCG KS_Solvers/ParO KS_Solvers/DENSE KS_Solvers/RMM \
|
|
|
|
upflib XClib Modules LR_Modules PW/src CPV/src PW/tools PP/src PWCOND/src \
|
2018-08-29 20:18:10 +08:00
|
|
|
PHonon/Gamma PHonon/PH PHonon/FD HP/src atomic/src \
|
2024-04-11 04:35:25 +08:00
|
|
|
EPW/src EPW/ZG/src XSpectra/src NEB/src TDDFPT/src \
|
2018-06-30 16:13:19 +08:00
|
|
|
GWW/pw4gww GWW/gww GWW/head GWW/bse GWW/simple \
|
2024-04-11 04:35:25 +08:00
|
|
|
GWW/simple_bse GWW/simple_ip QEHeat/src KCW/src KCW/PP "
|
2009-08-07 20:03:16 +08:00
|
|
|
|
2013-10-29 19:29:34 +08:00
|
|
|
elif
|
|
|
|
test $1 = "-addson"
|
|
|
|
then
|
2014-05-07 18:28:16 +08:00
|
|
|
echo "The script for adding new dependencies is running"
|
|
|
|
echo "Usage: $0 -addson DIR DEPENDENCY_DIRS"
|
2013-10-29 19:29:34 +08:00
|
|
|
echo "$0 assumes that the new dependencies are in $TOPDIR/../"
|
|
|
|
dirs=$2
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
add_deps=$*
|
|
|
|
echo "dependencies in $add_deps will be searched for $dirs"
|
2006-10-20 05:17:24 +08:00
|
|
|
else
|
|
|
|
dirs=$*
|
|
|
|
fi
|
|
|
|
|
2013-10-29 19:29:34 +08:00
|
|
|
|
2011-09-09 22:33:57 +08:00
|
|
|
for dir in $dirs; do
|
|
|
|
|
2011-09-09 22:26:59 +08:00
|
|
|
# the following command removes a trailing slash
|
|
|
|
DIR=`echo ${dir%/}`
|
2011-09-09 22:33:57 +08:00
|
|
|
|
|
|
|
# the following would also work
|
|
|
|
#DIR=`echo $dir | sed "s,/$,,"`
|
|
|
|
|
2009-10-20 03:49:13 +08:00
|
|
|
# set inter-directory dependencies - only directories containing
|
|
|
|
# modules that are used, or files that are included, by routines
|
2009-11-07 01:28:19 +08:00
|
|
|
# in directory DIR should be listed in DEPENDS
|
2022-03-04 23:06:39 +08:00
|
|
|
# (directory DIR itself should not be listed in DEPENDS)
|
2011-08-31 18:48:55 +08:00
|
|
|
LEVEL1=..
|
|
|
|
LEVEL2=../..
|
2024-04-11 04:35:25 +08:00
|
|
|
LEVEL3=../../..
|
2016-01-19 05:07:04 +08:00
|
|
|
# default
|
|
|
|
DEPENDS="$LEVEL1/include"
|
|
|
|
# for convenience, used later
|
2022-03-04 23:06:39 +08:00
|
|
|
DEPEND1="$LEVEL1/include $LEVEL1/FFTXlib/src $LEVEL1/XClib $LEVEL1/LAXlib \
|
|
|
|
$LEVEL1/UtilXlib $LEVEL1/upflib"
|
|
|
|
DEPEND3="$LEVEL2/include $LEVEL2/FFTXlib/src $LEVEL2/LAXlib $LEVEL2/UtilXlib"
|
|
|
|
DEPEND2="$DEPEND3 $LEVEL2/upflib $LEVEL2/XClib $LEVEL2/Modules"
|
2007-02-09 20:42:37 +08:00
|
|
|
case $DIR in
|
2022-03-04 23:06:39 +08:00
|
|
|
upflib )
|
|
|
|
DEPENDS="$LEVEL1/include $LEVEL1/UtilXlib" ;;
|
|
|
|
XClib )
|
|
|
|
DEPENDS="$LEVEL1/include $LEVEL1/upflib" ;;
|
2016-01-19 05:07:04 +08:00
|
|
|
Modules )
|
2022-03-04 23:06:39 +08:00
|
|
|
DEPENDS="$DEPEND1" ;;
|
|
|
|
dft-d3 )
|
|
|
|
DEPENDS="$LEVEL1/include $LEVEL1/UtilXlib $LEVEL1/Modules" ;;
|
2016-01-19 05:07:04 +08:00
|
|
|
LR_Modules )
|
2022-03-04 23:06:39 +08:00
|
|
|
DEPENDS="$DEPEND1 $LEVEL1/Modules $LEVEL1/PW/src" ;;
|
2016-04-05 04:16:41 +08:00
|
|
|
ACFDT/src )
|
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/PW/src $LEVEL2/PHonon/PH $LEVEL2/LR_Modules" ;;
|
KS_Solvers directory has been created with three subdirectories:
KS_Solvers/CG, KS_Solvers/Davidson, KS_Solvers/Davidson_RCI.
Two are currently used by QE, the third one implements the Davidson
diagonalization within the Reverse Communication Interface paradigm,
courtesy of Micael Oliveira.
KS_Solvers routines depend only on lower level libraries, notably UtilXlib,
LAXlib, (SCA)LAPACK, and BLAS.
reorganization can be improved. For instance some duplicated routines like
cdiaghg and rdiaghg could/should be moved in LAXlib. This could reduce the need
to include KS_Solvers directories in the link step of many codes.
Minimal changes to calling sequence have been made, essentially just adding
h_psi,s_psi,g_psi and h_1psi,s_1psi routines names as arguments (with a
specific calling sequence ihardcode inside the routines that agree with PWSCF one).
This could be avoided adopting the RCI paradigm.
Compiled in serial and parallel, 177/182 pw tests passed (3 that were failing
even before on my laptop pw-berry, pw-langevin, pw-pawatom + 2 unknown==not tested),
12 /17 cp tests passed (some o2-us-para-pbe-X fail but the same was for the
original version)
I assume the modified calling procedure is working and the problem lies somewhere else.
Randomly tested some examples in pw, ph, pwcond and it seams to work.
Please report any problem.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13644 c92efa57-630b-4861-b058-cf58834340f0
2017-07-29 20:19:19 +08:00
|
|
|
atomic/src | GWW/gww )
|
2016-01-19 05:07:04 +08:00
|
|
|
DEPENDS="$DEPEND2" ;;
|
KS_Solvers directory has been created with three subdirectories:
KS_Solvers/CG, KS_Solvers/Davidson, KS_Solvers/Davidson_RCI.
Two are currently used by QE, the third one implements the Davidson
diagonalization within the Reverse Communication Interface paradigm,
courtesy of Micael Oliveira.
KS_Solvers routines depend only on lower level libraries, notably UtilXlib,
LAXlib, (SCA)LAPACK, and BLAS.
reorganization can be improved. For instance some duplicated routines like
cdiaghg and rdiaghg could/should be moved in LAXlib. This could reduce the need
to include KS_Solvers directories in the link step of many codes.
Minimal changes to calling sequence have been made, essentially just adding
h_psi,s_psi,g_psi and h_1psi,s_1psi routines names as arguments (with a
specific calling sequence ihardcode inside the routines that agree with PWSCF one).
This could be avoided adopting the RCI paradigm.
Compiled in serial and parallel, 177/182 pw tests passed (3 that were failing
even before on my laptop pw-berry, pw-langevin, pw-pawatom + 2 unknown==not tested),
12 /17 cp tests passed (some o2-us-para-pbe-X fail but the same was for the
original version)
I assume the modified calling procedure is working and the problem lies somewhere else.
Randomly tested some examples in pw, ph, pwcond and it seams to work.
Please report any problem.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13644 c92efa57-630b-4861-b058-cf58834340f0
2017-07-29 20:19:19 +08:00
|
|
|
PW/src | CPV/src )
|
2022-11-11 15:24:49 +08:00
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/KS_Solvers/Davidson $LEVEL2/KS_Solvers/CG $LEVEL2/KS_Solvers/PPCG $LEVEL2/KS_Solvers/ParO $LEVEL2/KS_Solvers/DENSE $LEVEL2/KS_Solvers/RMM $LEVEL2/dft-d3" ;;
|
2022-03-04 23:06:39 +08:00
|
|
|
KS_Solvers/Davidson | KS_Solvers/Davidson_RCI | KS_Solvers/CG | KS_Solvers/PPCG | KS_Solvers/ParO | KS_Solvers/DENSE | KS_Solvers/RMM )
|
2017-07-26 19:15:20 +08:00
|
|
|
DEPENDS="$DEPEND3" ;;
|
2022-11-11 15:24:49 +08:00
|
|
|
PP/src )
|
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/PW/src $LEVEL2/dft-d3" ;;
|
|
|
|
PW/tools | PWCOND/src | GWW/pw4gww | NEB/src )
|
2016-03-25 03:14:59 +08:00
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/PW/src" ;;
|
2022-11-11 15:24:49 +08:00
|
|
|
PHonon/PH )
|
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/PW/src $LEVEL2/LR_Modules $LEVEL2/dft-d3" ;;
|
2022-03-04 23:06:39 +08:00
|
|
|
PHonon/FD | PHonon/PH | PHonon/Gamma | HP/src | TDDFPT/src | XSpectra/src | GIPAW/src | KCW/src )
|
2016-01-19 06:48:44 +08:00
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/PW/src $LEVEL2/LR_Modules" ;;
|
2024-04-11 04:35:25 +08:00
|
|
|
KCW/PP )
|
2022-03-04 23:06:39 +08:00
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/PW/src $LEVEL2/LR_Modules $LEVEL1/src" ;;
|
2024-04-11 04:35:25 +08:00
|
|
|
EPW/src | QEHeat/src )
|
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/PW/src $LEVEL2/LR_Modules $LEVEL2/PHonon/PH $LEVEL2/Modules" ;;
|
|
|
|
EPW/ZG/src )
|
|
|
|
DEPENDS="$LEVEL3/PW/src $LEVEL3/LR_Modules $LEVEL3/PHonon/PH $LEVEL3/Modules $LEVEL3/upflib $LEVEL3/UtilXlib" ;;
|
2018-08-29 20:18:10 +08:00
|
|
|
GWW/head )
|
2016-01-19 06:48:44 +08:00
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/PW/src $LEVEL2/PHonon/PH $LEVEL2/LR_Modules" ;;
|
2016-03-21 19:31:57 +08:00
|
|
|
GWW/bse )
|
2022-03-04 23:06:39 +08:00
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/PW/src $LEVEL2/PHonon/PH $LEVEL2/LR_Modules $LEVEL2/GWW/pw4gww $LEVEL2/GWW/gww" ;;
|
2018-06-30 16:13:19 +08:00
|
|
|
GWW/simple )
|
2022-03-04 23:06:39 +08:00
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/PW/src $LEVEL2/GWW/pw4gww $LEVEL2/GWW/gww" ;;
|
2018-06-30 16:13:19 +08:00
|
|
|
GWW/simple_bse )
|
2022-03-04 23:06:39 +08:00
|
|
|
DEPENDS="$DEPEND2 $LEVEL2/GWW/gww" ;;
|
2018-06-30 16:13:19 +08:00
|
|
|
GWW/simple_ip)
|
2022-03-04 23:06:39 +08:00
|
|
|
DEPENDS="$DEPEND2" ;;
|
2013-10-29 19:29:34 +08:00
|
|
|
*)
|
|
|
|
# if addson needs a make.depend file
|
2013-10-29 19:48:29 +08:00
|
|
|
DEPENDS="$DEPENDS $add_deps"
|
2011-12-15 01:33:33 +08:00
|
|
|
|
2004-02-26 22:15:10 +08:00
|
|
|
esac
|
2003-11-13 02:46:27 +08:00
|
|
|
|
2022-03-04 23:06:39 +08:00
|
|
|
# list of all system modules
|
|
|
|
sysdeps="iso_c_binding iso_fortran_env f90_unix_io f90_unix_env \
|
|
|
|
f90_unix_proc ifcore ifport git-rev.h"
|
|
|
|
|
|
|
|
# list of all external library modules or include files
|
|
|
|
libdeps="mpi omp_lib hdf5 mkl_dfti mkl_dfti.f90 fftw3.f03 fftw3.f \
|
|
|
|
xc_version.h xc_f03_lib_m elpa elpa1 \
|
|
|
|
mbd w90_io fox_dom fox_wxml m_common_io \
|
|
|
|
device_fbuff_m device_memcpy_m device_auxfunc_m"
|
|
|
|
|
|
|
|
# list of all cuda-related modules
|
|
|
|
cudadeps="cublas cudafor curand cufft flops_tracker cusolverdn \
|
|
|
|
zhegvdx_gpu dsyevd_gpu dsygvdx_gpu eigsolve_vars \
|
|
|
|
nvtx_inters"
|
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
# generate dependencies file (only for directories that are present)
|
2022-03-04 23:06:39 +08:00
|
|
|
|
2009-09-11 21:28:47 +08:00
|
|
|
if test -d $TOPDIR/../$DIR
|
2004-02-26 22:15:10 +08:00
|
|
|
then
|
2009-09-11 21:28:47 +08:00
|
|
|
cd $TOPDIR/../$DIR
|
2009-08-07 20:03:16 +08:00
|
|
|
|
2022-03-04 23:06:39 +08:00
|
|
|
cat > make.depend << EOF
|
|
|
|
#####################################################################
|
|
|
|
# Automatically generated file - if you notice lines looking like
|
|
|
|
# some_file.o: @some_module@
|
|
|
|
# figure out why "some_module", referenced in "some_file.o", is not
|
|
|
|
# found: check spelling, presence in one of the DEPEND* directories
|
|
|
|
# as defined in file "install/makedeps.sh"; if "some_module" is an
|
|
|
|
# external module, add it to the module lists "sysdeps", "libdeps",
|
|
|
|
# "cudadeps" defined in "install/makedeps.sh".
|
|
|
|
# Finally, from the top QE directory, run "make depend" to regenerate
|
|
|
|
# the files - DO NOT EDIT MANUALLY (unless you know what you are doing)
|
|
|
|
####################################################################
|
|
|
|
EOF
|
|
|
|
$TOPDIR/moduledep.sh $DEPENDS >> make.depend
|
2005-03-18 19:11:04 +08:00
|
|
|
$TOPDIR/includedep.sh $DEPENDS >> make.depend
|
2003-11-13 02:46:27 +08:00
|
|
|
|
2022-03-04 23:06:39 +08:00
|
|
|
# remove unwanted dependency upon system and library modules
|
|
|
|
for no_dep in $sysdeps $libdeps $cudadeps; do
|
|
|
|
echo "/@$no_dep@/d" >> removedeps.tmp
|
|
|
|
done
|
|
|
|
sed -f removedeps.tmp make.depend > tmp; mv tmp make.depend
|
|
|
|
/bin/rm removedeps.tmp
|
2018-10-17 18:38:40 +08:00
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
# check for missing dependencies
|
2022-03-04 23:06:39 +08:00
|
|
|
missing=`grep @ make.depend | grep -v @some_module@`
|
|
|
|
if test "$missing" != "";
|
2010-08-23 21:12:29 +08:00
|
|
|
then
|
|
|
|
notfound=1
|
2022-03-04 23:06:39 +08:00
|
|
|
$ECHO "\nWARNING! dependencies not found in directory $DIR:"
|
|
|
|
grep @ make.depend
|
|
|
|
$ECHO "File $DIR/make.depend is broken"
|
2010-08-23 21:12:29 +08:00
|
|
|
else
|
2022-03-04 23:06:39 +08:00
|
|
|
$ECHO -n "\rdirectory $DIR : ok"
|
2010-08-23 21:12:29 +08:00
|
|
|
fi
|
2013-10-29 19:29:34 +08:00
|
|
|
else
|
2022-03-04 23:06:39 +08:00
|
|
|
$ECHO "\ndirectory $DIR : not present in $TOPDIR"
|
2004-02-26 22:15:10 +08:00
|
|
|
fi
|
2003-11-13 02:46:27 +08:00
|
|
|
done
|
2005-03-18 19:30:21 +08:00
|
|
|
if test "$notfound" = ""
|
|
|
|
then
|
2022-03-04 23:06:39 +08:00
|
|
|
$ECHO "\nall dependencies updated successfully"
|
2005-03-18 19:30:21 +08:00
|
|
|
fi
|
2022-03-04 23:06:39 +08:00
|
|
|
|