]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Implement --with-cpu. Properly indent output for ./configure --help.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 6 Mar 2003 16:46:38 +0000 (16:46 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 6 Mar 2003 16:46:38 +0000 (16:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@7274 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure
deal.II/configure.in

index 762594a489b13c473df32b1bf8895b7880df6f0d..4ce04fc9252f8de6303a2b8dbb01f6bdcd15d7dc 100644 (file)
@@ -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
index d9a659b69b88e08e7e6f1a82473ddead9151b6e5..a88aae5f281f28cdd1605d1c17d892b68dc6b1ba 100755 (executable)
@@ -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
index 07cd95d401b968a15bbdebc8d69c5506b914da92..df6b77e44fa6ef200d533bd9c7608d0f8e9d146a 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.