diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2006-06-23 03:31:47 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2006-06-23 03:31:47 +0000 |
commit | 2d6ee90c4f66b9a6920e966a1bc3ab23770bc843 (patch) | |
tree | 3b42c5e7969dfbec5e75792a58976ca4f7b3c308 /lib/make/configure.in | |
parent | 8f7d0a83e9651213369cb0c5eaadb307de57a27c (diff) |
Add a new configuration flag PROFILE=yes, which enables profiling in a
build. This flag is equivalent to OPTIMISE=yes and DEBUG=yes.
Additional compiler options {C,CXX,F77,F90}_PROFILE_FLAGS are also
introduced.
The configuration stage sets the F77 flags to the F90 flags if an F90
compiler is found. This flag setting was done too early, namely
before the default values for the F90 flags were set. This flag
setting has been moved to a later time.
The link command used undefined make variables $(OPTIMISE_C) etc.
These variables have been removed. Instead $(CXX_OPTIMISE_FLAGS)
etc. are added to the link statement. This makes the linker pick up
the correct flags e.g. for profiling.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4327 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/configure.in')
-rw-r--r-- | lib/make/configure.in | 93 |
1 files changed, 64 insertions, 29 deletions
diff --git a/lib/make/configure.in b/lib/make/configure.in index 1e7edd42..7bc0985f 100644 --- a/lib/make/configure.in +++ b/lib/make/configure.in @@ -63,6 +63,22 @@ elif test -n "$OPTIMIZE"; then fi +####################################################################### +# determine PROFILE_MODE from the PROFILE option +# if this option isn't set PROFILE_MODE will default to 'no' + +PROFILE_MODE='no' +if test -n "$PROFILE" ; then + changequote({, }) + PROFILE=`echo $PROFILE | tr '[:upper:]' '[:lower:]'` + changequote([, ]) + if test "$PROFILE" != 'yes' -a "$PROFILE" != 'no' ; then + AC_ERROR(Didn't recognize setting of PROFILE=\"$PROFILE\" (should be either \"yes\" or \"no\")) + fi + PROFILE_MODE=$PROFILE +fi + + dnl Check the system type AC_CANONICAL_HOST @@ -199,15 +215,6 @@ CCTK_WriteLine cctk_Archdefs.h '#endif /* _CCTK_ARCHDEFS_H_ */' ########################################################################## ######################################################################### -# Deal with the Fortran compiler issues. -# If there's a Fortran 90 compiler use that for all the Fortran. -if test "x$F90" != 'x' -a "x$F90" != 'xnone' -a "x$F77" != 'xnone' ; then - F77=$F90 - F77FLAGS=$F90FLAGS - F77_DEBUG_FLAGS=$F90_DEBUG_FLAGS - F77_OPTIMISE_FLAGS=$F90_OPTIMISE_FLAGS - F77_WARN_FLAGS=$F90_WARN_FLAGS -fi # The known architecture stuff has probably set the LIBS variable # So remember what it is and set it to blank to prevent any problems with the @@ -854,26 +861,6 @@ AC_SUBST(F90_DEBUG_FLAGS) # Set the warn flags AC_SUBST(WARN_MODE) -# Set the optimization flags if they've not been set by now -# (using '-O2' as a reasonable default) -AC_SUBST(OPTIMISE_MODE) - -AC_SUBST(C_OPTIMISE_FLAGS) -: ${C_OPTIMISE_FLAGS='-O2'} - -AC_SUBST(CXX_OPTIMISE_FLAGS) -: ${CXX_OPTIMISE_FLAGS='-O2'} - -AC_SUBST(F77_OPTIMISE_FLAGS) -if test -z "$F77_OPTIMISE_FLAGS" -a "$F77" = 'g77' ; then - F77_OPTIMISE_FLAGS='-O2' -else - : ${F77_OPTIMISE_FLAGS=''} -fi - -AC_SUBST(F90_OPTIMISE_FLAGS) -: ${F90_OPTIMISE_FLAGS=''} - # Set the warning flags if they've not been set by now # (using GNU compiler warning flags as a reasonable default) AC_SUBST(C_WARN_FLAGS) @@ -900,6 +887,42 @@ fi AC_SUBST(F90_WARN_FLAGS) : ${F90_WARN_FLAGS=''} +# Set the optimization flags if they've not been set by now +# (using '-O2' as a reasonable default) +AC_SUBST(OPTIMISE_MODE) + +AC_SUBST(C_OPTIMISE_FLAGS) +: ${C_OPTIMISE_FLAGS='-O2'} + +AC_SUBST(CXX_OPTIMISE_FLAGS) +: ${CXX_OPTIMISE_FLAGS='-O2'} + +AC_SUBST(F77_OPTIMISE_FLAGS) +if test -z "$F77_OPTIMISE_FLAGS" -a "$F77" = 'g77' ; then + F77_OPTIMISE_FLAGS='-O2' +else + : ${F77_OPTIMISE_FLAGS=''} +fi + +AC_SUBST(F90_OPTIMISE_FLAGS) +: ${F90_OPTIMISE_FLAGS=''} + +# Set the profiling flags if they've not been set by now +# (using '-pg' as a reasonable default) +AC_SUBST(PROFILE_MODE) + +AC_SUBST(C_PROFILE_FLAGS) +: ${C_PROFILE_FLAGS='-pg'} + +AC_SUBST(CXX_PROFILE_FLAGS) +: ${CXX_PROFILE_FLAGS='-pg'} + +AC_SUBST(F77_PROFILE_FLAGS) +: ${F77_PROFILE_FLAGS='-pg'} + +AC_SUBST(F90_PROFILE_FLAGS) +: ${F90_PROFILE_FLAGS='-pg'} + # Set the createexe flag if it's not been set by now AC_SUBST(CREATEEXE) @@ -999,6 +1022,18 @@ AC_DEFINE_UNQUOTED(CCTK_CACHELINE_BYTES, $CACHELINE_BYTES) AC_DEFINE_UNQUOTED(CCTK_CACHE_SIZE, $CACHE_SIZE) +# Deal with the Fortran compiler issues. +# If there's a Fortran 90 compiler use that for all the Fortran. +if test "x$F90" != 'x' -a "x$F90" != 'xnone' -a "x$F77" != 'xnone' ; then + F77=$F90 + F77FLAGS=$F90FLAGS + F77_DEBUG_FLAGS=$F90_DEBUG_FLAGS + F77_OPTIMISE_FLAGS=$F90_OPTIMISE_FLAGS + F77_PROFILE_FLAGS=$F90_PROFILE_FLAGS + F77_WARN_FLAGS=$F90_WARN_FLAGS +fi + + ######################################################################### #Check for extra stuff ######################################################################### |