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