(file) Return to configure CVS log (file) (dir) Up to [Development] / JSOC

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

Karen Tian
Powered by
ViewCVS 0.9.4