1 arta 1.1 #! /bin/csh -f
2
|
3 arta 1.26 # set up $JSOC_MACHINE
4 set JSOC_MACHINE = `build/jsoc_machine.csh`
5 echo "Machine type is $JSOC_MACHINE"
6 echo ""
|
7 arta 1.24
|
8 arta 1.1 set CLEAN = "no"
9 set CHKLIBS = "no"
10 set CCMD = "c"
11 set LCMD = "l"
12
13 foreach ARG ($argv)
14 set FLAG = `echo $ARG | awk '{print substr($0, 2)}'`
15 if ($FLAG == $CCMD) then
16 set CLEAN = "yes"
17 else if ($FLAG == $LCMD) then
18 set CHKLIBS = "yes"
19 endif
20 end
21
22 if ($CHKLIBS == "no") then
|
23 arta 1.5 echo -n "Remove links for local project configuration..."
|
24 arta 1.10 if (-d proj) then
25 cd proj
|
26 arta 1.8 if (-e configure) then
27 rm configure
28 endif
29 if (-e make_basic.mk) then
30 rm make_basic.mk
31 endif
32 if (-e Rules.mk) then
33 rm Rules.mk
34 endif
35 if (-e target.mk) then
36 rm target.mk
37 endif
|
38 arta 1.10 cd ..
|
39 arta 1.5 endif
40 echo "done"
41
|
42 arta 1.1 echo -n "Remove links to man pages..."
|
43 arta 1.13 if (-e man) then
44 rm -rf man
|
45 arta 1.12 endif
|
46 arta 1.1 echo "done"
47
48 echo -n "Removing links to headers..."
|
49 arta 1.10 if (-d base/include) then
50 cd base/include
|
51 arta 1.8 find . -name "*.h" -exec rm {} \;
|
52 arta 1.10 cd ../..
|
53 arta 1.1 endif
|
54 arta 1.19
55 if (-d include) then
56 cd include
57 find . -name "*.h" -exec rm {} \;
58 cd ..
59 endif
|
60 arta 1.1 echo "done"
61
62 echo -n "Removing links to scripts..."
63 if (-d scripts) then
64 cd scripts
|
65 arta 1.8 find . -name "*" -exec rm {} \;
|
66 arta 1.1 cd ..
67 endif
68 echo "done"
69
70 echo -n "Removing links to jsds..."
71 if (-d jsds) then
72 cd jsds
|
73 arta 1.8 find . -name "*" -exec rm {} \;
|
74 arta 1.1 cd ..
75 endif
76 echo "done"
77
|
78 arta 1.14 echo -n "Removing links to third-party libraries..."
79 if (-d lib_third_party) then
80 rm -rf lib_third_party
81 endif
82 echo "done"
83
|
84 arta 1.1 echo
85
86 if ($CLEAN == "yes") then
|
87 arta 1.10 if (-x base/local/libs/dsds/scripts/rmlinks.csh) then
88 base/local/libs/dsds/scripts/rmlinks.csh
|
89 arta 1.1 endif
90
|
91 arta 1.10 if (-x base/local/libs/soi/scripts/rmlinks.csh) then
92 base/local/libs/soi/scripts/rmlinks.csh
|
93 arta 1.1 endif
94 else
|
95 arta 1.5 echo -n "Setting links for local project configuration..."
|
96 arta 1.6 if (-e suflag.txt) then
|
97 arta 1.10 cd proj
98 ln -sf ../projconf/su/configure configure
99 ln -sf ../projconf/su/make_basic.mk make_basic.mk
100 ln -sf ../projconf/su/Rules.mk Rules.mk
101 ln -sf ../projconf/su/target.mk target.mk
102 cd ..
|
103 arta 1.6 else
|
104 arta 1.10 cd proj
105 ln -sf ../projconf/ex/configure configure
106 ln -sf ../projconf/ex/make_basic.mk make_basic.mk
107 ln -sf ../projconf/ex/Rules.mk Rules.mk
108 ln -sf ../projconf/ex/target.mk target.mk
109 cd ..
|
110 arta 1.5 endif
111 echo "done"
112
|
113 arta 1.13 echo "Setting links to man pages..."
114 if (-d /home/jsoc/man) then
115 if (!(-e man)) then
116 ln -s /home/jsoc/man man
117 endif
118 endif
|
119 arta 1.1 echo "done"
120
121 echo "Setting links to headers..."
|
122 arta 1.10 if (!(-d base/include)) then
123 mkdir -p base/include
|
124 arta 1.1 endif
|
125 arta 1.10 cd base/include
|
126 arta 1.1 find .. -path '../include' -prune -o -name \*.h \( \( -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \; \)
|
127 arta 1.10 cd ../..
|
128 arta 1.19
129 if (!(-d include)) then
130 mkdir -p include
131 endif
132 cd include
133 if (-d ../base/include) then
134 find ../base/include -name \*.h -exec ln -s {} . \;
135 endif
136 cd ..
|
137 arta 1.1 echo "done"
138 echo
139
140 echo "Setting links to scripts..."
141 if (!(-d scripts)) then
142 mkdir scripts
143 endif
144 cd scripts
|
145 arta 1.3
146 # Sums scripts
|
147 arta 1.10 find ../base/sums/scripts -mindepth 1 \( -path \*CVS -prune -o -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \;
|
148 arta 1.3
149 # Util scripts
|
150 arta 1.10 find ../base/util/scripts -mindepth 1 \( -path \*CVS -prune -o -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \;
|
151 arta 1.3
|
152 arta 1.9 # DRMS / IDL-interface scripts
|
153 arta 1.10 find ../base/drms/scripts -mindepth 1 \( -path \*CVS -prune -o -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \;
|
154 arta 1.9
|
155 arta 1.4 # Project-specific scripts - these won't show up if you don't have the project source.
|
156 arta 1.10 if (-x ../proj/configure) then
157 ../proj/configure
|
158 arta 1.4 endif
|
159 arta 1.3
|
160 arta 1.1 cd ..
161 echo "done"
162 echo
163
164 echo "Setting links to jsds..."
165 if (!(-d jsds)) then
166 mkdir jsds
167 endif
168 cd jsds
|
169 arta 1.10 find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o \( -name \*.jsd -exec echo " " {} " ERROR - couldn't create link" \; \)
|
170 arta 1.1 cd ..
171 echo "done"
172 echo
|
173 arta 1.14 # Set links to third-party libraries
174 echo "Setting links to third-party libraries"
|
175 arta 1.15 if (!(-d lib_third_party)) then
176 mkdir lib_third_party
|
177 arta 1.14 endif
178 cd lib_third_party
179
180 if (-e ../suflag.txt) then
|
181 arta 1.27 if (!(-d include)) then
182 mkdir include
183 endif
184
185 if (!(-d lib)) then
186 mkdir lib
187 endif
188
189 # Don't make a link directly from include/lib to a directory, else
190 # all includes files/libs must reside in one directory.
191
192 cd include
193 # Standard location for all of JSOC's includes
194 find /home/jsoc/include -maxdepth 1 -name "*.h" -exec ln -sfv {} \;
195 find /home/jsoc/include -mindepth 1 -type d -exec ln -sfv {} \;
196 cd ..
197
198 cd lib
199 # Standard locations for all of JSOC's libraries - x86_64
200 if (!(-d linux_x86_64)) then
201 mkdir linux_x86_64
202 arta 1.27 endif
203
204 cd linux_x86_64
205 find /home/jsoc/lib/linux_x86_64/ -maxdepth 1 -name "*.a" -exec ln -sfv {} \;
206 cd ..
207
208 # Standard locations for all of JSOC's libraries - ia32
209 if (!(-d linux_ia32)) then
210 mkdir linux_ia32
211 endif
212
213 cd linux_ia32
214 find /home/jsoc/lib/linux_ia32/ -maxdepth 1 -name "*.a" -exec ln -sfv {} \;
215 cd ..
216
217 cd ..
|
218 arta 1.14 else
|
219 rick 1.18 # Non-Stanford users: edit these lines to reflect the location of required
220 # 3rd party libs: cfitsio.a
221 ln -sfv /usr/local/include include
222 ln -sfv /usr/local/lib lib
|
223 arta 1.14 endif
224
225 set TPWARN = 0
226
|
227 arta 1.16 # Libraries required by all
|
228 arta 1.20 if ($JSOC_MACHINE == "linux_x86_64") then
229 if (!(-e lib/linux_x86_64/libcfitsio.a)) then
230 echo "Can't find required library: lib/linux_x86_64/libcfitsio.a"
231 set TPWARN = 1
232 endif
|
233 arta 1.14 endif
234
|
235 arta 1.20 if ($JSOC_MACHINE == "linux_ia32") then
236 if (!(-e lib/linux_ia32/libcfitsio.a)) then
237 echo "Can't find required library: lib/linux_ia32/libcfitsio.a"
238 set TPWARN = 1
239 endif
|
240 arta 1.14 endif
241
|
242 arta 1.21 if ($JSOC_MACHINE == "mac_osx") then
243 if (!(-e lib/mac_osx/libcfitsio.a)) then
244 echo "Can't find required library: lib/mac_osx/libcfitsio.a"
245 set TPWARN = 1
246 endif
247 endif
248
|
249 arta 1.16 if (-e ../suflag.txt) then
250 # Stanford users' required libs.
|
251 arta 1.22 if ($JSOC_MACHINE == "linux_x86_64") then
252 if (!(-e lib/linux_x86_64/libfftw3f.a)) then
253 echo "Can't find required library: <JSOCROOT>/lib/linux_x86_64/libfftw3f.a"
254 set TPWARN = 1
255 endif
|
256 arta 1.23 if (!(-e lib/linux_x86_64/libgsl.a)) then
257 echo "Can't find required library: <JSOCROOT>/lib/linux_x86_64/libgsl.a"
258 set TPWARN = 1
259 endif
260 if (!(-e lib/linux_x86_64/libgslcblas.a)) then
261 echo "Can't find required library: <JSOCROOT>/lib/linux_x86_64/libgslcblas.a"
262 set TPWARN = 1
263 endif
|
264 arta 1.16 endif
265
|
266 arta 1.22 if ($JSOC_MACHINE == "linux_ia32") then
267 if (!(-e lib/linux_ia32/libfftw3f.a)) then
268 echo "Can't find required library: <JSOCROOT>/lib/linux_ia32/libfftw3f.a"
269 set TPWARN = 1
270 endif
|
271 arta 1.23 if (!(-e lib/linux_ia32/libgsl.a)) then
272 echo "Can't find required library: <JSOCROOT>/lib/linux_ia32/libgsl.a"
273 set TPWARN = 1
274 endif
275 if (!(-e lib/linux_ia32/libgslcblas.a)) then
276 echo "Can't find required library: <JSOCROOT>/lib/linux_ia32/libgslcblas.a"
277 set TPWARN = 1
278 endif
|
279 arta 1.22 endif
280
281 if ($JSOC_MACHINE == "mac_osx") then
282 if (!(-e lib/mac_osx/libfftw3f.a)) then
283 echo "Can't find required library: <JSOCROOT>/lib/mac_osx/libfftw3f.a"
284 set TPWARN = 1
285 endif
|
286 arta 1.16 endif
287 else
288 # Non-Stanford users' required libs.
|
289 arta 1.14 endif
290
291 if ($TPWARN) then
|
292 arta 1.21 echo "Did you update <JSOCROOT>/configure to create links to installed third-party libraries?"
|
293 arta 1.14 endif
294
295 cd ..
296 echo "done"
297 echo
298
|
299 arta 1.1 # generate links for DSDS/SOI dynamic libraries - only do this if
300 # user's environment has access to /home/soi/CM
301 if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
|
302 arta 1.10 if (-x base/local/libs/dsds/scripts/genlinks.csh) then
303 base/local/libs/dsds/scripts/genlinks.csh
|
304 arta 1.1 endif
305
|
306 arta 1.10 if (-x base/local/libs/soi/scripts/genlinks.csh) then
307 base/local/libs/soi/scripts/genlinks.csh
|
308 arta 1.1 endif
309 endif
310 endif
311 endif
312
313 # Enter required library names and versions here.
314 if ($CHKLIBS == "yes") then
315
316 echo
317 echo "JSOC expects all third-party library header files to be located at $JSOCROOT/lib_third_party/include/ and all third-party libraries to be located at $JSOCROOT/lib_third_party/$JSOC_MACHINE/. If you wish to build a target that uses one of the following third-paty libraries, please install the required library version and create a link from from $JSOCROOT/lib_third_party/include/ and $JSOCROOT/lib_third_party/$JSOC_MACHINE/ to the installed library headers and binary files, respectively."
318 echo
319 echo "Example:"
320 echo " cd $JSOCROOT/lib_third_party/"
321 echo " ln -s /usr/local/include include"
322 echo " cd $JSOCROOT/lib_third_party/$JSOC_MACHINE/"
323 echo " ln -s /usr/local/lib/libfftw3f.a libfftw3f.a "
324 echo
325 echo "Library libfftw3f.a (v. 3.1.2) required for targets: universe, examples, helloworld, xinterp, demo_td08062007"
326 echo "Library libcfitsio.a (v. 3.03) required for targets: universe, examples, f_ingest_gong_mrv, f_dup_gong_mrv"
327
328 # echo "Library libcfitsio.a (v. 3.03) required for targets: examples, helloworld"
329 arta 1.1 # echo "Library libmkl.so (v. 9.0) required for targets: examples, helloworld"
330 # if ($JSOC_MACHINE == "linux_x86_64") then
331 # echo "Library libmkl_lapack64.so (v. 9.0) required for targets: examples, helloworld"
332 # else echo "Library libmkl_lapack32.so (v. 9.0) required for targets: examples, helloworld"
333 # endif
334
335
336 endif
|