| 1 |
#!/bin/csh -f |
| 2 |
######################################################################## |
| 3 |
# This is a "makefile generator" for the doris software. It creates |
| 4 |
# a makefile for compilation of the Doris source code. Follow the |
| 5 |
# on the screen please. |
| 6 |
# |
| 7 |
# For CYGWIN: change the first line to "tcsh -f". (Download tcsh from |
| 8 |
# ------ redhat site, together with the develop package.) |
| 9 |
# |
| 10 |
######################################################################### |
| 11 |
# based on interactive questions, and ls commands. |
| 12 |
#%// BK 24-Aug-2000 |
| 13 |
# Added check for strptime |
| 14 |
#%// BK 08-Mar-2001 |
| 15 |
# Changed name of script to "configure". |
| 16 |
# Added big endian check. |
| 17 |
#%// BK 19-Apr-2001 |
| 18 |
# Added large file support and -Wno-deprecated warnings |
| 19 |
#%// PM 18-Aug-2004 |
| 20 |
# Added more path options for fftw.higher versions and different compilers |
| 21 |
#%// PM 01-Sep-2004 |
| 22 |
# baseline.doris.sh and baseline.doris.csh |
| 23 |
#%// PM 15-Feb-2007 |
| 24 |
# Added compilation and linking of Triangulate |
| 25 |
#%// FvL 02-OKT-2007 |
| 26 |
# Added check .so for fftw and libsearch dir as /usr/lib64 |
| 27 |
#%// MA 02-Mar-2009 |
| 28 |
# Update testorbit build |
| 29 |
#%// MA 22-May-2009 |
| 30 |
# |
| 31 |
|
| 32 |
if ( -x /bin/clear ) /bin/clear |
| 33 |
#set PRG = `basename "$0"` |
| 34 |
set PRG = "configure" |
| 35 |
set VER = "v1.7, DEOS software" |
| 36 |
set AUT = "TUDelft, 19-May-2009" |
| 37 |
set MAKEFILE = "Makefile" |
| 38 |
|
| 39 |
|
| 40 |
echo "$PRG $VER, $AUT" |
| 41 |
echo " " |
| 42 |
echo " Welcome to the Makefile generator for the Doris insar software." |
| 43 |
echo " I will ask you some questions on compilers, etc." |
| 44 |
echo " The output of this program is a makefile named: $MAKEFILE" |
| 45 |
echo " that you can use to compile Doris." |
| 46 |
echo " More instructions will follow afterwards. (Please read them.)" |
| 47 |
echo " " |
| 48 |
echo "===> Press enter to continue." |
| 49 |
set key = $< |
| 50 |
|
| 51 |
|
| 52 |
# Declare variables. |
| 53 |
set CC = "" |
| 54 |
set GppCOMPILER = n |
| 55 |
set FFTW = n |
| 56 |
set VECLIB = n |
| 57 |
set LAPACK = n |
| 58 |
set X86 = n |
| 59 |
set DEBUG = n |
| 60 |
set FFTWLIBDIR = "" |
| 61 |
set FFTWINCLDIR = "" |
| 62 |
set VECLIBDIR = "" |
| 63 |
set LAPACKDIR = "" |
| 64 |
set LIBDIRS = "../fftw-3.2.1/lib ../../fftw-3.2.1/lib /lib /lib64 /usr/lib /usr/lib64 /usr/lib32 /usr/local/lib" |
| 65 |
### for fftw include dirs, assume they installed it with doris distributed. |
| 66 |
### by doing what we said in install. |
| 67 |
set INCLDIRS = "../fftw-3.2.1/include ../../fftw-3.2.1/include /include /usr/include /usr/local/include" |
| 68 |
set DEFINSTALLDIR = "/home/dummy/bin" |
| 69 |
if ( ! -d $DEFINSTALLDIR ) set DEFINSTALLDIR = "/usr/local/bin" |
| 70 |
if ( ! -d $DEFINSTALLDIR ) set DEFINSTALLDIR = "../bin" |
| 71 |
|
| 72 |
# |
| 73 |
set TMPDIR = "/tmp" |
| 74 |
if ( ! -w $TMPDIR ) set TMPDIR = . |
| 75 |
echo " Using temp dir: $TMPDIR" |
| 76 |
|
| 77 |
|
| 78 |
# Get most likely compiler, first check g++ |
| 79 |
foreach TMPCC ( g++ g++-3.4 g++-4.0 g++-4.1 g++-4.2 g++-4.3 CC aCC icpc ) |
| 80 |
echo Checking compiler: \"$TMPCC\"... |
| 81 |
$TMPCC -v > & /dev/null |
| 82 |
if ( ! $status ) then |
| 83 |
echo " I found a working(?) compiler: $TMPCC" |
| 84 |
set CC = "$TMPCC" |
| 85 |
break |
| 86 |
endif |
| 87 |
end |
| 88 |
|
| 89 |
|
| 90 |
# |
| 91 |
# Set flag for g++, this define enables some functions like sqr(int) |
| 92 |
# that are not standard C++, but were provided with, e.g., HP aCC compiler. |
| 93 |
# |
| 94 |
if ( "$CC" == "g++" ) set GppCOMPILER = "y" |
| 95 |
|
| 96 |
|
| 97 |
# |
| 98 |
# Check little Endian integers: |
| 99 |
# Compile this program and run it. |
| 100 |
# |
| 101 |
set TSTPRG = "$TMPDIR/Doris_endian" |
| 102 |
echo "Checking endianness for integers..." |
| 103 |
echo "Creating test program: $TSTPRG.cc" |
| 104 |
cat << __EOFDH > $TSTPRG.cc |
| 105 |
/* *** Test program to find out if little endian *** */ |
| 106 |
/* * Generated by Doris software install script * */ |
| 107 |
/* * Exits with 0 if big, 1 if little endian integer. * */ |
| 108 |
/* *** Bert Kampes, 19-Apr-2001 *** */ |
| 109 |
// #include <ctime> |
| 110 |
int main() |
| 111 |
{ |
| 112 |
int i; |
| 113 |
int littleendian=0;// thus big assumed |
| 114 |
char test[64]={0}; |
| 115 |
for (i=0;i<32;i++) test[i]=0; |
| 116 |
test[0]=0x01; |
| 117 |
if (0x0001==*(int *)(&test[0])) littleendian=1; |
| 118 |
return littleendian; |
| 119 |
} |
| 120 |
__EOFDH |
| 121 |
echo "Compiling test program: $TSTPRG" |
| 122 |
$CC $TSTPRG.cc -o $TSTPRG > & /dev/null |
| 123 |
if ( $status != 0 ) then |
| 124 |
echo " ---------------------------------------------------------------" |
| 125 |
echo " Sorry, could not compile test program, continuing." |
| 126 |
echo " THIS WILL LIKELY CAUSE TROUBLE IF YOUR COMPILER DOESN'T WORK" |
| 127 |
echo " Please change endianness interactively in a moment if required." |
| 128 |
echo " ---------------------------------------------------------------" |
| 129 |
echo " " |
| 130 |
set X86 = "n" |
| 131 |
endif |
| 132 |
echo "Running test program: $TSTPRG" |
| 133 |
if ( -x $TSTPRG ) then |
| 134 |
$TSTPRG > & /dev/null |
| 135 |
if ( $status != 0 ) then |
| 136 |
set X86 = "y" |
| 137 |
echo " Your system seems Little Endian, using -D__X86PROCESSOR__" |
| 138 |
echo " (or program failed to execute for another reason)" |
| 139 |
else |
| 140 |
echo " Your system is Big Endian (not using a define)." |
| 141 |
endif |
| 142 |
rm -f $TSTPRG.cc $TSTPRG.o $TSTPRG |
| 143 |
endif |
| 144 |
echo " " |
| 145 |
|
| 146 |
|
| 147 |
# |
| 148 |
# Check library function strptime works: |
| 149 |
# |
| 150 |
echo "Checking whether library function strptime works ok..." |
| 151 |
set STRPTIME = "1" |
| 152 |
set TSTPRG = "$TMPDIR/Doris_strptime" |
| 153 |
echo "Creating test program: $TSTPRG.cc" |
| 154 |
cat << __EOFDH > $TSTPRG.cc |
| 155 |
/* *** Test program to find out if function strptime works *** */ |
| 156 |
/* * Generated by Doris software install script * */ |
| 157 |
/* *** Bert Kampes, 14-Mar-2001 *** */ |
| 158 |
//#include <iostream> |
| 159 |
// #include <time.h> |
| 160 |
#include <ctime> |
| 161 |
int main() |
| 162 |
{ |
| 163 |
struct tm tm_ref; |
| 164 |
char utc_ref[100] = "05-JAN-1985 01:02:03.000"; |
| 165 |
strptime(utc_ref,"%d-%b-%Y %T",&tm_ref); |
| 166 |
int status = 0; |
| 167 |
if (tm_ref.tm_mday != 5) status=1; |
| 168 |
if (tm_ref.tm_mon != 0) status=1; |
| 169 |
if (tm_ref.tm_year != 85) status=1; |
| 170 |
if (tm_ref.tm_hour != 1) status=1; |
| 171 |
if (tm_ref.tm_min != 2) status=1; |
| 172 |
if (tm_ref.tm_sec != 3) status=1; |
| 173 |
//cerr << "tm_ref.tm_mday: " << tm_ref.tm_mday << endl; |
| 174 |
return status; |
| 175 |
} |
| 176 |
__EOFDH |
| 177 |
echo "Compiling test program: $TSTPRG" |
| 178 |
$CC $TSTPRG.cc -o $TSTPRG > & /dev/null |
| 179 |
if ( $status != 0 ) then |
| 180 |
echo " function strptime not found in library, using internal definition." |
| 181 |
echo " by define -D__NO_STRPTIME (change by editing DEF8 in $MAKEFILE)" |
| 182 |
set STRPTIME = "0" |
| 183 |
endif |
| 184 |
echo "Running test program: $TSTPRG" |
| 185 |
if ( -x $TSTPRG ) then |
| 186 |
$TSTPRG > & /dev/null |
| 187 |
if ( $status != 0 ) then |
| 188 |
echo " strptime does not work properly, using internal definition." |
| 189 |
echo " by define -D__NO_STRPTIME (change by editing DEF8 in $MAKEFILE)" |
| 190 |
echo " (or program failed to execute for another reason)" |
| 191 |
set STRPTIME = "0" |
| 192 |
else |
| 193 |
rm -f $TSTPRG.cc $TSTPRG.o $TSTPRG |
| 194 |
endif |
| 195 |
endif |
| 196 |
if ( "$STRPTIME" == "1" ) then |
| 197 |
echo " Library function strptime works fine, using it." |
| 198 |
endif |
| 199 |
echo " " |
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
# |
| 205 |
# Try to find veclib library |
| 206 |
# |
| 207 |
foreach DIR ( $LIBDIRS ) |
| 208 |
echo Checking directory: \"$DIR\" for Veclib... |
| 209 |
if ( -e $DIR/libveclib.a ) then |
| 210 |
echo " I found libveclib.a in $DIR" |
| 211 |
set VECLIBDIR = "$DIR" |
| 212 |
set VECLIB = "y" |
| 213 |
break |
| 214 |
endif |
| 215 |
end |
| 216 |
# |
| 217 |
# Try to find lapack library (careful, most people have fortran version) |
| 218 |
# |
| 219 |
foreach DIR ( $LIBDIRS ) |
| 220 |
echo Checking directory: \"$DIR\" for Lapack... |
| 221 |
if ( -e $DIR/liblapack.a ) then |
| 222 |
echo " I found liblapack.a in $DIR" |
| 223 |
set LAPACKDIR = "$DIR" |
| 224 |
set LAPACK = "y" |
| 225 |
break |
| 226 |
endif |
| 227 |
end |
| 228 |
if ( "$VECLIB" == "n" ) echo " I could not find libveclib.a" |
| 229 |
if ( "$LAPACK" == "n" ) echo " I could not find liblapack.a" |
| 230 |
echo " " |
| 231 |
# |
| 232 |
# Try to find fftw library |
| 233 |
# |
| 234 |
foreach DIR ( $INCLDIRS ) |
| 235 |
echo Checking directory: \"$DIR\" for fftw3.h... |
| 236 |
if ( -e $DIR/fftw3.h ) then |
| 237 |
echo " I found fftw3.h in $DIR" |
| 238 |
set FFTWINCLDIR = "$DIR" |
| 239 |
#set FFTW = "y" |
| 240 |
break |
| 241 |
endif |
| 242 |
end |
| 243 |
foreach DIR ( $LIBDIRS ) |
| 244 |
echo "Checking directory: $DIR for libfftw3f.[a|so]..." |
| 245 |
if ( -e $DIR/libfftw3f.a ) then |
| 246 |
echo " I found libfftw3f.a in $DIR" |
| 247 |
set FFTWLIBDIR = "$DIR" |
| 248 |
set FFTW = "y" |
| 249 |
break |
| 250 |
else if ( -e $DIR/libfftw3f.so ) then |
| 251 |
echo " I found libfftw3f.so in $DIR" |
| 252 |
set FFTWLIBDIR = "$DIR" |
| 253 |
set FFTW = "y" |
| 254 |
break |
| 255 |
endif |
| 256 |
end |
| 257 |
if ( "$FFTW" == "n" ) echo " I could not find libfftw3f.a or libfftw3f.so" |
| 258 |
if ( "$FFTW" == "y" ) if ( "$VECLIB" == "y" ) echo " NOT POSSIBLE TO USE VECLIB AND FFTW" |
| 259 |
echo " " |
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
########################################################################## |
| 264 |
# |
| 265 |
# Interactive questions/check by user: |
| 266 |
# |
| 267 |
echo "===> What is your C++ compiler? [$CC] " |
| 268 |
set key = $< |
| 269 |
if ( "X$key" != "X" ) set CC = "$key" |
| 270 |
if ( "$CC" == "g++" ) set GppCOMPILER = y |
| 271 |
|
| 272 |
echo "===> Do you have the FFTW library (y/n)? [$FFTW] " |
| 273 |
set key = $< |
| 274 |
if ( "$key" == "y" || "$key" == "Y" ) then |
| 275 |
set FFTW = "y" |
| 276 |
else if ( "$key" == "n" || "$key" == "N" ) then |
| 277 |
set FFTW = "n" |
| 278 |
else |
| 279 |
echo " Using default: [$FFTW]" |
| 280 |
endif |
| 281 |
if ( "$FFTW" == "y" ) then |
| 282 |
echo "===> What is the path to the FFTW library (libfftw3f.a or libfftw3f.so)? [$FFTWLIBDIR] " |
| 283 |
set key = $< |
| 284 |
if ( "X$key" != "X" ) set FFTWLIBDIR = "$key" |
| 285 |
if ( "X$FFTWLIBDIR" == "X" || ! -d $FFTWLIBDIR ) then |
| 286 |
echo " you entered a non existing directory: $FFTWLIBDIR" |
| 287 |
echo "===> What is the path to the FFTW library? [$FFTWLIBDIR] " |
| 288 |
set key = $< |
| 289 |
if ( "X$key" != "X" ) set FFTWLIBDIR = "$key" |
| 290 |
endif |
| 291 |
echo "===> What is the path to the FFTW include file (fftw3.h)? [$FFTWINCLDIR] " |
| 292 |
set key = $< |
| 293 |
if ( "X$key" != "X" ) set FFTWINCLDIR = "$key" |
| 294 |
if ( "X$FFTWINCLDIR" == "X" || ! -d $FFTWINCLDIR ) then |
| 295 |
echo " you entered a non existing directory: $FFTWINCLDIR" |
| 296 |
echo "===> What is the path to the FFTW library? [$FFTWINCLDIR] " |
| 297 |
set key = $< |
| 298 |
if ( "X$key" != "X" ) set FFTWINCLDIR = "$key" |
| 299 |
endif |
| 300 |
endif |
| 301 |
|
| 302 |
|
| 303 |
echo "===> Do you have the VECLIB library (y/n)? [$VECLIB] " |
| 304 |
set key = $< |
| 305 |
if ( "$key" == "y" || "$key" == "Y" ) then |
| 306 |
set VECLIB = "y" |
| 307 |
else if ( "$key" == "n" || "$key" == "N" ) then |
| 308 |
set VECLIB = "n" |
| 309 |
else |
| 310 |
echo " Using default: [$VECLIB]" |
| 311 |
endif |
| 312 |
if ( "$VECLIB" == "y" ) then |
| 313 |
echo "===> What is the path to the VECLIB library? [$VECLIBDIR] " |
| 314 |
set key = $< |
| 315 |
if ( "X$key" != "X" ) set VECLIBDIR = "$key" |
| 316 |
if ( "X$VECLIBDIR" == "X" || ! -d $VECLIBDIR ) then |
| 317 |
echo " you entered a non existing directory: $VECLIBDIR" |
| 318 |
echo "===> What is the path to the VECLIB library? [$VECLIBDIR] " |
| 319 |
set key = $< |
| 320 |
if ( "X$key" != "X" ) set VECLIBDIR = "$key" |
| 321 |
endif |
| 322 |
endif |
| 323 |
|
| 324 |
|
| 325 |
echo "===> Do you have the LAPACK library (y/n)? [$LAPACK] " |
| 326 |
set key = $< |
| 327 |
if ( "$key" == "y" || "$key" == "Y" ) then |
| 328 |
set LAPACK = "y" |
| 329 |
else if ( "$key" == "n" || "$key" == "N" ) then |
| 330 |
set LAPACK = "n" |
| 331 |
else |
| 332 |
echo " Using default: [$LAPACK]" |
| 333 |
endif |
| 334 |
if ( "$LAPACK" == "y" ) then |
| 335 |
echo "===> What is the path to the LAPACK library liblapack.a? [$LAPACKDIR] " |
| 336 |
set key = $< |
| 337 |
if ( "X$key" != "X" ) set LAPACKDIR = "$key" |
| 338 |
if ( ! -d $LAPACKDIR ) then |
| 339 |
echo " you entered a non existing directory: $LAPACKDIR" |
| 340 |
echo "===> What is the path to the LAPACK library? [$LAPACKDIR] " |
| 341 |
set key = $< |
| 342 |
if ( "X$key" != "X" ) set LAPACKDIR = "$key" |
| 343 |
endif |
| 344 |
### Check LAPACK dir fortran version (underscore appended) |
| 345 |
echo " Checking whether you have FORTRAN LAPACK library:" |
| 346 |
nm $LAPACKDIR/liblapack.a | grep spotrf_ >& /dev/null |
| 347 |
if ( $status == 0 ) then |
| 348 |
echo " FORTRAN" |
| 349 |
else |
| 350 |
echo " C (or nm failed?)" |
| 351 |
echo " If compilation fails, please do not use LAPACK" |
| 352 |
echo " or change in the source code file matrixspecs.cc" |
| 353 |
endif |
| 354 |
endif |
| 355 |
|
| 356 |
|
| 357 |
echo "===> Are you working on a Little Endian (X86 PC, Intel) machine (y/n)? [$X86] " |
| 358 |
set key = $< |
| 359 |
if ( "$key" == "y" || "$key" == "Y" ) set X86 = "y" |
| 360 |
if ( "$key" == "n" || "$key" == "N" ) set X86 = "n" |
| 361 |
|
| 362 |
|
| 363 |
echo "===> Do you want to compile a more verbose DEBUG version (y/n)? [$DEBUG] " |
| 364 |
echo " (You can first compile an optimal version, then perform a make clean," |
| 365 |
echo " and then compile a debug version, which you can use in case doris " |
| 366 |
echo " does not produce expected results)" |
| 367 |
set key = $< |
| 368 |
if ( "$key" == "y" || "$key" == "Y" ) set DEBUG = "y" |
| 369 |
|
| 370 |
|
| 371 |
set INSTALLDIR = "dummy.$$.$$.$$" |
| 372 |
while ( ! -d $INSTALLDIR ) |
| 373 |
set INSTALLDIR = "$DEFINSTALLDIR" |
| 374 |
echo "===> Installation of Doris in directory: $INSTALLDIR (y/n)? [y]" |
| 375 |
set key = $< |
| 376 |
if ( "$key" == "n" || "$key" == "N" ) then |
| 377 |
echo "===> Enter installation directory (use absolute path): " |
| 378 |
set INSTALLDIR = $< |
| 379 |
if ( ! -d $INSTALLDIR ) then |
| 380 |
echo "===> Installation directory: $INSTALLDIR does not exist." |
| 381 |
echo "===> Should I create it (y/n)? [y]" |
| 382 |
set key = $< |
| 383 |
if ( "$key" != "n" && "$key" != "N" ) mkdir $INSTALLDIR |
| 384 |
endif |
| 385 |
endif |
| 386 |
end |
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
################################################### |
| 391 |
echo " " |
| 392 |
echo " Creating Makefile for:" |
| 393 |
echo " compiler: $CC" |
| 394 |
echo " fftw: $FFTW" |
| 395 |
if ( "$FFTW" == "y" ) echo " FFTW LIB DIR: $FFTWLIBDIR" |
| 396 |
if ( "$FFTW" == "y" ) echo " FFTW INCLUDE DIR: $FFTWINCLDIR" |
| 397 |
echo " veclib: $VECLIB" |
| 398 |
if ( "$VECLIB" == "y" ) echo " VECLIB dir: $VECLIBDIR" |
| 399 |
echo " lapack: $LAPACK" |
| 400 |
if ( "$LAPACK" == "y" ) echo " LAPACK dir: $LAPACKDIR" |
| 401 |
echo " Little endian: $X86" |
| 402 |
echo " DEBUG version: $DEBUG" |
| 403 |
echo " Install in dir: $INSTALLDIR" |
| 404 |
echo " " |
| 405 |
if ( -e $MAKEFILE ) then |
| 406 |
echo " file: $MAKEFILE will be OVERWRITTEN." |
| 407 |
else |
| 408 |
echo " file: $MAKEFILE will be created." |
| 409 |
endif |
| 410 |
echo "===> Press enter to continue (CTRL-C to exit)." |
| 411 |
set key = $< |
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
# |
| 416 |
# Set variable for LFLAGS, IFLAGS, DEFINES |
| 417 |
# |
| 418 |
# +++ At 17:49, August 29th, Robert J. Mellors wrote: |
| 419 |
#<RJM: I had a few minor problems compiling v3.16 with gcc on my intel linux |
| 420 |
#<RJM: redhat system - |
| 421 |
#<RJM: [...] |
| 422 |
#<RJM: Next, the linker complained about a variety of missing functions, |
| 423 |
#<RJM: c_sqrt and a plethora of others; I added |
| 424 |
#<RJM: -lg2c (before -lm) to LFLAGS in the Makefile (being too lazy to do it |
| 425 |
#<RJM: right and change configure). |
| 426 |
#<RJM: This seemed to fix that. |
| 427 |
|
| 428 |
set CFLAGS = " " |
| 429 |
set LFLAGS = " " |
| 430 |
#set LFLAGS = "-lg2c" |
| 431 |
set IFLAGS = " " |
| 432 |
if ( "$FFTW" == "y" ) then # MA moved back to top due to searchpath issues: ../fftw/lib vs /usr/lib |
| 433 |
set CFLAGS = "$CFLAGS -D__USE_FFTW_LIBRARY__" |
| 434 |
### last one must be fftw lib and math lib # to be tested again |
| 435 |
### for Cygwin, the slash after "-L$FFTWLIBDIR/" is maybe required?! |
| 436 |
echo "Adding extra lib flag for fftw: -lm (must be at end)" |
| 437 |
set LFLAGS = "$LFLAGS -L$FFTWLIBDIR -lfftw3f -lm" |
| 438 |
set IFLAGS = "$IFLAGS -I$FFTWINCLDIR" |
| 439 |
endif |
| 440 |
########################### |
| 441 |
if ( "$LAPACK" == "y" ) then |
| 442 |
set CFLAGS = "$CFLAGS -D__USE_LAPACK_LIBRARY__" |
| 443 |
# Set the location of liblapack.a (DEF4) |
| 444 |
echo "Adding lib for lapack" |
| 445 |
set LFLAGS = "$LFLAGS -L$LAPACKDIR -llapack" |
| 446 |
endif |
| 447 |
########################### |
| 448 |
if ( "$VECLIB" == "y" ) then |
| 449 |
set CFLAGS = "$CFLAGS -D__USE_VECLIB_LIBRARY__" |
| 450 |
# Set the location of libveclib.a (DEF4) |
| 451 |
echo "Adding extra flag for veclib: -lcl" |
| 452 |
set LFLAGS = "$LFLAGS -L$VECLIBDIR -lveclib -lcl" |
| 453 |
endif |
| 454 |
########################### |
| 455 |
if ( "$X86" == "y" ) then |
| 456 |
set CFLAGS = "$CFLAGS -D__X86PROCESSOR__" |
| 457 |
endif |
| 458 |
########################### |
| 459 |
if ( "$STRPTIME" == "0" ) then |
| 460 |
set CFLAGS = "$CFLAGS -D__NO_STRPTIME" |
| 461 |
endif |
| 462 |
########################### |
| 463 |
#DEF9 = -D__NO_IOS_BINARY__ # -9- comment out if you ios::binary (most will) |
| 464 |
### include dir for fftw |
| 465 |
set CFLAGS = "$CFLAGS $IFLAGS" |
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
# |
| 471 |
# Create the Makefile: |
| 472 |
# |
| 473 |
|
| 474 |
cat << __EOFHD > $MAKEFILE |
| 475 |
######################################################################### |
| 476 |
# Makefile for the Doris software. # |
| 477 |
# Created by: $PRG # |
| 478 |
# 04-Dec-1998 # |
| 479 |
# # |
| 480 |
# Delft University of Technology # |
| 481 |
# Delft Institute of Earth Observation and Space Systems # |
| 482 |
# http://doris.tudelft.nl # |
| 483 |
# See also the user manual, annex installation. # |
| 484 |
# # |
| 485 |
### Usage ### # |
| 486 |
# The command: "make" creates and optimized version of doris. # |
| 487 |
# The command: "make install" installs it andcleans up. # |
| 488 |
# If this does not work, try a more controlled approach by: # |
| 489 |
# # |
| 490 |
# 0. inspect set up of this Makefile # |
| 491 |
# 1. set CC DEFS LIBS etc., first set these to debug values # |
| 492 |
# (read NOTE there if problems) # |
| 493 |
# 2. compile software sources to *.o: "make swobjs" # |
| 494 |
# 3. link object together to executable: "make doris" # |
| 495 |
# 4. install executable: "make install" # |
| 496 |
# 5. remove object files: "make clean" # |
| 497 |
# # |
| 498 |
# BTW. "make" does "swobjs doris" by default. # |
| 499 |
# # |
| 500 |
### # |
| 501 |
# Successfully tested for compilers/platforms: # |
| 502 |
# GNU g++ version 2.7.2.2 on HP-UX B.10.20 A 9000/785 # |
| 503 |
# GNU g++ version 2.95.2 on HP-UX B.10.20 A 9000/785 # |
| 504 |
# HP aCC version A.01.07 on HP-UX B.10.20 A 9000/785 # |
| 505 |
# GNU g++ version ? on Linux X86 # |
| 506 |
# SGI ? # |
| 507 |
# Sun Studion 9,10,11 on Solaris Sparc and X86/AMD64 # |
| 508 |
# GNU g++ versions v3.4, v4.0, v4.1, v4.2, v4.3 on Linux X86 and AMD64 # |
| 509 |
# Sun Sudion v11 on Linux AMD64 # |
| 510 |
# Intel Compilers v9, v10, v11 on Linux AMD64 # |
| 511 |
######################################################################### |
| 512 |
################################################################### |
| 513 |
################################################################### |
| 514 |
# Please change if required: DEF[1-6], CC, CFLAGS, LIBDIR, ### |
| 515 |
################################################################### |
| 516 |
### The shell used by this makefile ### |
| 517 |
SHELL = /bin/sh |
| 518 |
|
| 519 |
### Specify compiler/installation directory ### |
| 520 |
INSTALLDIR = $INSTALLDIR |
| 521 |
CC = $CC |
| 522 |
SCRIPTSDIR = ../bin |
| 523 |
|
| 524 |
### Define statements controlling compilation ### |
| 525 |
# Comment out DEF[1-8] statements when appropriate. |
| 526 |
DEF1 = -D__DEBUGMAT1 # -1- range checking in matrix class |
| 527 |
DEF2 = -D__DEBUGMAT2 # -2- info matrix class (debug only) |
| 528 |
DEF3 = -D__DEBUG # -3- debug for other files |
| 529 |
DEF4 = -Wno-deprecated # -4- do not display warnings due to depricated entries |
| 530 |
DEF5 = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE # -5- support for large files |
| 531 |
#DEF6 = -DNO_FASTTRIG # -6- extra functional switches |
| 532 |
#DEF9 = -D__NO_IOS_BINARY__ # -9- comment out if you ios::binary (most will) |
| 533 |
# |
| 534 |
### Do not change following 2, simply comment DEF1-8 above |
| 535 |
DEFSDEBUG = \$(DEF1) \$(DEF2) \$(DEF3) |
| 536 |
DEFS = \$(DEF4) \$(DEF5) \$(DEF6) $CFLAGS |
| 537 |
|
| 538 |
### NOTE ### |
| 539 |
# If you get warnings like the following (I got them with g++, not with aCC) |
| 540 |
# then use define __GNUC__ to define these functions |
| 541 |
#%// BK 15-Aug-2000 |
| 542 |
#In file included from matrixbk.h:38, |
| 543 |
# from processor.cc:23: |
| 544 |
#constants.h: In method \`real8 cn::dist(cn) const': |
| 545 |
#constants.h:106: implicit declaration of function \`int sqr(...)' |
| 546 |
### END NOTE ### |
| 547 |
|
| 548 |
|
| 549 |
# LOCAL dir |
| 550 |
LOCAL_INSTALLDIR = ../bin |
| 551 |
|
| 552 |
### CFLAGS ### |
| 553 |
# Compiler options flag ### |
| 554 |
# Specify compiler flags (I selected these for g++) |
| 555 |
CFLAGSDEBUG = -g -O \$(DEFS) \$(DEFSDEBUG) |
| 556 |
CFLAGSOPT = -O \$(DEFS) |
| 557 |
#CFLAGSOPT = -O2 \$(DEFS) # this crashed doris! (?) |
| 558 |
#CFLAGSOPT = -O3 \$(DEFS) # this crashed doris! (?) |
| 559 |
|
| 560 |
__EOFHD |
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
# |
| 565 |
# See if you want a DEBUG version |
| 566 |
# |
| 567 |
if ( "$DEBUG" == "n" ) then |
| 568 |
cat << __EOFHD >> $MAKEFILE |
| 569 |
### CCNOTE ### |
| 570 |
### Change here ### |
| 571 |
### set CFLAGS depending on if you compile debug version or working version ### |
| 572 |
#CFLAGS = \$(CFLAGSDEBUG) |
| 573 |
CFLAGS = \$(CFLAGSOPT) |
| 574 |
### END CCNOTE ### |
| 575 |
__EOFHD |
| 576 |
else |
| 577 |
cat << __EOFHD >> $MAKEFILE |
| 578 |
### CCNOTE ### |
| 579 |
### Change here ### |
| 580 |
### set CFLAGS depending on if you compile debug version or working version ### |
| 581 |
CFLAGS = \$(CFLAGSDEBUG) |
| 582 |
#CFLAGS = \$(CFLAGSOPT) |
| 583 |
### END CCNOTE ### |
| 584 |
__EOFHD |
| 585 |
endif |
| 586 |
|
| 587 |
|
| 588 |
|
| 589 |
# |
| 590 |
# Add LFLAGS to Makefile |
| 591 |
# |
| 592 |
cat << __EOFHD >> $MAKEFILE |
| 593 |
|
| 594 |
### Library locations flag ### |
| 595 |
### -lcl : used for veclib |
| 596 |
### -lm : used for fftw |
| 597 |
LFLAGS = $LFLAGS |
| 598 |
|
| 599 |
|
| 600 |
##################################################### |
| 601 |
### No need to change anything below here... #### |
| 602 |
##################################################### |
| 603 |
EXECUTABLE = doris |
| 604 |
|
| 605 |
SWSRCS = processor.cc \ |
| 606 |
utilities.cc \ |
| 607 |
ioroutines.cc \ |
| 608 |
readinput.cc \ |
| 609 |
readdata.cc \ |
| 610 |
coregistration.cc \ |
| 611 |
filtering.cc \ |
| 612 |
referencephase.cc \ |
| 613 |
products.cc \ |
| 614 |
geocode.cc \ |
| 615 |
unwrap.cc \ |
| 616 |
matrixspecs.cc \ |
| 617 |
exceptions.cc \ |
| 618 |
estorbit.cc |
| 619 |
SWOBJS = \$(SWSRCS:.cc=.o) |
| 620 |
|
| 621 |
### scripts of doris.tar in SCRIPTSDIR, used at make install |
| 622 |
SCRIPTS = helpdoris \ |
| 623 |
baseline.doris.sh \ |
| 624 |
baseline.doris.csh \ |
| 625 |
construct_dem.sh \ |
| 626 |
coregpm.doris \ |
| 627 |
doris* \ |
| 628 |
heightamb \ |
| 629 |
phasefilt.doris \ |
| 630 |
plotcpm* \ |
| 631 |
plotoffsets* \ |
| 632 |
run \ |
| 633 |
viewanddel \ |
| 634 |
cpx2ps \ |
| 635 |
lonlathei2ascii \ |
| 636 |
ascii2ascii_UTM \ |
| 637 |
ascii2ps* \ |
| 638 |
tsx* \ |
| 639 |
rs2* \ |
| 640 |
csk* \ |
| 641 |
gammaReadfiles.csh \ |
| 642 |
hhmmss2sec.py \ |
| 643 |
sec2hhmmss.py |
| 644 |
|
| 645 |
|
| 646 |
|
| 647 |
|
| 648 |
##################################################### |
| 649 |
### And no need to change anything below here... #### |
| 650 |
##################################################### |
| 651 |
### what to do if make w/o arguments ### |
| 652 |
# first make all object files, then link them together |
| 653 |
default: \$(EXECUTABLE) |
| 654 |
|
| 655 |
|
| 656 |
### how to compile object code .o from C++ source files .cc (general rule) ### |
| 657 |
# space between -o and filename for SUN make (BK 7 july 2000) |
| 658 |
.cc.o: |
| 659 |
\$(CC) \$(CFLAGS) -c -o \$(@) \$< |
| 660 |
|
| 661 |
##################################################### |
| 662 |
### Make object code from source ### |
| 663 |
swobjs: \$(SWOBJS) |
| 664 |
|
| 665 |
|
| 666 |
### Load objects to executable ### |
| 667 |
### The added .cc files contain class definitions |
| 668 |
### matrixclass is explicitly included |
| 669 |
### in the source code since we had some problems finding out how to do that |
| 670 |
### here, since compilers treat the template class differently than normal classes. |
| 671 |
### BK 07-Feb-2002 |
| 672 |
\$(EXECUTABLE): \$(SWOBJS) tmp_strptime.cc slcimage.cc productinfo.cc orbitbk.cc |
| 673 |
\$(CC) \$(CFLAGS) -c -o triangle.o -DTRILIBRARY -DANSI_DECLARATORS triangle.c |
| 674 |
\$(CC) \$(CFLAGS)\ |
| 675 |
tmp_strptime.cc \$(SWOBJS) triangle.o\ |
| 676 |
slcimage.cc productinfo.cc orbitbk.cc\ |
| 677 |
\$(LFLAGS) -o \$@ |
| 678 |
@echo " " |
| 679 |
@echo "*******************************" |
| 680 |
@echo "* ...Compilation finished... *" |
| 681 |
@echo "*******************************" |
| 682 |
@echo " " |
| 683 |
|
| 684 |
|
| 685 |
### Install executable in installdir ### |
| 686 |
install: \$(EXECUTABLE) |
| 687 |
@echo "* Installing \$(EXECUTABLE) in: \$(INSTALLDIR)" |
| 688 |
@cp -f \$(EXECUTABLE) \$(INSTALLDIR)/. |
| 689 |
( cd \$(SCRIPTSDIR); cp -f \$(SCRIPTS) \$(INSTALLDIR)/. ) |
| 690 |
\$(MAKE) cleaner |
| 691 |
@echo " " |
| 692 |
@echo "*******************************" |
| 693 |
@echo "* ...Installation finished... *" |
| 694 |
@echo "*******************************" |
| 695 |
@echo " " |
| 696 |
@echo "* Check that \$(INSTALLDIR) is in your path search: echo \\\$\$PATH ." |
| 697 |
@echo " " |
| 698 |
|
| 699 |
|
| 700 |
installcb: \$(EXECUTABLE) |
| 701 |
@echo "* Installing \$(EXECUTABLE) in: \$(LOCAL_INSTALLDIR)" |
| 702 |
@cp -f \$(EXECUTABLE) \$(LOCAL_INSTALLDIR)/. |
| 703 |
\$(MAKE) cleaner |
| 704 |
@echo " " |
| 705 |
@echo "*******************************" |
| 706 |
@echo "* ...Installation finished... *" |
| 707 |
@echo "*******************************" |
| 708 |
@echo " " |
| 709 |
@echo "* Check that \$(LOCAL_INSTALLDIR) is in your path search: echo \\\$\$PATH ." |
| 710 |
@echo " " |
| 711 |
|
| 712 |
|
| 713 |
##################################################### |
| 714 |
### Testers ### |
| 715 |
test: testdoris |
| 716 |
testdoris: \$(EXECUTABLE) |
| 717 |
@echo " " |
| 718 |
@echo "* Executing command: \$(EXECUTABLE) -v" |
| 719 |
\$(EXECUTABLE) -v |
| 720 |
@echo " " |
| 721 |
|
| 722 |
### Orbit test program for debugging ### |
| 723 |
test-orbit: ioroutines.o matrixspecs.o utilities.o exceptions.cc slcimage.cc orbitbk.cc matrixbk.cc bk_messages.hh |
| 724 |
\$(CC) \$(CFLAGS) -D__TESTMAIN__ \ |
| 725 |
ioroutines.o matrixspecs.o utilities.o exceptions.cc slcimage.cc orbitbk.cc \ |
| 726 |
\$(LFLAGS) \ |
| 727 |
-o \$@ |
| 728 |
### Matrix test program for debugging ### |
| 729 |
### fast_sin defined in utilities.cc, which requires ioroutines, which, etc. |
| 730 |
test-matrix: matrix_test.cc matrixspecs.o utilities.o utilities.o ioroutines.o matrixbk.cc |
| 731 |
\$(CC) \$(CFLAGS) matrix_test.cc matrixspecs.o \ |
| 732 |
utilities.o ioroutines.o exceptions.cc orbitbk.cc \ |
| 733 |
\$(LFLAGS) \ |
| 734 |
-o \$@ |
| 735 |
@echo " " |
| 736 |
|
| 737 |
|
| 738 |
##################################################### |
| 739 |
### Cleaners ### |
| 740 |
clean: cleanswobjs |
| 741 |
|
| 742 |
cleaner: clean cleanprog |
| 743 |
cleanest: clean cleanprog uninstall |
| 744 |
cleanprog: |
| 745 |
@rm -f \$(EXECUTABLE) \$(EXECUTABLE.debug) \ |
| 746 |
matrixbk_test testorbit |
| 747 |
@echo "* Removed executables in current dir." |
| 748 |
cleanswobjs: |
| 749 |
@rm -f \$(SWOBJS) matrixbk_test.o orbitbk.o slcimage.o triangle.o |
| 750 |
@echo "* Removed object files." |
| 751 |
uninstall: |
| 752 |
@rm -f \$(INSTALLDIR)/\$(EXECUTABLE) |
| 753 |
@echo "* Removed executables in install dir: \$(INSTALLDIR)." |
| 754 |
|
| 755 |
### BK 12-Dec-2000 ### |
| 756 |
|
| 757 |
__EOFHD |
| 758 |
|
| 759 |
|
| 760 |
|
| 761 |
|
| 762 |
### Finish with some hints. |
| 763 |
set LINE = `grep -n CFLAGSOPT $MAKEFILE | cut -f1 -d":"` |
| 764 |
cat << __EOFHD |
| 765 |
|
| 766 |
$PRG has finished creating: $MAKEFILE |
| 767 |
------------------------------------------------- |
| 768 |
To compile the Doris software do the following: |
| 769 |
1. Inspect the created Makefile named: $MAKEFILE |
| 770 |
*TIP* If you like to use other compiler flags (CFLAGS), |
| 771 |
change them in file: $MAKEFILE |
| 772 |
change them at line: $LINE[1] in file: $MAKEFILE |
| 773 |
*TIP* the command: make -f $MAKEFILE -n |
| 774 |
will show what happens without executing. |
| 775 |
|
| 776 |
2. At the prompt, enter the command: |
| 777 |
make -f $MAKEFILE |
| 778 |
to compile an version of Doris. |
| 779 |
*TIP* if compilation FAILS due to strptime, try uncommenting DEF8 |
| 780 |
*TIP* if compilation FAILS due to something else, please report the |
| 781 |
problem to the mailing list, after checking the user manual |
| 782 |
and the FAQ. |
| 783 |
|
| 784 |
3. Enter the command: make -f $MAKEFILE install |
| 785 |
to install the executable in directory: $INSTALLDIR |
| 786 |
This will also install the scripts residing in directory ../bin |
| 787 |
and it will clean up this directory (remove the object files). |
| 788 |
|
| 789 |
4. After installation, the command: |
| 790 |
doris -v [should now give the version number] |
| 791 |
doris -h [should give help] |
| 792 |
doris -c [should give the copyright notice] |
| 793 |
doris -q [should give help also] |
| 794 |
|
| 795 |
*TIP* Make sure the installation directory is in your path. |
| 796 |
(do a rehash or login again) |
| 797 |
|
| 798 |
5. You are adviced to create a (slower, much more verbose) debug |
| 799 |
version of Doris. If you get an error during running the normal |
| 800 |
version of Doris, you can repeat the processing with this debug |
| 801 |
executable. In order to compile a debug version, make sure the |
| 802 |
normal version is installed. next, run the configure script again |
| 803 |
(or set appropriate CFLAGS in file $MAKEFILE at line $LINE[2]), |
| 804 |
and indicate that you do want a debug version. Then give the commands: |
| 805 |
make clean |
| 806 |
make -f $MAKEFILE |
| 807 |
This compiles a debug version, named "doris". Do not use make install, |
| 808 |
instead move this executable to "doris.debug" in the installation |
| 809 |
directory by hand. |
| 810 |
|
| 811 |
---------------------------------------------------------------------- |
| 812 |
DO NOT FORGET to go to directory SARtools and do a make install, |
| 813 |
and also in directory ENVISAT_TOOLS. The programs in these directories |
| 814 |
are used in doris. |
| 815 |
Before compiling doris, create the fftw library if you want to use it. |
| 816 |
---------------------------------------------------------------------- |
| 817 |
|
| 818 |
|
| 819 |
MORE INFORMATION |
| 820 |
---------------- |
| 821 |
- See the README file, the $MAKEFILE, or the users manual |
| 822 |
(at: http://doris.tudelft.nl/) |
| 823 |
- Consider installing the Matlab InSAR toolbox. |
| 824 |
|
| 825 |
__EOFHD |
| 826 |
|
| 827 |
### EOF. |
| 828 |
|