1 arta 1.1 #! /bin/csh -f
2
|
3 arta 1.48 rm custom.mk
4
|
5 arta 1.26 # set up $JSOC_MACHINE
6 set JSOC_MACHINE = `build/jsoc_machine.csh`
7 echo "Machine type is $JSOC_MACHINE"
8 echo ""
|
9 arta 1.24
|
10 arta 1.1 set CLEAN = "no"
11 set CHKLIBS = "no"
12 set CCMD = "c"
13 set LCMD = "l"
14
15 foreach ARG ($argv)
16 set FLAG = `echo $ARG | awk '{print substr($0, 2)}'`
17 if ($FLAG == $CCMD) then
18 set CLEAN = "yes"
19 else if ($FLAG == $LCMD) then
20 set CHKLIBS = "yes"
21 endif
22 end
23
24 if ($CHKLIBS == "no") then
|
25 arta 1.5 echo -n "Remove links for local project configuration..."
|
26 arta 1.47 if (-d proj) then
27 cd proj
28 if (-e configure) then
29 rm configure
30 endif
31 if (-e make_basic.mk) then
32 rm make_basic.mk
33 endif
34 if (-e Rules.mk) then
35 rm Rules.mk
36 endif
37 if (-e target.mk) then
38 rm target.mk
39 endif
40 cd ..
41 endif
|
42 arta 1.5 echo "done"
43
|
44 arta 1.1 echo -n "Remove links to man pages..."
|
45 arta 1.47 if (-e man) then
46 rm -rf man
47 endif
|
48 arta 1.1 echo "done"
49
50 echo -n "Removing links to headers..."
|
51 arta 1.10 if (-d base/include) then
|
52 arta 1.47 cd base/include
53 find . -name "*.h" -exec rm {} \;
54 cd ../..
|
55 arta 1.1 endif
|
56 arta 1.19
57 if (-d include) then
|
58 arta 1.47 cd include
59 find . -name "*.h" -exec rm {} \;
60 cd ..
|
61 arta 1.19 endif
|
62 arta 1.1 echo "done"
63
64 echo -n "Removing links to scripts..."
65 if (-d scripts) then
|
66 arta 1.47 cd scripts
67 find . -name "*" -exec rm {} \;
68 cd ..
|
69 arta 1.1 endif
70 echo "done"
71
72 echo -n "Removing links to jsds..."
73 if (-d jsds) then
|
74 arta 1.47 cd jsds
75 find . -name "*" -exec rm {} \;
76 cd ..
|
77 arta 1.1 endif
78 echo "done"
79
|
80 arta 1.14 echo -n "Removing links to third-party libraries..."
81 if (-d lib_third_party) then
82 rm -rf lib_third_party
83 endif
84 echo "done"
85
|
86 arta 1.1 echo
87
88 if ($CLEAN == "yes") then
|
89 arta 1.10 if (-x base/local/libs/dsds/scripts/rmlinks.csh) then
90 base/local/libs/dsds/scripts/rmlinks.csh
|
91 arta 1.1 endif
92
|
93 arta 1.10 if (-x base/local/libs/soi/scripts/rmlinks.csh) then
94 base/local/libs/soi/scripts/rmlinks.csh
|
95 arta 1.1 endif
96 else
|
97 arta 1.5 echo -n "Setting links for local project configuration..."
|
98 arta 1.6 if (-e suflag.txt) then
|
99 arta 1.10 cd proj
100 ln -sf ../projconf/su/configure configure
101 ln -sf ../projconf/su/make_basic.mk make_basic.mk
102 ln -sf ../projconf/su/Rules.mk Rules.mk
103 ln -sf ../projconf/su/target.mk target.mk
104 cd ..
|
105 arta 1.6 else
|
106 arta 1.10 cd proj
107 ln -sf ../projconf/ex/configure configure
108 ln -sf ../projconf/ex/make_basic.mk make_basic.mk
109 ln -sf ../projconf/ex/Rules.mk Rules.mk
110 ln -sf ../projconf/ex/target.mk target.mk
111 cd ..
|
112 arta 1.5 endif
113 echo "done"
114
|
115 arta 1.13 echo "Setting links to man pages..."
116 if (-d /home/jsoc/man) then
117 if (!(-e man)) then
118 ln -s /home/jsoc/man man
119 endif
120 endif
|
121 arta 1.1 echo "done"
122
123 echo "Setting links to headers..."
|
124 arta 1.10 if (!(-d base/include)) then
125 mkdir -p base/include
|
126 arta 1.1 endif
|
127 arta 1.10 cd base/include
|
128 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" \; \)
|
129 arta 1.10 cd ../..
|
130 arta 1.19
|
131 arta 1.47 if (!(-d include)) then
132 mkdir -p include
133 endif
|
134 arta 1.19 cd include
135 if (-d ../base/include) then
136 find ../base/include -name \*.h -exec ln -s {} . \;
137 endif
138 cd ..
|
139 arta 1.1 echo "done"
140 echo
141
142 echo "Setting links to scripts..."
|
143 arta 1.47 if (!(-d scripts)) then
144 mkdir scripts
145 endif
|
146 arta 1.1 cd scripts
|
147 arta 1.3
148 # Sums scripts
|
149 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" \;
|
150 arta 1.3
151 # Util scripts
|
152 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" \;
|
153 arta 1.3
|
154 arta 1.9 # DRMS / IDL-interface scripts
|
155 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" \;
|
156 arta 1.9
|
157 arta 1.4 # Project-specific scripts - these won't show up if you don't have the project source.
|
158 arta 1.10 if (-x ../proj/configure) then
159 ../proj/configure
|
160 arta 1.4 endif
|
161 arta 1.3
|
162 arta 1.1 cd ..
163 echo "done"
164 echo
165
166 echo "Setting links to jsds..."
|
167 arta 1.47 if (!(-d jsds)) then
168 mkdir jsds
169 endif
|
170 arta 1.1 cd jsds
|
171 arta 1.10 find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o \( -name \*.jsd -exec echo " " {} " ERROR - couldn't create link" \; \)
|
172 arta 1.1 cd ..
173 echo "done"
174 echo
|
175 arta 1.14 # Set links to third-party libraries
176 echo "Setting links to third-party libraries"
|
177 arta 1.47 if (!(-d lib_third_party)) then
178 mkdir lib_third_party
179 endif
|
180 arta 1.14 cd lib_third_party
181
182 if (-e ../suflag.txt) then
|
183 arta 1.47 if (!(-d include)) then
184 mkdir include
185 endif
186
187 if (!(-d lib)) then
188 mkdir lib
189 endif
|
190 arta 1.27
191 # Don't make a link directly from include/lib to a directory, else
192 # all includes files/libs must reside in one directory.
193
194 cd include
195 # Standard location for all of JSOC's includes
196 find /home/jsoc/include -maxdepth 1 -name "*.h" -exec ln -sfv {} \;
197 find /home/jsoc/include -mindepth 1 -type d -exec ln -sfv {} \;
198 cd ..
199
200 cd lib
201 # Standard locations for all of JSOC's libraries - x86_64
|
202 arta 1.47 if (!(-d linux_x86_64)) then
203 mkdir linux_x86_64
204 endif
|
205 arta 1.27
206 cd linux_x86_64
207 find /home/jsoc/lib/linux_x86_64/ -maxdepth 1 -name "*.a" -exec ln -sfv {} \;
208 cd ..
209
210 # Standard locations for all of JSOC's libraries - ia32
|
211 arta 1.47 if (!(-d linux_ia32)) then
212 mkdir linux_ia32
213 endif
|
214 arta 1.27
215 cd linux_ia32
216 find /home/jsoc/lib/linux_ia32/ -maxdepth 1 -name "*.a" -exec ln -sfv {} \;
217 cd ..
218
219 cd ..
|
220 arta 1.35 #else
|
221 rick 1.18 # Non-Stanford users: edit these lines to reflect the location of required
222 # 3rd party libs: cfitsio.a
|
223 arta 1.35 #ln -sfv /usr/local/include include
224 #if (!(-d lib)) mkdir lib
225 #ln -sfv /usr/local/lib lib/$JSOC_MACHINE
|
226 arta 1.36 endif
|
227 arta 1.14
228 cd ..
|
229 arta 1.31
230 # Set custom make file to tell the make system that the gcc cfitsio library is called
231 # libcfitsio_gcc.a
232 if (-e suflag.txt) then
|
233 arta 1.48 echo "CFITSIOFNAME_GCC_X86_64 = cfitsio_gcc" >> custom.mk
|
234 arta 1.31 endif
235
|
236 arta 1.32 # Make customizations - ensure changes here are synchronized to changes in make_basic.mk
237 if (!(-e suflag.txt)) then
238 # put compilation customizations here
239 # echo "DRMS_DEFAULT_RETENTION = -10" >> custom.mk
240 endif
241
|
242 arta 1.14 echo "done"
243 echo
244
|
245 arta 1.1 # generate links for DSDS/SOI dynamic libraries - only do this if
246 # user's environment has access to /home/soi/CM
247 if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
|
248 arta 1.10 if (-x base/local/libs/dsds/scripts/genlinks.csh) then
249 base/local/libs/dsds/scripts/genlinks.csh
|
250 arta 1.1 endif
251
|
252 arta 1.10 if (-x base/local/libs/soi/scripts/genlinks.csh) then
253 base/local/libs/soi/scripts/genlinks.csh
|
254 arta 1.1 endif
255 endif
256 endif
257 endif
258
259 # Enter required library names and versions here.
260 if ($CHKLIBS == "yes") then
261
|
262 arta 1.44 echo
263 echo "JSOC expects all third-party library header files to be located at"
264 echo " $JSOCROOT/lib_third_party/include/"
265 echo " and all third-party libraries to be located at
266 echo " $JSOCROOT/lib_third_party/$JSOC_MACHINE/"
267 echo " If you wish to build a target that uses one of the following"
268 echo " third-party libraries, please install the required library version"
269 echo " and create a link from from"
270 echo " $JSOCROOT/lib_third_party/include/"
271 echo " and $JSOCROOT/lib_third_party/$JSOC_MACHINE/"
272 echo " to the installed library headers and binary files, respectively."
273 echo
274 echo "Example:"
275 echo " cd $JSOCROOT/lib_third_party/"
276 echo " ln -s /usr/local/include include"
277 echo " cd $JSOCROOT/lib_third_party/$JSOC_MACHINE/"
278 echo " ln -s /usr/local/lib/libfftw3f.a libfftw3f.a "
279 echo
280 echo "Library libfftw3f.a (v. 3.1.2) required for targets: universe, examples, helloworld, xinterp, demo_td08062007"
281 echo "Library libcfitsio.a (v. 3.03) required for targets: universe, examples, f_ingest_gong_mrv, f_dup_gong_mrv"
|
282 arta 1.1
283 # echo "Library libcfitsio.a (v. 3.03) required for targets: examples, helloworld"
284 # echo "Library libmkl.so (v. 9.0) required for targets: examples, helloworld"
285 # if ($JSOC_MACHINE == "linux_x86_64") then
286 # echo "Library libmkl_lapack64.so (v. 9.0) required for targets: examples, helloworld"
287 # else echo "Library libmkl_lapack32.so (v. 9.0) required for targets: examples, helloworld"
288 # endif
289
290
291 endif
|
292 arta 1.33
|
293 arta 1.37 # Site Localization
|
294 arta 1.33 if (!(-e suflag.txt)) then
|
295 arta 1.44 if (!(-e config.local)) then
296 echo "Error: config.local not found. If you have a saved version of this"
297 echo " file from a previous installation, you should copy that into"
298 echo " this directory and rerun configure. Otherwise, copy the file"
299 echo " config.local.template to config.local and edit the config.local"
300 echo " file to contain site-appropriate values."
301 echo
302 echo "*** IMPORTANT *** The edited config.local will contain site-specific"
303 echo " values that should not be modified during subsequent updates to"
|
304 rick 1.45 echo " NetDRMS. Keep a safe copy of it somewhere outside of the DRMS"
|
305 arta 1.44 echo " directory tree, for example in /usr/local. After each NetDRMS"
306 echo " update, ensure this file is in place."
307 else
308 echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> custom.mk
309 ./gen_init.csh
310 endif
|
311 arta 1.33 endif
|
312 arta 1.39
|
313 arta 1.44 # Check for required libraries (must happen after localization, which might
314 # set links to such libraries
|
315 arta 1.39 set TPWARN = 0
316
317 # Libraries required by all
|
318 arta 1.47 if ($JSOC_MACHINE == "linux_x86_64") then
319 if (!(-e lib_third_party/lib/linux_x86_64/libcfitsio.a)) then
320 echo
321 echo "Can't find required library: lib_third_party/lib/linux_x86_64/libcfitsio.a"
322 set TPWARN = 1
323 endif
|
324 arta 1.39 endif
325
|
326 arta 1.47 if ($JSOC_MACHINE == "linux_ia32") then
327 if (!(-e lib_third_party/lib/linux_ia32/libcfitsio.a)) then
328 echo
329 echo "Can't find required library: lib_third_party/lib/linux_ia32/libcfitsio.a"
330 set TPWARN = 1
331 endif
332 endif
|
333 rick 1.46
|
334 arta 1.47 if ($JSOC_MACHINE == "mac_osx") then
335 if (!(-e lib_third_party/lib/mac_osx/libcfitsio.a)) then
|
336 arta 1.43 echo
|
337 arta 1.47 echo "Can't find required library: lib_third_party/lib/mac_osx/libcfitsio.a"
338 set TPWARN = 1
|
339 arta 1.39 endif
|
340 arta 1.47 endif
|
341 arta 1.39
|
342 arta 1.47 if (-e ../suflag.txt) then
343 # Stanford users' required libs.
|
344 arta 1.39 if ($JSOC_MACHINE == "linux_x86_64") then
|
345 arta 1.40 if (!(-e lib_third_party/lib/linux_x86_64/libcfitsio_gcc.a)) then
|
346 arta 1.43 echo
|
347 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_x86_64/libcfitsio_gcc.a"
|
348 arta 1.39 set TPWARN = 1
349 endif
|
350 arta 1.47 if (!(-e lib_third_party/lib/linux_x86_64/libfftw3f.a)) then
351 echo
352 echo "Can't find required library: lib_third_party/lib/linux_x86_64/libfftw3f.a"
353 set TPWARN = 1
354 endif
|
355 arta 1.40 if (!(-e lib_third_party/lib/linux_x86_64/libgsl.a)) then
|
356 arta 1.43 echo
|
357 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_x86_64/libgsl.a"
|
358 arta 1.39 set TPWARN = 1
359 endif
|
360 arta 1.40 if (!(-e lib_third_party/lib/linux_x86_64/libgslcblas.a)) then
|
361 arta 1.43 echo
|
362 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_x86_64/libgslcblas.a"
|
363 arta 1.39 set TPWARN = 1
364 endif
365 endif
366
367 if ($JSOC_MACHINE == "linux_ia32") then
|
368 arta 1.47 if (!(-e lib_third_party/lib/linux_ia32/libfftw3f.a)) then
369 echo
370 echo "Can't find required library: lib_third_party/lib/linux_ia32/libfftw3f.a"
371 set TPWARN = 1
372 endif
|
373 arta 1.40 if (!(-e lib_third_party/lib/linux_ia32/libgsl.a)) then
|
374 arta 1.43 echo
|
375 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_ia32/libgsl.a"
|
376 arta 1.39 set TPWARN = 1
377 endif
|
378 arta 1.40 if (!(-e lib_third_party/lib/linux_ia32/libgslcblas.a)) then
|
379 arta 1.43 echo
|
380 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_ia32/libgslcblas.a"
|
381 arta 1.39 set TPWARN = 1
382 endif
383 endif
384
|
385 arta 1.47 if ($JSOC_MACHINE == "mac_osx") then
386 if (!(-e lib_third_party/lib/mac_osx/libfftw3f.a)) then
387 echo
388 echo "Can't find required library: lib_third_party/lib/mac_osx/libfftw3f.a"
389 set TPWARN = 1
390 endif
|
391 arta 1.39 endif
392 endif
393
394 if ($TPWARN) then
395 echo "Did you update config.local to create links to installed third-party libraries?"
396 endif
|
397 arta 1.48
398 # Customize compilers
|
399 arta 1.50 # echo "JSOC_COMPILER = gcc" >> custom.mk
400 # echo "JSOC_FCOMPILER = gfortran" >> custom.mk
|
401 arta 1.48
402 # run perl script to do even more configuration
|
403 jsoc 1.49 ./moreconfigure.pl -fcustom.mk
|