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