forked from lammps/lammps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDepend.sh
executable file
·145 lines (120 loc) · 2.68 KB
/
Depend.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Depend.sh = Install/unInstall files due to package dependencies
# this script is invoked after any package is installed/uninstalled
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# all parent/child package dependencies should be listed below
# parent package = has files that files in another package derive from
# child package = has files that derive from files in another package
# update child packages that depend on the parent,
# but only if the child package is already installed
# this is necessary to insure the child package installs
# only child files whose parent package files are now installed
# decisions on (un)installing individual child files are made by
# the Install.sh script in the child package
# depend function: arg = child-package
# checks if child-package is installed, if not just return
# otherwise invoke update of child package via its Install.sh
depend () {
cd $1
installed=0
for file in *.cpp *.h; do
if (test -e ../$file) then
installed=1
fi
done
cd ..
if (test $installed = 0) then
return
fi
echo " updating package $1"
if (test -e $1/Install.sh) then
cd $1; /bin/sh Install.sh 2; cd ..
else
cd $1; /bin/sh ../Install.sh 2; cd ..
fi
}
# add one if statement per parent package
# add one depend() call per child package that depends on that parent
if (test $1 = "ASPHERE") then
depend GPU
depend USER-OMP
depend USER-CGDNA
depend USER-INTEL
fi
if (test $1 = "CLASS2") then
depend GPU
depend KOKKOS
depend USER-OMP
fi
if (test $1 = "COLLOID") then
depend GPU
depend USER-OMP
fi
if (test $1 = "DIPOLE") then
depend USER-MISC
depend USER-OMP
fi
if (test $1 = "GRANULAR") then
depend KOKKOS
depend USER-OMP
fi
if (test $1 = "KSPACE") then
depend CORESHELL
depend GPU
depend KOKKOS
depend OPT
depend USER-OMP
depend USER-INTEL
depend USER-PHONON
depend USER-FEP
fi
if (test $1 = "MANYBODY") then
depend GPU
depend KOKKOS
depend OPT
depend QEQ
depend USER-MISC
depend USER-OMP
fi
if (test $1 = "MOLECULE") then
depend GPU
depend KOKKOS
depend USER-MISC
depend USER-FEP
depend USER-OMP
depend USER-INTEL
fi
if (test $1 = "PERI") then
depend USER-OMP
fi
if (test $1 = "RIGID") then
depend USER-OMP
depend USER-SDPD
fi
if (test $1 = "SNAP") then
depend KOKKOS
fi
if (test $1 = "USER-CGSDK") then
depend GPU
depend KOKKOS
depend USER-OMP
fi
if (test $1 = "USER-DPD") then
depend KOKKOS
fi
if (test $1 = "USER-DRUDE") then
depend USER-OMP
fi
if (test $1 = "USER-FEP") then
depend USER-OMP
fi
if (test $1 = "USER-MISC") then
depend GPU
depend USER-OMP
depend USER-INTEL
fi
if (test $1 = "USER-REAXC") then
depend KOKKOS
depend USER-OMP
fi