[2720] | 1 | #!/bin/csh
|
---|
| 2 | # SOPHYA configuration managment script
|
---|
| 3 | # C. Magneville / R. Ansari - Mai 2005
|
---|
[3357] | 4 | # Updated : 2006, Avr/Mai , Oct 2007
|
---|
[2720] | 5 | # Exemple: ./configure -sbase /laltmp/ansari/sbase/ -scxx cxx -extp /exp/planck/ExtLibs/Include/ \
|
---|
| 6 | # -extp /exp/planck/ExtLibs/OSF1-cxx/
|
---|
| 7 |
|
---|
[2724] | 8 | #----------------------------------------------------------------------
|
---|
| 9 | #### liste des modules
|
---|
[2910] | 10 | set SOPMODOK = ( 1 1 1 1 1 1 1 1 1 )
|
---|
[2720] | 11 | set SOPMOD = ( BaseTools SysTools SUtils TArray NTools HiStats SkyMap Samba SkyT )
|
---|
[2910] | 12 | set ALLSOPLIBS = ( '-lBaseTools' '-lSysTools' '-lSUtils' '-lTArray' '-lNTools' '-lHiStats' '-lSkyMap' '-lSamba' '-lSkyT' )
|
---|
| 13 |
|
---|
| 14 | set SOPPIOK = ( 1 1 1 )
|
---|
[2720] | 15 | set SOPPI = ( PI PIext PIGcont )
|
---|
[2910] | 16 | set ALLPILIBS = ( '-lPI' '-lPIext' '-lPIGcont' )
|
---|
[2720] | 17 |
|
---|
[3180] | 18 | set SOPEXT = ( FitsIOServer IFFTW LinAlg XAstroPack )
|
---|
| 19 | set EXTCURNAME = ( fits fftw lapack astro )
|
---|
| 20 | set SOPEXTOK = ( 1 1 1 1 )
|
---|
| 21 | set EXTINCNAME = ( FitsIO/fitsio.h FFTW/fftw3.h PASDEINC XAstro/astro.h )
|
---|
| 22 | set EXTLIBNAME = ( libcfitsio.a libfftw3.a liblapack.a libxastro.a )
|
---|
| 23 | set ALLEXTLIBS = ( '-lcfitsio' '-lfftw3' '-llapack -lblas' '-lxastro' )
|
---|
[2720] | 24 |
|
---|
[3180] | 25 | #FFTW2: set EXTINCNAME = ( FitsIO/fitsio.h FFTW/fftw.h PASDEINC XAstro/astro.h )
|
---|
| 26 | #FFTW2: set EXTLIBNAME = ( libcfitsio.a libfftw.a liblapack.a libxastro.a )
|
---|
| 27 | #FFTW2: set ALLEXTLIBS = ( '-lcfitsio' '-lfftw -lrfftw' '-llapack -lblas' '-lxastro' )
|
---|
[2720] | 28 |
|
---|
[3001] | 29 | set defextinc = ( /usr/include /usr/local/include )
|
---|
| 30 | set defextlib = ( /usr/lib /usr/local/lib )
|
---|
[2724] | 31 |
|
---|
[3001] | 32 |
|
---|
[2724] | 33 | #----------------------------------------------------------------------
|
---|
| 34 | #### Decodage arguments
|
---|
[2720] | 35 | set cmdline = "$0 $*"
|
---|
| 36 | set extpath
|
---|
[2724] | 37 | set extpathinc
|
---|
| 38 | set extpathlib
|
---|
[2720] | 39 | unset incln
|
---|
| 40 | unset mincname
|
---|
[3818] | 41 | set compopt
|
---|
| 42 | unset arch32
|
---|
[3202] | 43 | unset arch64
|
---|
| 44 | unset sasz64
|
---|
[3753] | 45 | unset ssldble128
|
---|
[3202] | 46 | unset nofpic
|
---|
[3210] | 47 | unset nothsafe
|
---|
[3202] | 48 | unset boundcheck
|
---|
| 49 | unset sodebug
|
---|
[3001] | 50 | unset usefftw2
|
---|
| 51 | unset uselapack2
|
---|
[3357] | 52 | unset alsofftwfloat
|
---|
[3210] | 53 | unset slballinone
|
---|
[2720] | 54 | while ( $#argv > 0 )
|
---|
| 55 |
|
---|
| 56 | if( "$1" == "-h" ) then
|
---|
[3210] | 57 | echo 'configure [-sbase SOPHYABASE] [-scxx SOPHYACXX] [-incln] '
|
---|
| 58 | echo " [-minc mymake.inc] [-compopt 'cc/cxxOptions'] "
|
---|
[3818] | 59 | echo ' [-arch64] [-arch32] [-sasz64] [-ldble128] [-nofpic] [-nothsafe] [-boundcheck] [-sodebug]'
|
---|
[2724] | 60 | echo ' [-extp dir1 -extp dir2 ...] [-extip dir1 -extip dir2 ... ] [-extlp dir1 -extlp dir2 ... ]'
|
---|
[3210] | 61 | echo ' [-noextlib] [-noext fits] [-noext fftw] [-noext lapack] [-noext astro]'
|
---|
| 62 | echo ' [-noPI] [-slballinone]'
|
---|
[3357] | 63 | echo ' [-alsofftwfloat] [-usefftw2] [-uselapack2] '
|
---|
[3210] | 64 | echo ' (See SOPHYA manual/web pages for a detailed description of configure options)'
|
---|
[2720] | 65 | exit -1
|
---|
| 66 | endif
|
---|
| 67 | if( "$1" == "-sbase" ) then
|
---|
| 68 | setenv SOPHYABASE $2
|
---|
| 69 | shift
|
---|
| 70 | endif
|
---|
| 71 | if( "$1" == "-scxx" ) then
|
---|
| 72 | setenv SOPHYACXX $2
|
---|
| 73 | shift
|
---|
| 74 | endif
|
---|
| 75 | if( "$1" == "-incln" ) then
|
---|
| 76 | set incln
|
---|
| 77 | endif
|
---|
[2724] | 78 | if( "$1" == "-minc" ) then
|
---|
| 79 | set mincname = ( $2 )
|
---|
| 80 | shift
|
---|
| 81 | endif
|
---|
[3210] | 82 | if( "$1" == "-compopt" ) then
|
---|
[3223] | 83 | set compopt = ( $2 )
|
---|
[3210] | 84 | shift
|
---|
| 85 | endif
|
---|
[2720] | 86 | if( "$1" == "-extp" ) then
|
---|
| 87 | set extpath = ( $extpath $2 )
|
---|
| 88 | shift
|
---|
| 89 | endif
|
---|
[2724] | 90 | if( "$1" == "-extip" ) then
|
---|
| 91 | set extpathinc = ( $extpathinc $2 )
|
---|
[2720] | 92 | shift
|
---|
| 93 | endif
|
---|
[2724] | 94 | if( "$1" == "-extlp" ) then
|
---|
| 95 | set extpathlib = ( $extpathlib $2 )
|
---|
| 96 | shift
|
---|
| 97 | endif
|
---|
[2739] | 98 | if( "$1" == "-noextlib" ) then
|
---|
| 99 | set i = 0
|
---|
| 100 | while ( $i < $#SOPEXTOK )
|
---|
| 101 | @ i += 1
|
---|
| 102 | set SOPEXTOK[$i] = 0
|
---|
| 103 | end
|
---|
| 104 | endif
|
---|
[2724] | 105 | if( "$1" == "-noext" ) then
|
---|
| 106 | set i = 0
|
---|
| 107 | while ( $i < $#EXTCURNAME )
|
---|
| 108 | @ i += 1
|
---|
| 109 | if( "$2" == "$EXTCURNAME[$i]" ) set SOPEXTOK[$i] = 0
|
---|
| 110 | end
|
---|
| 111 | shift
|
---|
| 112 | endif
|
---|
[3210] | 113 | if( "$1" == "-PI" ) then
|
---|
| 114 | set SOPPIOK = ( 0 0 0 )
|
---|
| 115 | endif
|
---|
[3357] | 116 | if( "$1" == "-alsofftwfloat" ) then
|
---|
| 117 | # On veut la version float de FFTW, en plus de double
|
---|
| 118 | set alsofftwfloat
|
---|
| 119 | set i = 0
|
---|
| 120 | while ( $i < $#EXTCURNAME )
|
---|
| 121 | @ i += 1
|
---|
| 122 | if( "fftw" == "$EXTCURNAME[$i]" ) then
|
---|
| 123 | set ALLEXTLIBS[$i] = '-lfftw3 -lfftw3f'
|
---|
| 124 | endif
|
---|
| 125 | end
|
---|
| 126 | endif
|
---|
[3001] | 127 | if( "$1" == "-usefftw2" ) then
|
---|
| 128 | # version FFTW 2 au lieu de V3
|
---|
| 129 | set usefftw2
|
---|
| 130 | set i = 0
|
---|
| 131 | while ( $i < $#EXTCURNAME )
|
---|
| 132 | @ i += 1
|
---|
| 133 | if( "fftw" == "$EXTCURNAME[$i]" ) then
|
---|
| 134 | set EXTINCNAME[$i] = 'FFTW/fftw.h'
|
---|
| 135 | set EXTLIBNAME[$i] = 'libfftw.a'
|
---|
| 136 | set ALLEXTLIBS[$i] = '-lfftw -lrfftw'
|
---|
| 137 | endif
|
---|
| 138 | end
|
---|
| 139 | endif
|
---|
| 140 | if( "$1" == "-uselapack2" ) then
|
---|
| 141 | # version LAPACK 2 au lieu de V3
|
---|
| 142 | set uselapack2
|
---|
| 143 | endif
|
---|
[3210] | 144 | if( "$1" == "-slballinone" ) then
|
---|
[3001] | 145 | # Pour utiliser une seule librairie libsophyaPIext.so au lieu
|
---|
| 146 | # des 3 libsophya.so libextsophya.so libPI.so
|
---|
[3210] | 147 | set slballinone
|
---|
[3001] | 148 | endif
|
---|
[3202] | 149 | # Decodage options pour flags de machdefs.h
|
---|
[3753] | 150 | # Liste de flags : SO_ARCH64 SO_NOFPIC SO_SASIZET64 SO_LDBLE128 SO_BOUNDCHECKING SOPHYA_DEBUG
|
---|
[3202] | 151 | if( "$1" == "-arch64" ) then
|
---|
| 152 | set arch64
|
---|
[3818] | 153 | unset arch32
|
---|
[3202] | 154 | endif
|
---|
[3818] | 155 | if( "$1" == "-arch32" ) then
|
---|
| 156 | set arch32
|
---|
| 157 | unset arch64
|
---|
| 158 | unset sasz64
|
---|
| 159 | endif
|
---|
[3202] | 160 | if( "$1" == "-sasz64" ) then
|
---|
| 161 | set sasz64
|
---|
| 162 | endif
|
---|
[3753] | 163 | if( "$1" == "-ldble128" ) then
|
---|
| 164 | set ssldble128
|
---|
| 165 | endif
|
---|
[3202] | 166 | if( "$1" == "-nofpic" ) then
|
---|
| 167 | set nofpic
|
---|
| 168 | endif
|
---|
[3210] | 169 | if( "$1" == "-nothsafe" ) then
|
---|
| 170 | set nothsafe
|
---|
| 171 | endif
|
---|
[3202] | 172 | if( "$1" == "-boundcheck" ) then
|
---|
| 173 | set boundcheck
|
---|
| 174 | endif
|
---|
| 175 | if( "$1" == "-sodebug" ) then
|
---|
| 176 | set sodebug
|
---|
| 177 | endif
|
---|
[2720] | 178 |
|
---|
[3202] | 179 |
|
---|
[2720] | 180 | shift
|
---|
| 181 | end
|
---|
| 182 |
|
---|
[3398] | 183 | ## ------ Detection linux 64 bits ---
|
---|
[3397] | 184 | unset linux64
|
---|
[3398] | 185 | if ( `uname` == "Linux" ) then
|
---|
[3397] | 186 | if ( `uname -m` == "x86_64" ) then
|
---|
| 187 | echo ' ... Linux x86_64 (64 bits) ---> -arch64 '
|
---|
| 188 | set linux64
|
---|
| 189 | set arch64
|
---|
| 190 | endif
|
---|
| 191 | endif
|
---|
[2724] | 192 |
|
---|
[3397] | 193 |
|
---|
[2724] | 194 | #----------------------------------------------------------------------
|
---|
| 195 | #### Verification generale
|
---|
[2720] | 196 | if( ! $?SOPHYABASE ) then
|
---|
| 197 | echo ERROR: define SOPHYABASE or use script arguments
|
---|
| 198 | exit -2
|
---|
| 199 | endif
|
---|
| 200 | if( ! $?SOPHYACXX ) then
|
---|
| 201 | echo ERROR: define SOPHYACXX or use script arguments
|
---|
| 202 | echo " SOPHYACXX define the name of the C++ compiler (ex: g++ cxx ...)"
|
---|
| 203 | exit -2
|
---|
| 204 | endif
|
---|
| 205 | if( ! $?TMPDIR ) setenv TMPDIR /tmp
|
---|
| 206 | touch $TMPDIR/tmp_test
|
---|
| 207 | if( $status != 0 ) then
|
---|
| 208 | echo ERROR: no write acces in temporary directory: $TMPDIR
|
---|
| 209 | echo '----> define TMPDIR environment variable: "setenv TMPDIR ..."'
|
---|
| 210 | exit -2
|
---|
| 211 | endif
|
---|
[2724] | 212 | rm -f $TMPDIR/tmp_test
|
---|
[2720] | 213 | if( ! $?mincname ) then
|
---|
| 214 | set mincname = `uname`_${SOPHYACXX}_make.inc
|
---|
| 215 | endif
|
---|
| 216 | if( ! -e $mincname ) then
|
---|
| 217 | echo ERROR: file $mincname NOT found
|
---|
| 218 | exit -2
|
---|
| 219 | endif
|
---|
| 220 | if( ! -e ../BaseTools/machdefs_mkmf.h ) then
|
---|
| 221 | echo ERROR: file machdefs_mkmf.h NOT found in BaseTools
|
---|
| 222 | exit -2
|
---|
| 223 | endif
|
---|
[2724] | 224 | echo SOPEXTOK: $SOPEXTOK
|
---|
[2720] | 225 |
|
---|
[2724] | 226 | #----------------------------------------------------------------------
|
---|
| 227 | #### creation des variables chemins sophya core
|
---|
[2720] | 228 | echo " "
|
---|
| 229 | echo ">>>>>> 1/ Creating directory tree under $SOPHYABASE "
|
---|
| 230 | set sinc = $SOPHYABASE/include
|
---|
| 231 | set slib = $SOPHYABASE/lib
|
---|
| 232 | set sslb = $SOPHYABASE/slb
|
---|
| 233 | set sobj = $SOPHYABASE/obj
|
---|
| 234 | set sexe = $SOPHYABASE/exe
|
---|
| 235 | set sconf = $sinc/SophyaConfInfo
|
---|
| 236 | foreach d ( $sinc $slib $sslb $sobj $sexe $sconf )
|
---|
| 237 | if( ! -d $d ) then
|
---|
| 238 | mkdir $d
|
---|
| 239 | if( $status ) then
|
---|
| 240 | echo ERROR: creation of $d failed
|
---|
| 241 | exit -3
|
---|
| 242 | endif
|
---|
| 243 | echo Directory $d created
|
---|
| 244 | endif
|
---|
| 245 | touch $d/tmp_test
|
---|
| 246 | if( $status ) then
|
---|
| 247 | echo ERROR: no write acces to $d
|
---|
| 248 | exit -4
|
---|
| 249 | endif
|
---|
| 250 | rm -f $d/tmp_test
|
---|
| 251 | end
|
---|
| 252 |
|
---|
[2724] | 253 |
|
---|
| 254 | #----------------------------------------------------------------------
|
---|
| 255 | #### Fichier confinfo - log e configure
|
---|
[2720] | 256 | set conflog = $sconf/conf.log
|
---|
| 257 | rm -f $conflog ; touch $conflog
|
---|
| 258 | echo ' --- Log of SOPHYA configure script - Date= ' `date` >> $conflog
|
---|
| 259 | echo "$cmdline" >> $conflog
|
---|
| 260 | set inclistf = $sconf/include.list
|
---|
| 261 | rm -f $inclistf ; touch $inclistf
|
---|
| 262 |
|
---|
[2724] | 263 |
|
---|
| 264 | #----------------------------------------------------------------------
|
---|
| 265 | #### liens ou copie des *.h
|
---|
[2720] | 266 | echo " "
|
---|
[3001] | 267 | if( $?incln ) then
|
---|
| 268 | echo ">>>>>> 2/ Creating symbolic link for include files in $sinc "
|
---|
| 269 | else
|
---|
| 270 | echo ">>>>>> 2/ Copying include files to $sinc "
|
---|
| 271 | endif
|
---|
| 272 |
|
---|
[2724] | 273 | cd ../ > /dev/null
|
---|
[2720] | 274 | set srcd = `pwd`
|
---|
[2724] | 275 | set cpln = "cp -p "
|
---|
| 276 | if( $?incln ) set cpln = "ln -s -f "
|
---|
[2720] | 277 | foreach d ( $SOPMOD $SOPEXT $SOPPI )
|
---|
[2724] | 278 | if ( -d $srcd/$d ) then
|
---|
[2726] | 279 | if ( $?incln ) then
|
---|
| 280 | echo Creating link to include files for module $d
|
---|
| 281 | else
|
---|
| 282 | echo Copying include files for module $d
|
---|
| 283 | endif
|
---|
| 284 |
|
---|
[2724] | 285 | cd $srcd/$d;
|
---|
[2720] | 286 | set file = ( *.h )
|
---|
[2724] | 287 | cd $sinc; if( $status == 0 ) rm -f $file
|
---|
| 288 | # on vire le .h de $file si .h dans excludeinc du module
|
---|
| 289 | cd $srcd/$d
|
---|
| 290 | if( -e excludeinc ) then
|
---|
| 291 | if( `cat excludeinc | wc -l` > 0 ) then
|
---|
| 292 | set file
|
---|
| 293 | foreach f ( *.h )
|
---|
[2739] | 294 | grep -q "$f:r\.h" excludeinc
|
---|
[2724] | 295 | if( $status != 0 ) set file = ( $file $f )
|
---|
| 296 | end
|
---|
| 297 | endif
|
---|
[2720] | 298 | endif
|
---|
[2724] | 299 | # on copie ou link dans $sinc
|
---|
| 300 | if( `echo $file | wc -w` > 0 ) then
|
---|
| 301 | foreach f ( $file )
|
---|
| 302 | $cpln $srcd/$d/$f $sinc/$f
|
---|
| 303 | end
|
---|
| 304 | endif
|
---|
[2720] | 305 | echo $file >> $inclistf
|
---|
| 306 | endif
|
---|
| 307 | end
|
---|
[3001] | 308 | rm -f $sinc/machdefs_ac.h $sinc/machdefs_mkmf.h
|
---|
[2724] | 309 | cd $srcd/BuildMgr/.
|
---|
[2720] | 310 |
|
---|
| 311 |
|
---|
[2724] | 312 | #----------------------------------------------------------------------
|
---|
| 313 | #### lien des .h des librairies externes
|
---|
[2720] | 314 | echo " "
|
---|
| 315 | echo ">>>>>> 3/ Include files for external libraries "
|
---|
| 316 | set i = 0
|
---|
| 317 | while ( $i < $#SOPEXT )
|
---|
| 318 | @ i += 1
|
---|
| 319 | if( "$EXTINCNAME[$i]" == "PASDEINC" ) continue
|
---|
| 320 | if( $SOPEXTOK[$i] <= 0 ) continue
|
---|
| 321 | set nom = $EXTINCNAME[$i]:t
|
---|
| 322 | set rac = $EXTINCNAME[$i]:h
|
---|
| 323 | if( -d ../$SOPEXT[$i] ) then
|
---|
| 324 | echo "Searching include file for $SOPEXT[$i] ..."
|
---|
[2724] | 325 | foreach d ( $extpathinc $extpath $defextinc )
|
---|
[2772] | 326 | set duminc = `find $d -name $nom -print -follow | head -1 `
|
---|
[2720] | 327 | set dumrep = $duminc:h
|
---|
| 328 | if ( "$dumrep" != "" ) then
|
---|
| 329 | rm -f $sinc/$rac
|
---|
| 330 | ln -f -s $dumrep $sinc/$rac
|
---|
| 331 | echo Includes for $SOPEXT[$i] found in $dumrep
|
---|
| 332 | break
|
---|
| 333 | endif
|
---|
| 334 | end
|
---|
| 335 | if ( "$dumrep" == "" ) then
|
---|
| 336 | echo WARNING: Includes for $SOPEXT[$i] NOT found
|
---|
| 337 | echo " Compilation of module $SOPEXT[$i] disabled"
|
---|
| 338 | set SOPEXTOK[$i] = 0
|
---|
| 339 | endif
|
---|
| 340 | endif
|
---|
| 341 | end
|
---|
| 342 |
|
---|
[2724] | 343 |
|
---|
| 344 | #----------------------------------------------------------------------
|
---|
| 345 | #### liens des librairies externes
|
---|
[2720] | 346 | echo " "
|
---|
[2910] | 347 | echo ">>>>>> 4.1/ External libraries "
|
---|
[2720] | 348 | set fpath = $TMPDIR/fpath
|
---|
| 349 | rm -f $fpath; touch $fpath
|
---|
| 350 | set extliblib
|
---|
| 351 | set i = 0
|
---|
| 352 | while ( $i < $#SOPEXT )
|
---|
| 353 | @ i += 1
|
---|
| 354 | if( "$EXTLIBNAME[$i]" == "PASDELIB" ) continue
|
---|
| 355 | if( $SOPEXTOK[$i] <= 0 ) continue
|
---|
| 356 | set nom = $EXTLIBNAME[$i]
|
---|
| 357 | if( -d ../$SOPEXT[$i] ) then
|
---|
| 358 | echo "Searching libraries path for $SOPEXT[$i] ..."
|
---|
[2724] | 359 | foreach d ( $extpathlib $extpath $defextlib )
|
---|
[2772] | 360 | set dumlib = `find $d -name $nom -print -follow | head -1 `
|
---|
[2720] | 361 | if ( "$dumlib" != "" ) then
|
---|
| 362 | echo "-L$dumlib:h" >> $fpath
|
---|
| 363 | set extliblib = ( $extliblib $ALLEXTLIBS[$i] )
|
---|
| 364 | break
|
---|
| 365 | endif
|
---|
| 366 | end
|
---|
| 367 | if ( "$dumlib" == "" ) then
|
---|
| 368 | echo WARNING: Libraries for $SOPEXT[$i] NOT found
|
---|
| 369 | echo " Check the generated make.inc file"
|
---|
| 370 | endif
|
---|
| 371 | endif
|
---|
| 372 | end
|
---|
| 373 | set extlibpath = `cat $fpath | sort -u`
|
---|
| 374 | echo extlibpath= $extlibpath
|
---|
| 375 | echo extliblib= $extliblib
|
---|
[2724] | 376 | rm -f $fpath
|
---|
[2720] | 377 |
|
---|
[2724] | 378 |
|
---|
| 379 | #----------------------------------------------------------------------
|
---|
[2910] | 380 | #### Identification des librairies archives Sophya
|
---|
| 381 | echo " "
|
---|
| 382 | echo ">>>>>> 4.2/ Sophya libraries archives "
|
---|
| 383 | set sopmodlib
|
---|
| 384 | set i = 0
|
---|
| 385 | while ( $i < $#SOPMOD )
|
---|
| 386 | @ i += 1
|
---|
| 387 | if( $SOPMODOK[$i] <= 0 ) continue
|
---|
| 388 | if( -d ../$SOPMOD[$i] ) then
|
---|
| 389 | set sopmodlib = ( $sopmodlib $ALLSOPLIBS[$i] )
|
---|
| 390 | else
|
---|
| 391 | echo "WARNING: module "$SOPMOD[$i]" not found"
|
---|
| 392 | endif
|
---|
| 393 | end
|
---|
| 394 | echo sopmodlib= $sopmodlib
|
---|
| 395 |
|
---|
| 396 | echo " "
|
---|
| 397 | echo ">>>>>> 4.3/ PI-Sophya libraries archives "
|
---|
| 398 | set soppilib
|
---|
| 399 | set i = 0
|
---|
| 400 | while ( $i < $#SOPPI )
|
---|
| 401 | @ i += 1
|
---|
| 402 | if( $SOPPIOK[$i] <= 0 ) continue
|
---|
| 403 | if( -d ../$SOPPI[$i] ) then
|
---|
| 404 | set soppilib = ( $soppilib $ALLPILIBS[$i] )
|
---|
| 405 | else
|
---|
| 406 | echo "WARNING: module "$SOPPI[$i]" not found"
|
---|
| 407 | endif
|
---|
| 408 | end
|
---|
| 409 | echo soppilib= $soppilib
|
---|
| 410 |
|
---|
| 411 | #----------------------------------------------------------------------
|
---|
[2724] | 412 | #### Generation de sophyamake.inc
|
---|
| 413 | # On le cree dans le repertoire temporaire d'abord
|
---|
[2720] | 414 | set mfile = $sinc/sophyamake.inc
|
---|
[2724] | 415 | rm -f $mfile
|
---|
[2720] | 416 | echo " "
|
---|
[2724] | 417 | echo ">>>>>> 5/ Creating $mfile from $mincname "
|
---|
[2720] | 418 | echo "# -----------------------------------------------" > $mfile
|
---|
| 419 | echo "# File make.inc - generated by SOPHYA configure" >> $mfile
|
---|
| 420 | echo "# Date" `date` >> $mfile
|
---|
| 421 | echo "# Seed file : $mincname " >> $mfile
|
---|
| 422 | echo "# -----------------------------------------------" >> $mfile
|
---|
| 423 | echo " " >> $mfile
|
---|
| 424 | echo "# SOPHYA Base installation directory " >> $mfile
|
---|
| 425 | echo "SOPHYABASE = $SOPHYABASE" >> $mfile
|
---|
| 426 | echo " " >> $mfile
|
---|
| 427 | echo 'SOPHYAINCP = $(SOPHYABASE)/include/' >> $mfile
|
---|
| 428 | echo 'SOPHYAOBJP = $(SOPHYABASE)/obj/' >> $mfile
|
---|
| 429 | echo 'SOPHYALIBP = $(SOPHYABASE)/lib/' >> $mfile
|
---|
| 430 | echo 'SOPHYASLBP = $(SOPHYABASE)/slb/' >> $mfile
|
---|
| 431 | echo 'SOPHYAEXEP = $(SOPHYABASE)/exe/' >> $mfile
|
---|
| 432 |
|
---|
| 433 | echo " " >> $mfile
|
---|
[2910] | 434 | echo "# module libraries " >> $mfile
|
---|
| 435 | echo "SOPMODLIBLIST = $sopmodlib" >> $mfile
|
---|
| 436 |
|
---|
| 437 | echo " " >> $mfile
|
---|
[2720] | 438 | echo "# External libraries PATH " >> $mfile
|
---|
| 439 | echo "SOPEXTLIBP = $extlibpath" >> $mfile
|
---|
| 440 | echo "SOPEXTLIBLIST = $extliblib" >> $mfile
|
---|
| 441 |
|
---|
| 442 | echo " " >> $mfile
|
---|
[2910] | 443 | echo "# PI libraries " >> $mfile
|
---|
| 444 | echo "SOPPILIBLIST = $soppilib" >> $mfile
|
---|
| 445 |
|
---|
| 446 | echo " " >> $mfile
|
---|
[3210] | 447 | cat $mincname >> $mfile
|
---|
[2720] | 448 |
|
---|
[3210] | 449 | # --- Gestion des flags modifiants les options de compilation et liste de librairies (par sed)
|
---|
[3224] | 450 | set sname = `uname`
|
---|
[3670] | 451 | set sprgfile = $TMPDIR/compop.scom
|
---|
| 452 | rm -f $sprgfile
|
---|
[3398] | 453 | echo '{' > $sprgfile
|
---|
[3223] | 454 | set scmd = "/FLAGS/s/CNFPHFLF/ $compopt/g"
|
---|
[3224] | 455 | if ( $?arch64 ) then
|
---|
[3210] | 456 | set a64cf = ' '
|
---|
[3224] | 457 | if ( ( "$sname" == "IRIX64" ) && ("$SOPHYACXX" == "CC" ) ) set a64cf = '-64'
|
---|
[3227] | 458 | if ( "$sname" == "AIX" ) then
|
---|
| 459 | if ( ("$SOPHYACXX" == "xlC" ) || ("$SOPHYACXX" == "xlc" ) ) set a64cf = '-q64'
|
---|
[3230] | 460 | echo "/ARFLAGS/s/-rcs/-rcs -X 64/" >> $sprgfile
|
---|
[3227] | 461 | endif
|
---|
[3223] | 462 | set scmd = "/FLAGS/s/CNFPHFLF/$a64cf $compopt/g"
|
---|
[3210] | 463 | endif
|
---|
[3818] | 464 | if ( $?arch32 ) then
|
---|
| 465 | set a32cf = ' '
|
---|
| 466 | if ( ( "$sname" == "Linux" ) && ("$SOPHYACXX" == "g++" ) ) set a32cf = '-m32'
|
---|
| 467 | if ( "$sname" == "AIX" ) then
|
---|
| 468 | if ( ("$SOPHYACXX" == "xlC" ) || ("$SOPHYACXX" == "xlc" ) ) set a32cf = '-q32'
|
---|
| 469 | endif
|
---|
| 470 | set scmd = "/FLAGS/s/CNFPHFLF/$a32cf $compopt/g"
|
---|
| 471 | endif
|
---|
| 472 |
|
---|
[3398] | 473 | echo $scmd >> $sprgfile
|
---|
[3210] | 474 | if ( $?nofpic ) echo "s/-fPIC/ /g" >> $sprgfile
|
---|
| 475 | if( $?slballinone ) then
|
---|
[3223] | 476 | echo "/SOPHYAALLSLBLIST/s/-lPI -lextsophya -lsophya/-lAsophyaextPI/" >> $sprgfile
|
---|
| 477 | echo "/SOPHYAEXTSLBLIST/s/-lextsophya -lsophya/-lAsophyaextPI/" >> $sprgfile
|
---|
[3210] | 478 | endif
|
---|
[3397] | 479 | if ( $?linux64 ) then
|
---|
[3398] | 480 | echo "s?-L/usr/X11R6/lib?-L/usr/X11R6/lib64?g" >> $sprgfile
|
---|
[3397] | 481 | endif
|
---|
[3398] | 482 | echo '}' >> $sprgfile
|
---|
[3210] | 483 | set mftmp = $TMPDIR/sopmake.inc
|
---|
| 484 | cp $mfile $mftmp
|
---|
[3670] | 485 | rm -f $mfile
|
---|
[3210] | 486 | sed -f $sprgfile $mftmp > $mfile
|
---|
| 487 | rm -f $sprgfile $mftmp
|
---|
| 488 | # --- FIN de gestion des flags modifiants les options de compilation (par sed)
|
---|
| 489 |
|
---|
[2724] | 490 | rm -f $mfile:t
|
---|
[2720] | 491 | ln -s $mfile $mfile:t
|
---|
| 492 |
|
---|
[2724] | 493 |
|
---|
| 494 | #----------------------------------------------------------------------
|
---|
| 495 | #### Copie de machdefs.h
|
---|
[2720] | 496 | set mdefname = $TMPDIR/machdefs.h
|
---|
| 497 | echo " "
|
---|
[3001] | 498 | echo ">>>>>> 6.a/ Creating machdefs.h from BaseTools/machdefs_mkmf.h"
|
---|
[2720] | 499 | rm -f $mdefname; touch $mdefname
|
---|
| 500 | echo "/*** machdefs.h generated by SOPHYA configure ***/" >> $mdefname
|
---|
| 501 | echo "#ifndef MACHDEFS_SEEN" >> $mdefname
|
---|
| 502 | echo "#define MACHDEFS_SEEN" >> $mdefname
|
---|
| 503 | echo "/*------ Code generation switch ---- */" >> $mdefname
|
---|
| 504 | echo "/* System selector (uname) */" >> $mdefname
|
---|
[3224] | 505 | # Fait avant - set sname = `uname`
|
---|
[2720] | 506 | echo "#ifndef $sname" >> $mdefname
|
---|
| 507 | echo "#define $sname 1 " >> $mdefname
|
---|
| 508 | echo "#endif" >> $mdefname
|
---|
[3202] | 509 |
|
---|
[3210] | 510 | ## Definition de flags de compilation en fonction des options de configure
|
---|
[3202] | 511 | if ( $?arch64 ) echo "#define SO_ARCH64 1" >> $mdefname
|
---|
[3210] | 512 | if ( $?sasz64 ) echo "#define SO_SASIZET64 1" >> $mdefname
|
---|
[3753] | 513 | if ( $?ssldble128 ) echo "#define SO_LDBLE128 1" >> $mdefname
|
---|
[3202] | 514 | if ( $?nofpic ) echo "#define SO_NOFPIC 1" >> $mdefname
|
---|
[3210] | 515 | if ( $?nothsafe ) echo "#define SO_NOTHSAFE 1" >> $mdefname
|
---|
[3202] | 516 | if ( $?boundcheck ) echo "#define SO_BOUNDCHECKING 1" >> $mdefname
|
---|
| 517 | if ( $?sodebug ) echo "#define SOPHYA_DEBUG 1" >> $mdefname
|
---|
| 518 |
|
---|
[2772] | 519 | if ( "$sname" == "IRIX64" ) then
|
---|
| 520 | if ( "$SOPHYACXX" == "CC" ) then
|
---|
| 521 | # __SGICC__ : flag indiquant que c'est le compilo CC de SGI
|
---|
| 522 | echo "#define __SGICC__ 1" >> $mdefname
|
---|
| 523 | endif
|
---|
| 524 | endif
|
---|
[2724] | 525 |
|
---|
[2720] | 526 |
|
---|
[2724] | 527 | echo " " >> $mdefname
|
---|
| 528 | grep -v -e '#ifndef *MACHDEFS_SEEN' -e '#define *MACHDEFS_SEEN' ../BaseTools/machdefs_mkmf.h >> $mdefname
|
---|
[2720] | 529 | # On ne copie que si machdefs.h est different
|
---|
| 530 | if (-e $sinc/machdefs.h ) then
|
---|
| 531 | diff $mdefname $sinc/machdefs.h >& /dev/null
|
---|
| 532 | if ($status != 0) then
|
---|
| 533 | cp -f -p $mdefname $sinc/machdefs.h
|
---|
| 534 | echo " file $sinc/machdefs.h changed -> replaced"
|
---|
| 535 | else
|
---|
| 536 | echo " file $sinc/machdefs.h has not changed -> kept"
|
---|
| 537 | endif
|
---|
| 538 | else
|
---|
| 539 | cp -f -p $mdefname $sinc/machdefs.h
|
---|
| 540 | echo " file $sinc/machdefs.h created"
|
---|
| 541 | endif
|
---|
[2724] | 542 | rm -f $mdefname
|
---|
[2720] | 543 |
|
---|
| 544 |
|
---|
[3001] | 545 | #### Creation de sspvflags.h
|
---|
| 546 | echo " "
|
---|
| 547 | echo ">>>>>> 6.b/ Creating $sinc/sspvflags.h "
|
---|
| 548 | rm -f $sinc/sspvflags.h; touch $sinc/sspvflags.h
|
---|
| 549 |
|
---|
| 550 | echo "#ifndef SSPVFLAGS_SEEN" >> $sinc/sspvflags.h
|
---|
| 551 | echo "#define SSPVFLAGS_SEEN" >> $sinc/sspvflags.h
|
---|
| 552 | echo " " >> $sinc/sspvflags.h
|
---|
| 553 | echo "/*------ External libraries no-use flag ---- */" >> $sinc/sspvflags.h
|
---|
| 554 | set i = 0
|
---|
| 555 | while ( $i < $#SOPEXTOK )
|
---|
| 556 | @ i += 1
|
---|
| 557 | if( $SOPEXTOK[$i] > 0 ) continue
|
---|
| 558 | echo "#define SOPHYA_NO_$SOPEXT[$i]" >> $sinc/sspvflags.h
|
---|
| 559 | end
|
---|
| 560 |
|
---|
| 561 | echo " " >> $sinc/sspvflags.h
|
---|
[3357] | 562 | echo "/*------ SOPOHYA/ExtLibsvVersion selection flags ---- */" >> $sinc/sspvflags.h
|
---|
| 563 | echo " " >> $sinc/sspvflags.h
|
---|
| 564 | if( $?alsofftwfloat ) then
|
---|
| 565 | echo "/*-- Compile ALSO float version of FFTWServer methods -- */" >> $sinc/sspvflags.h
|
---|
| 566 | echo "#define ALSO_FFTW_FLOAT_EXTSOP" >> $sinc/sspvflags.h
|
---|
| 567 | endif
|
---|
[3001] | 568 | if( $?usefftw2 ) then
|
---|
[3357] | 569 | echo "/*-- Use FFTW V2 instead of V3 -- */" >> $sinc/sspvflags.h
|
---|
[3001] | 570 | echo "#define FFTW_V2_EXTSOP" >> $sinc/sspvflags.h
|
---|
| 571 | endif
|
---|
| 572 | if( $?uselapack2 ) then
|
---|
[3357] | 573 | echo "/*-- Use LAPACK V2 instead of V3 -- */" >> $sinc/sspvflags.h
|
---|
[3001] | 574 | echo "#define LAPACK_V2_EXTSOP" >> $sinc/sspvflags.h
|
---|
| 575 | endif
|
---|
| 576 | echo " " >> $sinc/sspvflags.h
|
---|
[3210] | 577 | if( $?slballinone ) then
|
---|
[3357] | 578 | echo "/*------ Use of single shared lib for SOPHYA+extlibs+PI ---- */" >> $sinc/sspvflags.h
|
---|
[3210] | 579 | echo "#define SO_SLBALLINONE " >> $sinc/sspvflags.h
|
---|
[3001] | 580 | endif
|
---|
| 581 | echo " " >> $sinc/sspvflags.h
|
---|
| 582 | echo "#endif " >> $sinc/sspvflags.h
|
---|
| 583 |
|
---|
| 584 |
|
---|
[2724] | 585 | #----------------------------------------------------------------------
|
---|
| 586 | #### Creation des fichiers contenant les listes d'objets et d'includes
|
---|
[2720] | 587 | echo " "
|
---|
| 588 | echo ">>>>>> 7/ Creating object list files for shared library creation "
|
---|
| 589 | set objlistname = $sconf/libsophya.objlist
|
---|
| 590 | echo " 7.a/ Creating $objlistname "
|
---|
[2724] | 591 | rm -f $objlistname ; touch $objlistname
|
---|
[2751] | 592 | foreach d ( $SOPMOD )
|
---|
| 593 | rm -f $sconf/$d.conf
|
---|
| 594 | if ( ! -d ../$d ) continue
|
---|
| 595 | cat ../$d/objlist.list >> $objlistname
|
---|
| 596 | touch $sconf/$d.conf
|
---|
[2720] | 597 | end
|
---|
| 598 |
|
---|
| 599 | set objlistname = $sconf/libextsophya.objlist
|
---|
| 600 | echo " 7.b/ Creating $objlistname "
|
---|
[2724] | 601 | rm -f $objlistname ; touch $objlistname
|
---|
[2739] | 602 | set i = 0
|
---|
| 603 | while ( $i < $#SOPEXT )
|
---|
| 604 | @ i += 1
|
---|
[2751] | 605 | set d = $SOPEXT[$i]
|
---|
| 606 | rm -f $sconf/$d.conf
|
---|
[2739] | 607 | if( $SOPEXTOK[$i] <= 0 ) continue
|
---|
| 608 | if ( ! -d ../$d ) continue
|
---|
| 609 | cat ../$d/objlist.list >> $objlistname
|
---|
[2751] | 610 | touch $sconf/$d.conf
|
---|
[2739] | 611 | end
|
---|
[2720] | 612 |
|
---|
| 613 | set objlistname = $sconf/libPI.objlist
|
---|
| 614 | echo " 7.c/ Creating $objlistname "
|
---|
[2724] | 615 | rm -f $objlistname ; touch $objlistname
|
---|
[3210] | 616 | set i = 0
|
---|
| 617 | while ( $i < $#SOPPI )
|
---|
| 618 | @ i += 1
|
---|
| 619 | set d = $SOPPI[$i]
|
---|
[2751] | 620 | rm -f $sconf/$d.conf
|
---|
[3210] | 621 | if( $SOPPIOK[$i] <= 0 ) continue
|
---|
[2751] | 622 | if ( ! -d ../$d ) continue
|
---|
| 623 | cat ../$d/objlist.list >> $objlistname
|
---|
| 624 | touch $sconf/$d.conf
|
---|
[2720] | 625 | end
|
---|
[2724] | 626 |
|
---|
| 627 |
|
---|
| 628 | #----------------------------------------------------------------------
|
---|
| 629 | exit 0
|
---|