ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/configure
Revision: 1.43
Committed: Fri Jan 30 19:21:23 2009 UTC (14 years, 7 months ago) by arta
Branch: MAIN
CVS Tags: NetDRMS_Ver_2-0a, Ver_5-0
Changes since 1.42: +12 -1 lines
Log Message:
Changes to warning provided to user if they do not have a config.local file in place.

File Contents

# User Rev Content
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     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.35 #else
219 rick 1.18 # Non-Stanford users: edit these lines to reflect the location of required
220     # 3rd party libs: cfitsio.a
221 arta 1.35 #ln -sfv /usr/local/include include
222     #if (!(-d lib)) mkdir lib
223     #ln -sfv /usr/local/lib lib/$JSOC_MACHINE
224 arta 1.36 endif
225 arta 1.14
226     cd ..
227 arta 1.31
228     # Set custom make file to tell the make system that the gcc cfitsio library is called
229     # libcfitsio_gcc.a
230     if (-e suflag.txt) then
231     echo "CFITSIOFNAME_GCC_X86_64 = cfitsio_gcc" > custom.mk
232     endif
233    
234 arta 1.32 # Make customizations - ensure changes here are synchronized to changes in make_basic.mk
235     if (!(-e suflag.txt)) then
236     # put compilation customizations here
237     # echo "DRMS_DEFAULT_RETENTION = -10" >> custom.mk
238     endif
239    
240 arta 1.14 echo "done"
241     echo
242    
243 arta 1.1 # generate links for DSDS/SOI dynamic libraries - only do this if
244     # user's environment has access to /home/soi/CM
245     if (-d /home/soi/CM/include && -d /home/soi/CM/src) then
246 arta 1.10 if (-x base/local/libs/dsds/scripts/genlinks.csh) then
247     base/local/libs/dsds/scripts/genlinks.csh
248 arta 1.1 endif
249    
250 arta 1.10 if (-x base/local/libs/soi/scripts/genlinks.csh) then
251     base/local/libs/soi/scripts/genlinks.csh
252 arta 1.1 endif
253     endif
254     endif
255     endif
256    
257     # Enter required library names and versions here.
258     if ($CHKLIBS == "yes") then
259    
260     echo
261     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."
262     echo
263     echo "Example:"
264     echo " cd $JSOCROOT/lib_third_party/"
265     echo " ln -s /usr/local/include include"
266     echo " cd $JSOCROOT/lib_third_party/$JSOC_MACHINE/"
267     echo " ln -s /usr/local/lib/libfftw3f.a libfftw3f.a "
268     echo
269     echo "Library libfftw3f.a (v. 3.1.2) required for targets: universe, examples, helloworld, xinterp, demo_td08062007"
270     echo "Library libcfitsio.a (v. 3.03) required for targets: universe, examples, f_ingest_gong_mrv, f_dup_gong_mrv"
271    
272     # echo "Library libcfitsio.a (v. 3.03) required for targets: examples, helloworld"
273     # echo "Library libmkl.so (v. 9.0) required for targets: examples, helloworld"
274     # if ($JSOC_MACHINE == "linux_x86_64") then
275     # echo "Library libmkl_lapack64.so (v. 9.0) required for targets: examples, helloworld"
276     # else echo "Library libmkl_lapack32.so (v. 9.0) required for targets: examples, helloworld"
277     # endif
278    
279    
280     endif
281 arta 1.33
282 arta 1.37 # Site Localization
283 arta 1.33 if (!(-e suflag.txt)) then
284 arta 1.38 if (!(-e config.local)) then
285 arta 1.42 echo "Error: config.local not found. If you have a saved version of this file from a previous installation, you should copy that into this directory and rerun configure. Otherwise, copy the file config.local.template to config.local and edit the config.local file to contain site-appropriate values."
286 arta 1.43 echo
287 arta 1.41 echo "*** IMPORTANT *** The edited config.local will contain site-specific values that should not be modified during subsequent updates to NetDRMS. Keep a safe copy of it somewhere outside of the DRMS directory tree, for example in /usr/local. After each NetDRMS update, ensure this file is in place."
288 arta 1.37 else
289     echo "CUSTOM_DEFINES = __LOCALIZED_DEFS__" >> custom.mk
290     ./gen_init.csh
291     endif
292 arta 1.33 endif
293 arta 1.39
294     # Check for required libraries (must happen after localization, which might set links to such libraries
295     set TPWARN = 0
296    
297     # Libraries required by all
298     if ($JSOC_MACHINE == "linux_x86_64") then
299 arta 1.40 if (!(-e lib_third_party/lib/linux_x86_64/libcfitsio.a)) then
300 arta 1.43 echo
301 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_x86_64/libcfitsio.a"
302 arta 1.39 set TPWARN = 1
303     endif
304     endif
305    
306     if ($JSOC_MACHINE == "linux_ia32") then
307 arta 1.40 if (!(-e lib_third_party/lib/linux_ia32/libcfitsio.a)) then
308 arta 1.43 echo
309 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_ia32/libcfitsio.a"
310 arta 1.39 set TPWARN = 1
311     endif
312     endif
313    
314     if ($JSOC_MACHINE == "mac_osx") then
315 arta 1.40 if (!(-e lib_third_party/lib/mac_osx/libcfitsio.a)) then
316 arta 1.43 echo
317 arta 1.40 echo "Can't find required library: lib_third_party/lib/mac_osx/libcfitsio.a"
318 arta 1.39 set TPWARN = 1
319     endif
320     endif
321    
322     if (-e ../suflag.txt) then
323     # Stanford users' required libs.
324     if ($JSOC_MACHINE == "linux_x86_64") then
325 arta 1.40 if (!(-e lib_third_party/lib/linux_x86_64/libcfitsio_gcc.a)) then
326 arta 1.43 echo
327 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_x86_64/libcfitsio_gcc.a"
328 arta 1.39 set TPWARN = 1
329     endif
330 arta 1.40 if (!(-e lib_third_party/lib/linux_x86_64/libfftw3f.a)) then
331 arta 1.43 echo
332 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_x86_64/libfftw3f.a"
333 arta 1.39 set TPWARN = 1
334     endif
335 arta 1.40 if (!(-e lib_third_party/lib/linux_x86_64/libgsl.a)) then
336 arta 1.43 echo
337 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_x86_64/libgsl.a"
338 arta 1.39 set TPWARN = 1
339     endif
340 arta 1.40 if (!(-e lib_third_party/lib/linux_x86_64/libgslcblas.a)) then
341 arta 1.43 echo
342 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_x86_64/libgslcblas.a"
343 arta 1.39 set TPWARN = 1
344     endif
345     endif
346    
347     if ($JSOC_MACHINE == "linux_ia32") then
348 arta 1.40 if (!(-e lib_third_party/lib/linux_ia32/libfftw3f.a)) then
349 arta 1.43 echo
350 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_ia32/libfftw3f.a"
351 arta 1.39 set TPWARN = 1
352     endif
353 arta 1.40 if (!(-e lib_third_party/lib/linux_ia32/libgsl.a)) then
354 arta 1.43 echo
355 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_ia32/libgsl.a"
356 arta 1.39 set TPWARN = 1
357     endif
358 arta 1.40 if (!(-e lib_third_party/lib/linux_ia32/libgslcblas.a)) then
359 arta 1.43 echo
360 arta 1.40 echo "Can't find required library: lib_third_party/lib/linux_ia32/libgslcblas.a"
361 arta 1.39 set TPWARN = 1
362     endif
363     endif
364    
365     if ($JSOC_MACHINE == "mac_osx") then
366 arta 1.40 if (!(-e lib_third_party/lib/mac_osx/libfftw3f.a)) then
367 arta 1.43 echo
368 arta 1.40 echo "Can't find required library: lib_third_party/lib/mac_osx/libfftw3f.a"
369 arta 1.39 set TPWARN = 1
370     endif
371     endif
372     endif
373    
374     if ($TPWARN) then
375     echo "Did you update config.local to create links to installed third-party libraries?"
376     endif