From 571105988af41cfcdc89f7912503ab895b94856e Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 6 Mar 2003 16:46:38 +0000 Subject: [PATCH] Implement --with-cpu. Properly indent output for ./configure --help. git-svn-id: https://svn.dealii.org/trunk@7274 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 55 ++++++++++++++++++++++++++++++++++++++------ deal.II/configure | 54 +++++++++++++++++++++++++++++++++++-------- deal.II/configure.in | 9 +++++--- 3 files changed, 98 insertions(+), 20 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 762594a489..4ce04fc925 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -815,6 +815,47 @@ AC_DEFUN(DEAL_II_SET_F77_FLAGS, dnl + +dnl ------------------------------------------------------------- +dnl Check whether user wants optimization for a certain type of +dnl CPU. If so, then set some flags, dependent on what he +dnl wants and the compiler. Not very many CPUS are listed here, +dnl but this is simple to expand if desired. +dnl +dnl To use this feature, use --with-cpu=something +dnl +dnl Usage: DEAL_II_CHECK_CPU_OPTIMIZATIONS +dnl +dnl ------------------------------------------------------------- +AC_DEFUN(DEAL_II_CHECK_CPU_OPTIMIZATIONS, dnl +[ + AC_ARG_WITH(cpu, + [ --with-cpu=cpu Optimize specifically for the given CPU type, + rather than just generating code for this + processor family], + withcpu=$withval, + withcpu=) + AC_MSG_CHECKING(for CPU to optimize for) + case $withcpu in + PowerPC64) + AC_MSG_RESULT(PowerPC64) + case $GXX_VERSION in + gcc*) + CXXFLAGSG="$CXXFLAGSG -maix64" + CXXFLAGSO="$CXXFLAGSO -maix64 -mpowerpc64 -mcpu=powerpc64 -mtune=powerpc64" + AR="$AR -X 64" + LDFLAGS="$LDFLAGS -maix64" + ;; + esac + ;; + + *) + AC_MSG_RESULT(none given or not recognized) + esac +]) + + + dnl ------------------------------------------------------------- dnl In some cases, -threads (or whatever else command line option) dnl switches on some preprocessor flags. If this is not the case, @@ -900,8 +941,8 @@ dnl ------------------------------------------------------------- AC_DEFUN(DEAL_II_CHECK_MULTITHREADING, dnl [ AC_ARG_ENABLE(multithreading, - [ --enable-multithreading Set compiler flags to allow for - multithreaded programs], + [ --enable-multithreading set compiler flags to allow for + multithreaded programs], enablemultithreading=$enableval, enablemultithreading=no) ]) @@ -1034,7 +1075,7 @@ AC_DEFUN(DEAL_II_CHECK_USE_MT, dnl [ AC_ARG_WITH(multithreading, [ --with-multithreading=name If name==posix, or no name given, then use - POSIX threads], + POSIX threads], withmultithreading=$withval, withmultithreading=no) @@ -1177,8 +1218,8 @@ dnl ------------------------------------------------------------- AC_DEFUN(DEAL_II_CHECK_COMPAT_BLOCKER, dnl [ AC_ARG_ENABLE(compat-blocker, - [ --enable-compat-blocker=mapping Block functions that implicitely - assume a Q1 mapping], + [ --enable-compat-blocker=mapping block functions that implicitely + assume a Q1 mapping], enable_compat_blocker=$enableval, enable_compat_blocker="") @@ -3077,7 +3118,7 @@ AC_DEFUN(DEAL_II_CHECK_KDOC, dnl dnl Find the kdoc directory for documentation. kdoc2 is in dnl the contrib directory, but you might want another one AC_ARG_WITH(kdoc, - [ --with-kdoc=DIR use kdoc installed in DIR], + [ --with-kdoc=DIR use kdoc installed in DIR], kdocdir=$withval, kdocdir=${DEAL2_DIR}/contrib/kdoc/bin) AC_MSG_CHECKING(for kdoc) @@ -3113,7 +3154,7 @@ dnl ------------------------------------------------------------- AC_DEFUN(DEAL_II_CHECK_DOCXX, dnl [ AC_ARG_WITH(docxx, - [ --with-docxx=PATH use the doc++ executable pointed to by PATH], + [ --with-docxx=PATH use the doc++ executable pointed to by PATH], docxx=$withval, docxx=to-be-determined) if test "$docxx" = to-be-determined ; then diff --git a/deal.II/configure b/deal.II/configure index d9a659b69b..a88aae5f28 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.144 . +# From configure.in Revision: 1.145 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57. # @@ -813,20 +813,23 @@ if test -n "$ac_init_help"; then Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-multithreading Set compiler flags to allow for - multithreaded programs - --enable-shared Set compiler flags to generate shared libraries - --enable-compat-blocker=mapping Block functions that implicitely - assume a Q1 mapping - --enable-multigrid Include multigrid code in library + --enable-multithreading set compiler flags to allow for + multithreaded programs + --enable-shared set compiler flags to generate shared libraries + --enable-compat-blocker=mapping block functions that implicitely + assume a Q1 mapping + --enable-multigrid include multigrid code in library Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-multithreading=name If name==posix, or no name given, then use - POSIX threads - --with-kdoc=DIR use kdoc installed in DIR - --with-docxx=PATH use the doc++ executable pointed to by PATH + POSIX threads + --with-cpu=cpu Optimize specifically for the given CPU type, + rather than just generating code for this + processor family + --with-kdoc=DIR use kdoc installed in DIR + --with-docxx=PATH use the doc++ executable pointed to by PATH Some influential environment variables: CC C compiler command @@ -7170,6 +7173,37 @@ echo "$as_me:$LINENO: result: ------------------ checking compiler flags ------- echo "${ECHO_T}------------------ checking compiler flags ------------------" >&6 + +# Check whether --with-cpu or --without-cpu was given. +if test "${with_cpu+set}" = set; then + withval="$with_cpu" + withcpu=$withval +else + withcpu= +fi; + echo "$as_me:$LINENO: checking for CPU to optimize for" >&5 +echo $ECHO_N "checking for CPU to optimize for... $ECHO_C" >&6 + case $withcpu in + PowerPC64) + echo "$as_me:$LINENO: result: PowerPC64" >&5 +echo "${ECHO_T}PowerPC64" >&6 + case $GXX_VERSION in + gcc*) + CXXFLAGSG="$CXXFLAGSG -maix64" + CXXFLAGSO="$CXXFLAGSO -maix64 -mpowerpc64 -mcpu=powerpc64 -mtune=powerpc64" + AR="$AR -X 64" + LDFLAGS="$LDFLAGS -maix64" + ;; + esac + ;; + + *) + echo "$as_me:$LINENO: result: none given or not recognized" >&5 +echo "${ECHO_T}none given or not recognized" >&6 + esac + + + echo "$as_me:$LINENO: checking for consistency of CXXFLAGSG flags" >&5 echo $ECHO_N "checking for consistency of CXXFLAGSG flags... $ECHO_C" >&6 ac_ext=cc diff --git a/deal.II/configure.in b/deal.II/configure.in index 07cd95d401..df6b77e44f 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -242,7 +242,7 @@ AC_MSG_RESULT() AC_MSG_RESULT(-------------- configuring shared/static libs ---------------) AC_ARG_ENABLE(shared, -[ --enable-shared Set compiler flags to generate shared libraries], +[ --enable-shared set compiler flags to generate shared libraries], enableshared=$enableval, enableshared=yes) @@ -298,7 +298,7 @@ dnl ------------------------------------------------------------- dnl Test if multigrid should be enabled dnl default is yes if multigrid directory present AC_ARG_ENABLE(multigrid, -[ --enable-multigrid Include multigrid code in library], +[ --enable-multigrid include multigrid code in library], enablemultigrid=$enableval, if test -r deal.II/include/multigrid/multigrid.h ; then enablemultigrid=yes ; @@ -333,12 +333,15 @@ AC_SUBST(USE_CONTRIB_HSL) dnl ------------------------------------------------------------- -dnl Consistency of compiler flags +dnl Optimizations and consistency of compiler flags dnl ------------------------------------------------------------- AC_MSG_RESULT() AC_MSG_RESULT(------------------ checking compiler flags ------------------) +dnl Possible add some flags is optimizations are requested +DEAL_II_CHECK_CPU_OPTIMIZATIONS + dnl Last check: test whether CXXFLAGS and F77FLAGS are ok DEAL_II_CHECK_CXXFLAGS_CONSISTENCY DEAL_II_CHECK_F77FLAGS_CONSISTENCY -- 2.39.5