ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/configure
Revision: 1.36
Committed: Thu Jan 29 19:53:12 2009 UTC (14 years, 7 months ago) by arta
Branch: MAIN
Changes since 1.35: +1 -1 lines
Log Message:
accidentally remoted an endif - put it back

File Contents

# Content
1 #! /bin/csh -f
2
3 # set up $JSOC_MACHINE
4 set JSOC_MACHINE = `build/jsoc_machine.csh`
5 echo "Machine type is $JSOC_MACHINE"
6 echo ""
7
8 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 echo -n "Remove links for local project configuration..."
24 if (-d proj) then
25 cd proj
26 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 cd ..
39 endif
40 echo "done"
41
42 echo -n "Remove links to man pages..."
43 if (-e man) then
44 rm -rf man
45 endif
46 echo "done"
47
48 echo -n "Removing links to headers..."
49 if (-d base/include) then
50 cd base/include
51 find . -name "*.h" -exec rm {} \;
52 cd ../..
53 endif
54
55 if (-d include) then
56 cd include
57 find . -name "*.h" -exec rm {} \;
58 cd ..
59 endif
60 echo "done"
61
62 echo -n "Removing links to scripts..."
63 if (-d scripts) then
64 cd scripts
65 find . -name "*" -exec rm {} \;
66 cd ..
67 endif
68 echo "done"
69
70 echo -n "Removing links to jsds..."
71 if (-d jsds) then
72 cd jsds
73 find . -name "*" -exec rm {} \;
74 cd ..
75 endif
76 echo "done"
77
78 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 echo
85
86 if ($CLEAN == "yes") then
87 if (-x base/local/libs/dsds/scripts/rmlinks.csh) then
88 base/local/libs/dsds/scripts/rmlinks.csh
89 endif
90
91 if (-x base/local/libs/soi/scripts/rmlinks.csh) then
92 base/local/libs/soi/scripts/rmlinks.csh
93 endif
94 else
95 echo -n "Setting links for local project configuration..."
96 if (-e suflag.txt) then
97 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 else
104 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 endif
111 echo "done"
112
113 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 echo "done"
120
121 echo "Setting links to headers..."
122 if (!(-d base/include)) then
123 mkdir -p base/include
124 endif
125 cd base/include
126 find .. -path '../include' -prune -o -name \*.h \( \( -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o -exec echo " " {} " ERROR - couldn't create link" \; \)
127 cd ../..
128
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 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
146 # Sums scripts
147 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
149 # Util scripts
150 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
152 # DRMS / IDL-interface scripts
153 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
155 # Project-specific scripts - these won't show up if you don't have the project source.
156 if (-x ../proj/configure) then
157 ../proj/configure
158 endif
159
160 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 find ../base \( -name \*.jsd -exec ln -s {} . \; -a -exec echo " " {} " OK" \; \) -o \( -name \*.jsd -exec echo " " {} " ERROR - couldn't create link" \; \)
170 cd ..
171 echo "done"
172 echo
173 # Set links to third-party libraries
174 echo "Setting links to third-party libraries"
175 if (!(-d lib_third_party)) then
176 mkdir lib_third_party
177 endif
178 cd lib_third_party
179
180 if (-e ../suflag.txt) then
181 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 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 #else
219 # 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 #if (!(-d lib)) mkdir lib
223 #ln -sfv /usr/local/lib lib/$JSOC_MACHINE
224 endif
225
226 set TPWARN = 0
227
228 # Libraries required by all
229 if ($JSOC_MACHINE == "linux_x86_64") then
230 if (!(-e lib/linux_x86_64/libcfitsio.a)) then
231 echo "Can't find required library: lib/linux_x86_64/libcfitsio.a"
232 set TPWARN = 1
233 endif
234 endif
235
236 if ($JSOC_MACHINE == "linux_ia32") then
237 if (!(-e lib/linux_ia32/libcfitsio.a)) then
238 echo "Can't find required library: lib/linux_ia32/libcfitsio.a"
239 set TPWARN = 1
240 endif
241 endif
242
243 if ($JSOC_MACHINE == "mac_osx") then
244 if (!(-e lib/mac_osx/libcfitsio.a)) then
245 echo "Can't find required library: lib/mac_osx/libcfitsio.a"
246 set TPWARN = 1
247 endif
248 endif
249
250 if (-e ../suflag.txt) then
251 # Stanford users' required libs.
252 if ($JSOC_MACHINE == "linux_x86_64") then
253 if (!(-e lib/linux_x86_64/libcfitsio_gcc.a)) then
254 echo "Can't find required library: lib/linux_x86_64/libcfitsio_gcc.a"
255 set TPWARN = 1
256 endif
257 if (!(-e lib/linux_x86_64/libfftw3f.a)) then
258 echo "Can't find required library: lib/linux_x86_64/libfftw3f.a"
259 set TPWARN = 1
260 endif
261 if (!(-e lib/linux_x86_64/libgsl.a)) then
262 echo "Can't find required library: lib/linux_x86_64/libgsl.a"
263 set TPWARN = 1
264 endif
265 if (!(-e lib/linux_x86_64/libgslcblas.a)) then
266 echo "Can't find required library: lib/linux_x86_64/libgslcblas.a"
267 set TPWARN = 1
268 endif
269 endif
270
271 if ($JSOC_MACHINE == "linux_ia32") then
272 if (!(-e lib/linux_ia32/libfftw3f.a)) then
273 echo "Can't find required library: lib/linux_ia32/libfftw3f.a"
274 set TPWARN = 1
275 endif
276 if (!(-e lib/linux_ia32/libgsl.a)) then
277 echo "Can't find required library: lib/linux_ia32/libgsl.a"
278 set TPWARN = 1
279 endif
280 if (!(-e lib/linux_ia32/libgslcblas.a)) then
281 echo "Can't find required library: lib/linux_ia32/libgslcblas.a"
282 set TPWARN = 1
283 endif
284 endif
285
286 if ($JSOC_MACHINE == "mac_osx") then
287 if (!(-e lib/mac_osx/libfftw3f.a)) then
288 echo "Can't find required library: lib/mac_osx/libfftw3f.a"
289 set TPWARN = 1
290 endif
291 endif
292 else
293 # Non-Stanford users' required libs.
294 endif
295
296 if ($TPWARN) then
297 echo "Did you update configure to create links to installed third-party libraries?"
298 endif
299
300 cd ..
301
302 # Set custom make file to tell the make system that the gcc cfitsio library is called
303 # libcfitsio_gcc.a
304 if (-e suflag.txt) then
305 echo "CFITSIOFNAME_GCC_X86_64 = cfitsio_gcc" > custom.mk
306 endif
307
308 # Make customizations - ensure changes here are synchronized to changes in make_basic.mk
309 if (!(-e suflag.txt)) then
310 # put compilation customizations here
311 # echo "DRMS_DEFAULT_RETENTION = -10" >> custom.mk
312 endif
313
314 echo "done"
315 echo
316
317 # generate links for DSDS/SOI dynamic libraries - only do this if
318 # user's environment has access to /home/soi/CM
319 if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
320 if (-x base/local/libs/dsds/scripts/genlinks.csh) then
321 base/local/libs/dsds/scripts/genlinks.csh
322 endif
323
324 if (-x base/local/libs/soi/scripts/genlinks.csh) then
325 base/local/libs/soi/scripts/genlinks.csh
326 endif
327 endif
328 endif
329 endif
330
331 # Enter required library names and versions here.
332 if ($CHKLIBS == "yes") then
333
334 echo
335 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."
336 echo
337 echo "Example:"
338 echo " cd $JSOCROOT/lib_third_party/"
339 echo " ln -s /usr/local/include include"
340 echo " cd $JSOCROOT/lib_third_party/$JSOC_MACHINE/"
341 echo " ln -s /usr/local/lib/libfftw3f.a libfftw3f.a "
342 echo
343 echo "Library libfftw3f.a (v. 3.1.2) required for targets: universe, examples, helloworld, xinterp, demo_td08062007"
344 echo "Library libcfitsio.a (v. 3.03) required for targets: universe, examples, f_ingest_gong_mrv, f_dup_gong_mrv"
345
346 # echo "Library libcfitsio.a (v. 3.03) required for targets: examples, helloworld"
347 # echo "Library libmkl.so (v. 9.0) required for targets: examples, helloworld"
348 # if ($JSOC_MACHINE == "linux_x86_64") then
349 # echo "Library libmkl_lapack64.so (v. 9.0) required for targets: examples, helloworld"
350 # else echo "Library libmkl_lapack32.so (v. 9.0) required for targets: examples, helloworld"
351 # endif
352
353
354 endif
355
356 # Call gen_init.csh to generate localized scripts and localization.h
357 if (!(-e suflag.txt)) then
358 echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> custom.mk
359 ./gen_init.csh
360 endif