forked from libm3l/LoCi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmpcopy
executable file
·279 lines (255 loc) · 7.1 KB
/
tmpcopy
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
#!/bin/bash
###############################################################################
#
# Copyright 2008, 2015, Mississippi State University
#
# This file is part of the Loci Framework.
#
# The Loci Framework is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The Loci Framework is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Lesser GNU General Public License for more details.
#
# You should have received a copy of the Lesser GNU General Public License
# along with the Loci Framework. If not, see <http://www.gnu.org/licenses>
#
###############################################################################
set -e
set -u
source=`pwd`
logname=${LOGNAME-user}
target=${LOCI_TARGET-/usr/tmp/$logname/}
subdir=Loci
LIB_POSTFIX="so"
ARCH=${LOCI_ARCH-`uname -s`}
if [ $ARCH == "Darwin" ]; then
LIB_POSTFIX="dylib"
fi
if [ $ARCH == "IRIX64" ]; then
# If IRIX OS, default to sgi compiler, otherwise default to gcc
COMP=${LOCI_COMP-CC_sgi}
else
COMP=${LOCI_COMP-gcc}
fi
while [ $# -ne 0 ]; do
case "$1" in
--subdir)
shift
subdir=$1
;;
--target)
shift
subdir=""
target=$1
;;
--source)
shift
source=$1
;;
--compiler)
shift
COMP=$1
;;
*)
break
;;
esac
shift
done
if [ $# -eq 1 ]; then
target=$1
fi
if [ $# -eq 2 ]; then
target=$1
COMP=$2
fi
if [ ${target:0:1} != "/" ]; then
target=`pwd`/${target}
echo setting target to \'$target\'
fi
TARGET_DIRS="System Tools FVMAdapt FVMOverset include include/Tools include/Config include/MPI_stubb include/FVMAdapt include/FVMOverset"
TOOLS_DIRS="lpp FVMtools FVMtools/libadf FVMMod sprng sprng/include sprng/include/sprng"
DO_METIS_INSTALL=${INSTALL_METIS:-1}
if [ ! ${DO_METIS_INSTALL} == 0 ]; then
TOOLS_DIRS=$TOOLS_DIRS" ParMetis-4.0 ParMetis-4.0/GKLib ParMetis-4.0/METISLib ParMetis-4.0/ParMETISLib"
fi
echo TOOLS_DIR=${TOOLS_DIRS}
echo -n "Making Directory Structure: "
mkdir -p $target
if [ "$subdir" == "" ]; then
fulltarget=$target
else
fulltarget=$target/$subdir
mkdir -p $fulltarget
fi
mkdir -p $fulltarget/lib
mkdir -p $fulltarget/bin
if [ ! -h $fulltarget/Tutorial ]; then
ln -s $source/Tutorial $fulltarget/Tutorial
fi
for i in $TARGET_DIRS ; do
echo -n $i " "
mkdir -p $fulltarget/$i
done
echo
# remove Makefile link if it already exists in case external metis option
# changed
rm -f $fulltarget/ParMetis-4.0/Makefile
for i in $TOOLS_DIRS ; do
echo -n $i " "
mkdir -p $fulltarget/$i
done
echo
if [ ! -h $fulltarget/FVMtools/extract_movie ]; then
cp FVMtools/extract_movie $fulltarget/FVMtools/extract_movie
chmod a+rx $fulltarget/FVMtools/extract_movie
fi
cd $fulltarget
if [ ! -h Makefile ]; then
echo ln -s $source/src/Makefile Makefile
ln -s $source/src/Makefile Makefile
fi
if [ ! -h Loci.conf ]; then
echo ln -s $source/src/conf/Loci.conf Loci.conf
ln -s $source/src/conf/Loci.conf Loci.conf
fi
if [ ! -h Install.bash ]; then
echo ln -s $source/src/Install.bash Install.bash
ln -s $source/src/Install.bash Install.bash
fi
if [ ! -e comp.conf ]; then
echo cp $source/src/conf/${COMP}.conf comp.conf
cp $source/src/conf/${COMP}.conf comp.conf
fi
if [ ! -e sys.conf ]; then
if [ -e $source/src/conf/${ARCH}.conf ]; then
echo cp $source/src/conf/${ARCH}.conf sys.conf
cp $source/src/conf/${ARCH}.conf sys.conf
fi
fi
cd lib
#if [ ! -h libTools.a ]; then
# ln -s ../Tools/libTools.a libTools.a
#fi
#if [ ! -h libLoci.a ]; then
# ln -s ../System/libLoci.a libLoci.a
#fi
if [ ! -h libTools.${LIB_POSTFIX} ]; then
ln -s ../Tools/libTools.${LIB_POSTFIX} libTools.${LIB_POSTFIX}
fi
if [ ! -h libLoci.${LIB_POSTFIX} ]; then
ln -s ../System/libLoci.${LIB_POSTFIX} libLoci.${LIB_POSTFIX}
fi
if [ ! -h fvm_m.so ]; then
ln -s ../FVMMod/fvm_m.so fvm_m.so
fi
if [ ! -h libfvmadaptfunc.${LIB_POSTFIX} ]; then
ln -s ../FVMAdapt/libfvmadaptfunc.${LIB_POSTFIX} libfvmadaptfunc.${LIB_POSTFIX}
fi
if [ ! -h fvmadapt_m.so ]; then
ln -s ../FVMAdapt/fvmadapt_m.so fvmadapt_m.so
fi
if [ ! -h fvmoverset_m.so ]; then
ln -s ../FVMOverset/fvmoverset_m.so fvmoverset_m.so
fi
if [ ! ${DO_METIS_INSTALL} == 0 ]; then
if [ ! -h libgk.${LIB_POSTFIX} ] ; then
ln -s ../ParMetis-4.0/GKLib/libgk.${LIB_POSTFIX} libgk.${LIB_POSTFIX}
fi
if [ ! -h libmetis.${LIB_POSTFIX} ] ; then
ln -s ../ParMetis-4.0/METISLib/libmetis.${LIB_POSTFIX} libmetis.${LIB_POSTFIX}
fi
if [ ! -h libparmetis.${LIB_POSTFIX} ] ; then
ln -s ../ParMetis-4.0/ParMETISLib/libparmetis.${LIB_POSTFIX} libparmetis.${LIB_POSTFIX}
fi
else
rm -f libgk.* libmetis.* libparmetis.*
fi
if [ ! -h libsprng.${LIB_POSTFIX} ] ; then
ln -s ../sprng/libsprng.${LIB_POSTFIX} libsprng.${LIB_POSTFIX}
fi
cd ../bin
if [ ! -h lpp ] ; then
ln -s ../lpp/lpp lpp
fi
if [ ! -h extract ] ; then
ln -s ../FVMtools/extract extract
fi
if [ ! -h ugrid2vog ] ; then
ln -s ../FVMtools/ugrid2vog ugrid2vog
fi
if [ ! -h cfd++2vog ] ; then
ln -s ../FVMtools/cfd++2vog cfd++2vog
fi
if [ ! -h vogcheck ] ; then
ln -s ../FVMtools/vogcheck vogcheck
fi
if [ ! -h vogmerge ] ; then
ln -s ../FVMtools/vogmerge vogmerge
fi
if [ ! -h vog2surf ] ; then
ln -s ../FVMtools/vog2surf vog2surf
fi
if [ ! -h marker ] ; then
ln -s ../FVMtools/marker marker
fi
if [ ! -h refmesh ] ; then
ln -s ../FVMtools/refmesh refmesh
fi
if [ ! -h refine ] ; then
ln -s ../FVMtools/refine refine
fi
if [ ! -h cgns2surf ] ; then
ln -s ../FVMtools/cgns2surf cgns2surf
fi
if [ ! -h cgns2ensight ] ; then
ln -s ../FVMtools/cgns2ensight cgns2ensight
fi
if [ ! -h cgns2ugrid ] ; then
ln -s ../FVMtools/cgns2ugrid cgns2ugrid
fi
if [ ! -h cgns2vog ] ; then
ln -s ../FVMtools/cgns2vog cgns2vog
fi
if [ ! -h ugrid2cgns ] ; then
ln -s ../FVMtools/ugrid2cgns ugrid2cgns
fi
for dir in $TARGET_DIRS; do
echo "Linking" $dir "directory files..."
cd $source/src/$dir
for i in *.cc *.h *.hh *.hpp *.c *.loci *.lh Makefile Loci ; do
if [ -e $i ] ; then
if [ ! -h $fulltarget/$dir/$i ] ; then
echo ln -s $source/src/$dir/$i $fulltarget/$dir/$i
ln -s $source/src/$dir/$i $fulltarget/$dir/$i
fi
fi
done
done
for dir in $TOOLS_DIRS; do
echo "Linking" $dir "directory files..."
cd $source/$dir
for i in *.cc *.h *.hh *.hpp *.c *.loci *.lh Makefile Loci ; do
if [ -f $i ] ; then
if [ ! -h $fulltarget/$dir/$i ] ; then
echo ln -s $source/$dir/$i $fulltarget/$dir/$i
ln -s $source/$dir/$i $fulltarget/$dir/$i
fi
fi
done
done
if [ ! -h $fulltarget/lpp/variable.cc ] ; then
echo ln -s $source/src/System/variable.cc $fulltarget/lpp/variable.cc
ln -s $source/src/System/variable.cc $fulltarget/lpp/variable.cc
fi
#if [ ${DO_METIS_INSTALL} == 0 ]; then
#make dummy metis directory
# mkdir -p $fulltarget/ParMetis-4.0
# cp $source/ParMetis-4.0/Makefile.dummy $fulltarget/ParMetis-4.0/Makefile
#fi
#echo "** Be sure to set LOCI_BASE=\"$target/Loci\" **"