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
|
|
|
|
|
2003-11-22 00:39:48 +08:00
|
|
|
# run from directory where this script is
|
|
|
|
cd `echo $0 | sed 's/\(.*\)\/.*/\1/'` # extract pathname
|
2003-11-13 02:46:27 +08:00
|
|
|
TOPDIR=`pwd`
|
|
|
|
|
2006-10-20 05:17:24 +08:00
|
|
|
if test $# = 0
|
|
|
|
then
|
2013-01-18 17:18:59 +08:00
|
|
|
dirs=" Modules clib PW/src CPV/src flib PW/tools upftools PP/src PWCOND/src\
|
2013-05-08 18:35:25 +08:00
|
|
|
PHonon/Gamma PHonon/PH PHonon/D3 PHonon/FD atomic/src XSpectra/src \
|
2014-02-25 16:31:01 +08:00
|
|
|
ACDFT NEB/src TDDFPT/src GIPAW/src GWW/pw4gww GWW/gww GWW/head"
|
2009-08-07 20:03:16 +08:00
|
|
|
|
2013-10-29 19:29:34 +08:00
|
|
|
elif
|
|
|
|
test $1 = "-addson"
|
|
|
|
then
|
|
|
|
echo "The script for adding new dependencies is runing"
|
|
|
|
echo "USAGE $0 -addson DIR DEPENDENCY_DIRS"
|
|
|
|
echo "$0 assumes that the new dependencies are in $TOPDIR/../"
|
|
|
|
# ninput=$#
|
|
|
|
# echo "number of input arguments: $ninput"
|
|
|
|
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
|
2011-08-31 18:48:55 +08:00
|
|
|
LEVEL1=..
|
|
|
|
LEVEL2=../..
|
|
|
|
DEPENDS="$LEVEL1/include $LEVEL1/iotk/src"
|
2007-02-09 20:42:37 +08:00
|
|
|
case $DIR in
|
2013-01-18 17:18:59 +08:00
|
|
|
flib | upftools )
|
2011-08-31 18:48:55 +08:00
|
|
|
DEPENDS="$LEVEL1/include $LEVEL1/iotk/src $LEVEL1/Modules" ;;
|
2012-01-09 18:02:08 +08:00
|
|
|
PP/src )
|
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/iotk/src $LEVEL2/Modules \
|
|
|
|
$LEVEL2/PW/src" ;;
|
2012-01-10 22:08:15 +08:00
|
|
|
VdW/src )
|
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/iotk/src $LEVEL2/Modules \
|
|
|
|
$LEVEL2/PW/src $LEVEL2/PHonon/PH" ;;
|
|
|
|
ACFDT )
|
2011-08-31 18:48:55 +08:00
|
|
|
DEPENDS="$LEVEL1/include $LEVEL1/iotk/src $LEVEL1/Modules \
|
2011-12-15 01:33:33 +08:00
|
|
|
$LEVEL1/PW/src $LEVEL1/PHonon/PH" ;;
|
2012-01-10 22:08:15 +08:00
|
|
|
|
2014-02-25 16:31:01 +08:00
|
|
|
PW/src )
|
2014-02-25 18:49:52 +08:00
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/iotk/src $LEVEL2/Modules" ;;
|
2013-05-08 18:35:25 +08:00
|
|
|
PW/tools | PWCOND/src | PHonon/FD )
|
2011-12-15 01:33:33 +08:00
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/PW/src $LEVEL2/iotk/src $LEVEL2/Modules" ;;
|
2011-08-31 18:48:55 +08:00
|
|
|
CPV/src | atomic/src | GWW/gww )
|
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/iotk/src $LEVEL2/Modules" ;;
|
2013-01-18 17:18:59 +08:00
|
|
|
PHonon/PH | PHonon/Gamma | XSpectra/src | PWCOND/src | GWW/pw4gww | NEB/src | GIPAW/src )
|
2011-08-31 18:48:55 +08:00
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/iotk/src $LEVEL2/Modules \
|
2011-12-15 01:33:33 +08:00
|
|
|
$LEVEL2/PW/src" ;;
|
2011-09-21 21:43:24 +08:00
|
|
|
PHonon/D3 )
|
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/iotk/src $LEVEL2/Modules \
|
2011-12-15 01:33:33 +08:00
|
|
|
$LEVEL2/PW/src $LEVEL2/PHonon/PH" ;;
|
2013-07-04 02:08:09 +08:00
|
|
|
GWW/pw4gww )
|
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/iotk/src $LEVEL2/Modules \
|
|
|
|
$LEVEL2/PW/src " ;;
|
|
|
|
GWW/gww )
|
2013-10-07 23:19:12 +08:00
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/iotk/src $LEVEL2/Modules " ;;
|
2013-07-04 02:08:09 +08:00
|
|
|
GWW/head )
|
2011-08-31 18:48:55 +08:00
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/iotk/src $LEVEL2/Modules \
|
2013-07-04 02:08:09 +08:00
|
|
|
$LEVEL2/PW/src $LEVEL2/PHonon/PH " ;;
|
|
|
|
|
2014-02-25 16:31:01 +08:00
|
|
|
TDDFPT/src )
|
2011-12-15 01:33:33 +08:00
|
|
|
DEPENDS="$LEVEL2/include $LEVEL2/iotk/src $LEVEL2/Modules \
|
|
|
|
$LEVEL2/PW/src $LEVEL2/PHonon/PH" ;;
|
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
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
# generate dependencies file (only for directories that are present)
|
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
|
|
|
|
2004-11-09 18:53:55 +08:00
|
|
|
$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
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
# handle special cases
|
|
|
|
sed '/@\/cineca\/prod\/hpm\/include\/f_hpm.h@/d' \
|
|
|
|
make.depend > make.depend.tmp
|
2012-10-15 18:03:26 +08:00
|
|
|
sed '/@iso_c_binding@/d;/@ifcore@/d' make.depend.tmp > make.depend
|
2011-04-28 19:46:36 +08:00
|
|
|
|
2012-09-29 19:05:45 +08:00
|
|
|
if test "$DIR" = "Modules"
|
|
|
|
then
|
2012-10-24 22:31:17 +08:00
|
|
|
sed '/@mpi@/d' make.depend > make.depend.tmp
|
|
|
|
sed '/@elpa1@/d' make.depend.tmp > make.depend
|
2012-09-29 19:05:45 +08:00
|
|
|
fi
|
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
if test "$DIR" = "clib"
|
|
|
|
then
|
|
|
|
mv make.depend make.depend.tmp
|
|
|
|
sed 's/@fftw.c@/fftw.c/' make.depend.tmp > make.depend
|
|
|
|
fi
|
2005-03-18 19:24:02 +08:00
|
|
|
|
2014-04-04 17:36:29 +08:00
|
|
|
if test "$DIR" = "PW/src" || test "$DIR" = "TDDFPT/src"
|
2011-04-28 18:58:42 +08:00
|
|
|
then
|
2014-04-04 17:36:29 +08:00
|
|
|
sed '/@environ_base@/d' make.depend > make.depend.tmp
|
|
|
|
sed '/@environ_info@/d' make.depend.tmp > make.depend
|
|
|
|
sed '/@environ_init@/d' make.depend > make.depend.tmp
|
|
|
|
sed '/@environ_main@/d' make.depend.tmp > make.depend
|
|
|
|
sed '/@environ_mp@/d' make.depend > make.depend.tmp
|
2014-02-09 02:25:10 +08:00
|
|
|
sed '/@solvent_tddfpt@/d' make.depend.tmp > make.depend
|
|
|
|
fi
|
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
rm -f make.depend.tmp
|
2006-06-23 23:47:59 +08:00
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
# check for missing dependencies
|
|
|
|
if grep @ make.depend
|
|
|
|
then
|
|
|
|
notfound=1
|
|
|
|
echo WARNING: dependencies not found in directory $DIR
|
|
|
|
else
|
|
|
|
echo directory $DIR : ok
|
|
|
|
fi
|
2013-10-29 19:29:34 +08:00
|
|
|
else
|
2013-10-29 19:48:29 +08:00
|
|
|
echo WARNING: $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
|
|
|
|
echo all dependencies updated successfully
|
|
|
|
fi
|