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.17 ln -sfv /home/jsoc/include include
182 ln -sfv /home/jsoc/lib lib
|
183 arta 1.14 else
|
184 rick 1.18 # Non-Stanford users: edit these lines to reflect the location of required
185 # 3rd party libs: cfitsio.a
186 ln -sfv /usr/local/include include
187 ln -sfv /usr/local/lib lib
|
188 arta 1.14 endif
189
190 set TPWARN = 0
191
|
192 arta 1.16 # Libraries required by all
|
193 arta 1.20 if ($JSOC_MACHINE == "linux_x86_64") then
194 if (!(-e lib/linux_x86_64/libcfitsio.a)) then
195 echo "Can't find required library: lib/linux_x86_64/libcfitsio.a"
196 set TPWARN = 1
197 endif
|
198 arta 1.14 endif
199
|
200 arta 1.20 if ($JSOC_MACHINE == "linux_ia32") then
201 if (!(-e lib/linux_ia32/libcfitsio.a)) then
202 echo "Can't find required library: lib/linux_ia32/libcfitsio.a"
203 set TPWARN = 1
204 endif
|
205 arta 1.14 endif
206
|
207 arta 1.21 if ($JSOC_MACHINE == "mac_osx") then
208 if (!(-e lib/mac_osx/libcfitsio.a)) then
209 echo "Can't find required library: lib/mac_osx/libcfitsio.a"
210 set TPWARN = 1
211 endif
212 endif
213
|
214 arta 1.16 if (-e ../suflag.txt) then
215 # Stanford users' required libs.
|
216 arta 1.22 if ($JSOC_MACHINE == "linux_x86_64") then
217 if (!(-e lib/linux_x86_64/libfftw3f.a)) then
218 echo "Can't find required library: <JSOCROOT>/lib/linux_x86_64/libfftw3f.a"
219 set TPWARN = 1
220 endif
|
221 arta 1.23 if (!(-e lib/linux_x86_64/libgsl.a)) then
222 echo "Can't find required library: <JSOCROOT>/lib/linux_x86_64/libgsl.a"
223 set TPWARN = 1
224 endif
225 if (!(-e lib/linux_x86_64/libgslcblas.a)) then
226 echo "Can't find required library: <JSOCROOT>/lib/linux_x86_64/libgslcblas.a"
227 set TPWARN = 1
228 endif
|
229 arta 1.16 endif
230
|
231 arta 1.22 if ($JSOC_MACHINE == "linux_ia32") then
232 if (!(-e lib/linux_ia32/libfftw3f.a)) then
233 echo "Can't find required library: <JSOCROOT>/lib/linux_ia32/libfftw3f.a"
234 set TPWARN = 1
235 endif
|
236 arta 1.23 if (!(-e lib/linux_ia32/libgsl.a)) then
237 echo "Can't find required library: <JSOCROOT>/lib/linux_ia32/libgsl.a"
238 set TPWARN = 1
239 endif
240 if (!(-e lib/linux_ia32/libgslcblas.a)) then
241 echo "Can't find required library: <JSOCROOT>/lib/linux_ia32/libgslcblas.a"
242 set TPWARN = 1
243 endif
|
244 arta 1.22 endif
245
246 if ($JSOC_MACHINE == "mac_osx") then
247 if (!(-e lib/mac_osx/libfftw3f.a)) then
248 echo "Can't find required library: <JSOCROOT>/lib/mac_osx/libfftw3f.a"
249 set TPWARN = 1
250 endif
|
251 arta 1.16 endif
252 else
253 # Non-Stanford users' required libs.
|
254 arta 1.14 endif
255
256 if ($TPWARN) then
|
257 arta 1.21 echo "Did you update <JSOCROOT>/configure to create links to installed third-party libraries?"
|
258 arta 1.14 endif
259
260 cd ..
261 echo "done"
262 echo
263
|
264 arta 1.1 # generate links for DSDS/SOI dynamic libraries - only do this if
265 # user's environment has access to /home/soi/CM
266 if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
|
267 arta 1.10 if (-x base/local/libs/dsds/scripts/genlinks.csh) then
268 base/local/libs/dsds/scripts/genlinks.csh
|
269 arta 1.1 endif
270
|
271 arta 1.10 if (-x base/local/libs/soi/scripts/genlinks.csh) then
272 base/local/libs/soi/scripts/genlinks.csh
|
273 arta 1.1 endif
274 endif
275 endif
276 endif
277
278 # Enter required library names and versions here.
279 if ($CHKLIBS == "yes") then
280
281 echo
282 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."
283 echo
284 echo "Example:"
285 echo " cd $JSOCROOT/lib_third_party/"
286 echo " ln -s /usr/local/include include"
287 echo " cd $JSOCROOT/lib_third_party/$JSOC_MACHINE/"
288 echo " ln -s /usr/local/lib/libfftw3f.a libfftw3f.a "
289 echo
290 echo "Library libfftw3f.a (v. 3.1.2) required for targets: universe, examples, helloworld, xinterp, demo_td08062007"
291 echo "Library libcfitsio.a (v. 3.03) required for targets: universe, examples, f_ingest_gong_mrv, f_dup_gong_mrv"
292
293 # echo "Library libcfitsio.a (v. 3.03) required for targets: examples, helloworld"
294 arta 1.1 # echo "Library libmkl.so (v. 9.0) required for targets: examples, helloworld"
295 # if ($JSOC_MACHINE == "linux_x86_64") then
296 # echo "Library libmkl_lapack64.so (v. 9.0) required for targets: examples, helloworld"
297 # else echo "Library libmkl_lapack32.so (v. 9.0) required for targets: examples, helloworld"
298 # endif
299
300
301 endif
|