Changeset 4856
- Timestamp:
- 06/29/09 14:55:15 (5 months ago)
- Location:
- mpich2/trunk
- Files:
-
- 9 modified
-
README.vin (modified) (2 diffs)
-
src/env/mpicc.bash.in (modified) (1 diff)
-
src/env/mpicc.in (modified) (1 diff)
-
src/env/mpicxx.bash.in (modified) (1 diff)
-
src/env/mpicxx.in (modified) (1 diff)
-
src/env/mpif77.bash.in (modified) (1 diff)
-
src/env/mpif77.in (modified) (1 diff)
-
src/env/mpif90.bash.in (modified) (1 diff)
-
src/env/mpif90.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mpich2/trunk/README.vin
r4669 r4856 381 381 =================== 382 382 383 MPICH2 can be configured with two sets of compiler flags: CFLAGS, 384 CXXFLAGS, FFLAGS, F90FLAGS (abbreviated as xFLAGS) and 385 MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS, MPICH2LIB_FFLAGS, 386 MPICH2LIB_F90FLAGS (abbreviated as MPICH2LIB_xFLAGS) for compilation; 387 LDFLAGS and MPICH2LIB_LDFLAGS for linking. All these flags can be set 388 as part of configure command or through environment variables. 389 (CPPFLAGS stands for C preprocessor flags, which should NOT be set) 390 391 Both xFLAGS and MPICH2LIB_xFLAGS affect the compilation of the MPICH2 392 libraries. However, only xFLAGS are appended to MPI wrapper scripts, 393 mpicc and friends. 394 395 MPICH2 libraries are built with default compiler optimization, -O2, 396 which can be modified by --enable-fast configure option. For 397 instance, --disable-fast disables the default optimization option. 398 --enable-fast=O<n> sets default compiler optimization as -O<n>. For 399 more details of --enable-fast, see the output of "configure --help". 400 Any other complicated optimization flags for MPICH2 libraries have to 401 be set throught MPICH2LIB_xFLAGS. CFLAGS and friends are empty by 402 default. 403 404 For example, to build a "production" MPICH2 environment with -O3 for all 405 language bindings, one can simply do 383 MPICH2 allows several sets of compiler flags to be used. The first 384 three sets are configure-time options for MPICH2, while the fourth is 385 only relevant when compiling applications with mpicc and friends. 386 387 1. CFLAGS, CXXFLAGS, FFLAGS, F90FLAGS and LDFLAGS (abbreviated as 388 xFLAGS): Setting these flags would result in the MPICH2 library being 389 compiled/linked with these flags and the flags internally being used 390 in mpicc and friends. 391 392 2. MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS, MPICH2LIB_FFLAGS, 393 MPICH2LIB_F90FLAGS and MPICH2LIB_LDFLAGS (abbreviated as 394 MPICH2LIB_xFLAGS): Setting these flags would result in the MPICH2 395 library being compiled/linked with these flags. However, these flags 396 will *not* be used by mpicc and friends. 397 398 3. MPICH2_MAKE_CFLAGS: Setting these flags would result in MPICH2's 399 configure tests to not use these flags, but the makefile's to use 400 them. This is a temporary hack for certain cases that advanced 401 developers might be interested in which break existing configure tests 402 (e.g., -Werror) and are not recommended for regular users. 403 404 4. MPICH2_MPICC_FLAGS, MPICH2_MPICXX_FLAGS, MPICH2_MPIF77_FLAGS, 405 MPICH2_MPIF90_FLAGS and MPICH2_LDFLAGS (abbreviated as 406 MPICH2_MPIX_FLAGS): These flags do *not* affect the compilation of the 407 MPICH2 library itself, but will be internally used by mpicc and 408 friends. 409 410 411 +--------------------------------------------------------------------+ 412 | | | | 413 | | MPICH2 library | mpicc and friends | 414 | | | | 415 +--------------------+----------------------+------------------------+ 416 | | | | 417 | xFLAGS | Yes | Yes | 418 | | | | 419 +--------------------+----------------------+------------------------+ 420 | | | | 421 | MPICH2LIB_xFLAGS | Yes | No | 422 | | | | 423 +--------------------+----------------------+------------------------+ 424 | | | | 425 | MPICH2_MAKE_xFLAGS | Yes | No | 426 | | | | 427 +--------------------+----------------------+------------------------+ 428 | | | | 429 | MPICH2_MPIX_FLAGS | No | Yes | 430 | | | | 431 +--------------------+----------------------+------------------------+ 432 433 434 All these flags can be set as part of configure command or through 435 environment variables. (CPPFLAGS stands for C preprocessor flags, 436 which should NOT be set) 437 438 439 Default flags 440 -------------- 441 By default, MPICH2 automatically adds certain compiler optimizations 442 to MPICH2LIB_CFLAGS. The currently used optimization level is -O2. 443 444 ** IMPORTANT NOTE: Remember that this only affects the compilation of 445 the MPICH2 library and is not used in the wrappers (mpicc and friends) 446 that are used to compile your applications or other libraries. 447 448 This optimization level can be changed with the --enable-fast option 449 passed to configure. For example, to build an MPICH2 environment with 450 -O3 for all language bindings, one can simply do: 406 451 407 452 ./configure --enable-fast=O3 408 453 409 or 454 Or to disable all compiler optimizations, one can do: 455 456 ./configure --disable-fast 457 458 For more details of --enable-fast, see the output of "configure 459 --help". 460 461 462 Examples 463 -------- 464 465 Example 1: 410 466 411 467 ./configure --disable-fast MPICH2LIB_CFLAGS=-O3 MPICH2LIB_FFLAGS=-O3 MPICH2LIB_CXXFLAGS=-O3 MPICH2LIB_F90FLAGS=-O3 412 468 413 This will cause the MPICH2 libraries to be built with -O3, and -O3 will 414 not be included in the mpicc and other MPI wrapper script. 469 This will cause the MPICH2 libraries to be built with -O3, and -O3 470 will *not* be included in the mpicc and other MPI wrapper script. 471 472 Example 2: 473 474 ./configure --disable-fast CFLAGS=-O3 FFLAGS=-O3 CXXFLAGS=-O3 F90FLAGS=-O3 475 476 This will cause the MPICH2 libraries to be built with -O3, and -O3 477 will be included in the mpicc and other MPI wrapper script. 478 479 Example 3: 415 480 416 481 There are certain compiler flags that should not be used with MPICH2's … … 421 486 MPICH2_MAKE_CFLAGS as follows: 422 487 423 make VERBOSE=1MPICH2_MAKE_CFLAGS="-Wall -Werror"424 425 (assuming CC is set to gcc). The content of MPICH2_MAKE_CFLAGS is 426 appended to the CFLAGS in almost allMakefiles.488 make MPICH2_MAKE_CFLAGS="-Wall -Werror" 489 490 The content of MPICH2_MAKE_CFLAGS is appended to the CFLAGS in all 491 relevant Makefiles. 427 492 428 493 ------------------------------------------------------------------------- -
mpich2/trunk/src/env/mpicc.bash.in
r4441 r4856 246 246 mpilibs="$C_LINKPATH_SHL$libdir $mpilibs" 247 247 fi 248 $Show $CC $ CFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir$mpilibs $MPI_OTHERLIBS248 $Show $CC $MPICH2_MPICC_FLAGS $CFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir $MPICH2_LDFLAGS $mpilibs $MPI_OTHERLIBS 249 249 rc=$? 250 250 else 251 $Show $CC $ CFLAGS "${allargs[@]}" -I$includedir251 $Show $CC $MPICH2_MPICC_FLAGS $CFLAGS "${allargs[@]}" -I$includedir 252 252 rc=$? 253 253 fi -
mpich2/trunk/src/env/mpicc.in
r4441 r4856 255 255 mpilibs="$C_LINKPATH_SHL$libdir $mpilibs" 256 256 fi 257 $Show $CC $ CFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir$mpilibs $MPI_OTHERLIBS257 $Show $CC $MPICH2_MPICC_FLAGS $CFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir $MPICH2_LDFLAGS $mpilibs $MPI_OTHERLIBS 258 258 rc=$? 259 259 else 260 $Show $CC $ CFLAGS $allargs -I$includedir260 $Show $CC $MPICH2_MPICC_FLAGS $CFLAGS $allargs -I$includedir 261 261 rc=$? 262 262 fi -
mpich2/trunk/src/env/mpicxx.bash.in
r4441 r4856 246 246 shllibpath="$CXX_LINKPATH_SHL$libdir" 247 247 fi 248 $Show $CXX $ CXXFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir $shllibpath$cxxlibs $mpilibs $MPI_OTHERLIBS248 $Show $CXX $MPICH2_MPICXX_FLAGS $CXXFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir $shllibpath $MPICH2_LDFLAGS $cxxlibs $mpilibs $MPI_OTHERLIBS 249 249 rc=$? 250 250 else 251 $Show $CXX $ CXXFLAGS "${allargs[@]}" -I$includedir251 $Show $CXX $MPICH2_MPICXX_FLAGS $CXXFLAGS "${allargs[@]}" -I$includedir 252 252 rc=$? 253 253 fi -
mpich2/trunk/src/env/mpicxx.in
r4441 r4856 255 255 shllibpath="$CXX_LINKPATH_SHL$libdir" 256 256 fi 257 $Show $CXX $ CXXFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir $shllibpath$cxxlibs $mpilibs $MPI_OTHERLIBS257 $Show $CXX $MPICH2_MPICXX_FLAGS $CXXFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir $shllibpath $MPICH2_LDFLAGS $cxxlibs $mpilibs $MPI_OTHERLIBS 258 258 rc=$? 259 259 else 260 $Show $CXX $ CXXFLAGS $allargs -I$includedir260 $Show $CXX $MPICH2_MPICXX_FLAGS $CXXFLAGS $allargs -I$includedir 261 261 rc=$? 262 262 fi -
mpich2/trunk/src/env/mpif77.bash.in
r4441 r4856 294 294 mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs" 295 295 fi 296 $Show $FC $ FFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir$mpilibs $MPI_OTHERLIBS296 $Show $FC $MPICH2_MPIF77_FLAGS $FFLAGS $LDFLAGS "${allargs[@]}" -I$includedir -L$libdir -L$opalibdir $MPICH2_LDFLAGS $mpilibs $MPI_OTHERLIBS 297 297 rc=$? 298 298 else 299 $Show $FC $ FFLAGS "${allargs[@]}" -I$includedir299 $Show $FC $MPICH2_MPIF77_FLAGS $FFLAGS "${allargs[@]}" -I$includedir 300 300 rc=$? 301 301 fi -
mpich2/trunk/src/env/mpif77.in
r4441 r4856 316 316 mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs" 317 317 fi 318 $Show $FC $ FFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir$mpilibs $MPI_OTHERLIBS318 $Show $FC $MPICH2_MPIF77_FLAGS $FFLAGS $LDFLAGS $allargs -I$includedir -L$libdir -L$opalibdir $MPICH2_LDFLAGS $mpilibs $MPI_OTHERLIBS 319 319 rc=$? 320 320 else 321 $Show $FC $ FFLAGS $allargs -I$includedir321 $Show $FC $MPICH2_MPIF77_FLAGS $FFLAGS $allargs -I$includedir 322 322 rc=$? 323 323 fi -
mpich2/trunk/src/env/mpif90.bash.in
r4441 r4856 341 341 mpilibs="$F90_LINKPATH_SHL$libdir $mpilibs" 342 342 fi 343 $Show $F90 $ F90FLAGS $LDFLAGS "${allargs[@]}" $F90INCDIRS $F90MODDIRS -L$libdir -L$opalibdir$F90MODLIBS $mpilibs $MPI_OTHERLIBS343 $Show $F90 $MPICH2_MPIF90_FLAGS $F90FLAGS $LDFLAGS "${allargs[@]}" $F90INCDIRS $F90MODDIRS -L$libdir -L$opalibdir $MPICH2_LDFLAGS $F90MODLIBS $mpilibs $MPI_OTHERLIBS 344 344 rc=$? 345 345 else 346 $Show $F90 $ F90FLAGS "${allargs[@]}" $F90INCDIRS $F90MODDIRS346 $Show $F90 $MPICH2_MPIF90_FLAGS $F90FLAGS "${allargs[@]}" $F90INCDIRS $F90MODDIRS 347 347 rc=$? 348 348 fi -
mpich2/trunk/src/env/mpif90.in
r4441 r4856 363 363 mpilibs="$F90_LINKPATH_SHL$libdir $mpilibs" 364 364 fi 365 $Show $F90 $ F90FLAGS $LDFLAGS $allargs $F90INCDIRS $F90MODDIRS -L$libdir -L$opalibdir$F90MODLIBS $mpilibs $MPI_OTHERLIBS365 $Show $F90 $MPICH2_MPIF90_FLAGS $F90FLAGS $LDFLAGS $allargs $F90INCDIRS $F90MODDIRS -L$libdir -L$opalibdir $MPICH2_LDFLAGS $F90MODLIBS $mpilibs $MPI_OTHERLIBS 366 366 rc=$? 367 367 else 368 $Show $F90 $ F90FLAGS $allargs $F90INCDIRS $F90MODDIRS368 $Show $F90 $MPICH2_MPIF90_FLAGS $F90FLAGS $allargs $F90INCDIRS $F90MODDIRS 369 369 rc=$? 370 370 fi
