Updated article reference.
authorlindahl <lindahl>
Thu, 15 Nov 2001 16:57:33 +0000 (16:57 +0000)
committerlindahl <lindahl>
Thu, 15 Nov 2001 16:57:33 +0000 (16:57 +0000)
Added configuration flags to support altivec on powerpc.

README
acinclude.m4
configure.ac

diff --git a/README b/README
index 7285ed55412bee8358f83a41b3b632f0cd282dfc..b95e45584eb8a8567bbea87219a46f1db492d1de 100644 (file)
--- a/README
+++ b/README
@@ -56,7 +56,7 @@ To help us fund development, we humbly ask that you cite the GROMACS papers:
  
 * GROMACS 3.0: A package for molecular simulation and trajectory analysis
   Erik Lindahl, Berk Hess and David van der Spoel
-  To appear in J. Mol. Mod., up-to-date info will be added to the homepage.
+  J. Mol. Mod. 7, 306-317 (2001)
 
 There are a lot of cool features we'd like to include in future versions,
 but our resources are limited. All kinds of donations are welcome, both in 
index 240c8b5fac06db899c5404a421884625f9f80be9..116ef5b100476c581290e422a1a9404ade50ecff 100644 (file)
@@ -341,7 +341,11 @@ AC_DEFUN(ACX_CHECK_CC_FLAGS,
 AC_REQUIRE([AC_PROG_CC])
 AC_CACHE_CHECK(whether $CC accepts $1, ac_$2,
 [echo 'void f(){}' > conftest.c
-if test -z "`$CC $1 -c conftest.c 2>&1`"; then
+res=`$CC $1 -c conftest.c 2>&1`
+#
+# The stupid intel compiler echos the filename on stderr...
+# -o "$res" == "conftest.c:"
+if test -z "$res" -o "$res" == "conftest.c:"; then
        ac_$2=yes
 else
        ac_$2=no
@@ -705,7 +709,8 @@ case "${host_cpu}-${host_os}" in
 
   *-*)
     # most of these systems (e.g. linux, FreeBSD) use gcc which is treated
-    # further down, but we can at least check if the Portland compilers are used:
+    # further down, but check for some specific compilers.
+    # Portland group compilers:
     if $CC -V 2>  /dev/null | grep ortland > /dev/null 2>&1; then
       case "${host_cpu}" in
        i586)
@@ -723,6 +728,25 @@ case "${host_cpu}-${host_os}" in
        xFFLAGS="$xCFLAGS"
       fi       
     fi
+
+    # Intel compilers
+    if $CC -V 2>&1 | grep 'Intel Corporation' > /dev/null 2>&1; then
+      case "${host_cpu}" in
+       i686)
+         xCFLAGS="-O3 -tpp6 -axK -ip" 
+         ;;
+       ia64)
+         xCFLAGS="-O3 -ip" 
+         ;;
+      esac
+      xASFLAGS="$xCFLAGS"
+    fi
+    if test "$enable_fortran" = "yes"; then
+      if $F77 -V 2>&1 | grep 'Intel Corporation' > /dev/null 2>&1; then
+       xFFLAGS="$xCFLAGS"
+      fi       
+    fi
+
     ;;
 esac   
 # Phew, end of all those operating systems and processors!                     
@@ -737,14 +761,12 @@ if test $ac_cv_prog_gcc = yes; then
     ACX_CHECK_CC_FLAGS(-O6,o6,xCFLAGS="$xCFLAGS -O6",[
        ACX_CHECK_CC_FLAGS(-O4,o4,xCFLAGS="$xCFLAGS -O4",[
            ACX_CHECK_CC_FLAGS(-O3,o3,xCFLAGS="$xCFLAGS -O3")])])
-    xCFLAGS="$xCFLAGS -fomit-frame-pointer -finline-functions -funroll-all-loops -Wall -Wno-unused"
+      xCFLAGS="$xCFLAGS -fomit-frame-pointer -finline-functions -Wall -Wno-unused"
     # the portland compiler only knows .s files, and always runs them
     # through cpp. We support this by telling gcc to preprocess .s files.
     xASFLAGS="$xCFLAGS -x assembler-with-cpp"
     # -malign-double for x86 systems
     ACX_CHECK_CC_FLAGS(-malign-double,align_double,xCFLAGS="$xCFLAGS -malign-double")
-    # don't use the separate apple cpp on OS X
-    ACX_CHECK_CC_FLAGS(-no-cpp-precomp,no_cpp_precomp,xCFLAGS="$xCFLAGS -no-cpp-precomp")    
   fi
 fi
   
@@ -768,6 +790,11 @@ if test "$GCC" = "yes"; then
     # i586/i686 cpu flags don't improve speed, thus no need to use them.
     # don't check f77 separately - we assume f77 and gcc are similar     
     powerpc*)
+        # don't use the separate apple cpp on OS X
+        ACX_CHECK_CC_FLAGS(-no-cpp-precomp,no_cpp_precomp,xCFLAGS="$xCFLAGS -no-cpp-precomp")
+        # And try to add -fvec or -faltivec to get altivec extensions!
+        ACX_CHECK_CC_FLAGS(-fvec,fvec,xCFLAGS="$xCFLAGS -fvec",
+               ACX_CHECK_CC_FLAGS(-faltivec,faltivec,xCFLAGS="$xCFLAGS -faltivec"))
       cputype=`(grep cpu /proc/cpuinfo | head -1 | cut -d: -f2 | sed 's/ //g') 2> /dev/null`
       is60x=`echo $cputype | egrep "^60[0-9]e?$"`
       if test -n "$is60x"; then
@@ -781,6 +808,12 @@ if test "$GCC" = "yes"; then
       if test -z "$CPU_FLAGS"; then
        ACX_CHECK_CC_FLAGS(-mpowerpc,m_powerpc,CPU_FLAGS=-mpowerpc)
       fi
+      ;;
+   *)
+        # -funroll-all-loops exposes a bug in altivec-enabled gcc-2.95.3
+        # on powerpc, so we only enable it on other platforms.
+        ACX_CHECK_CC_FLAGS(-funroll-all-loops,funroll_all_loops,xCFLAGS="$xCFLAGS -funroll-all-loops")
+      ;;
    esac
 else
   AM_CONDITIONAL(GNU_CC,false)
index 8778632ab8f818f71590be4cbf7315e5e518c70c..6a8aa374ccc0023c8692fcd756ea6193767c6fff 100644 (file)
@@ -3,12 +3,12 @@
 #######################################################################
 
 AC_PREREQ(2.50)
-AC_INIT(GROMACS, 3.0.3, gromacs@gromacs.org)
+AC_INIT(GROMACS, 3.0.99, gromacs@gromacs.org)
 AC_CONFIG_SRCDIR(src/gmxlib/3dview.c)
 AC_CONFIG_AUX_DIR(config)
 AC_CANONICAL_HOST
 
-AM_INIT_AUTOMAKE(gromacs, 3.0.3)
+AM_INIT_AUTOMAKE(gromacs, 3.0.99)
 AC_PREFIX_DEFAULT(/usr/local/gromacs)
 AM_CONFIG_HEADER(src/config.h)
 dnl This is the version info according to the libtool versioning system.
@@ -80,6 +80,15 @@ case "${host_cpu}" in
    *) enable_x86_asm=no ;;
 esac
 
+### Altivec on powerpc (motorola)
+AC_ARG_ENABLE(ppc_altivec,
+ [  --disable-ppc-altivec         don't build Altivec loops on PowerPC],,enable_ppc_altivec=yes)
+case "${host_cpu}-${host_vendor}" in
+   ppc*-ibm* | powerpc*-ibm*) enable_ppc_altivec=no ;;
+   ppc*-* | powerpc*-*) ;; 
+   *) enable_ppc_altivec=no ;;
+esac
+
 AC_ARG_ENABLE(axp_asm,
  [  --enable-axp-asm              include vectorized sqrt routines for alpha],,enable_axp_asm=no)
 
@@ -301,6 +310,32 @@ EOF
   fi
 fi
 
+if test "$enable_ppc_altivec" = "yes"; then
+  if test "$enable_float" = "no"; then
+    AC_MSG_WARN([PowerPC Altivec loops can only be used in single precision - disabling])
+    enable_ppc_altivec=no
+  else 
+    AC_MSG_CHECKING([whether the compiler supports altivec extensions])
+    AC_TRY_COMPILE([],[
+#ifndef __VEC__
+choke_me
+#endif
+],[
+    AC_MSG_RESULT([yes])
+    GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} inner_altivec.lo"
+    AC_DEFINE([USE_PPC_ALTIVEC],,[Use PowerPC Altivec inner loops])],[
+      AC_MSG_RESULT([no])
+      AC_MSG_WARN([no altivec support found - On G4 and later Motorola PowerPC]
+[CPUs you can get a HUGE performance gain by using an altivec-enabled compiler.]
+[Check out www.altivec.org, or use the development version of gcc-3.1])
+      enable_ppc_altivec=no])
+  fi  
+  # the gcc instruction scheduler destroys our handcoded altivec.
+  if test "$enable_ppc_altivec" = "yes"; then
+    ACX_CHECK_CC_FLAGS(-fno-schedule-insns,fno_schedule_insns,CFLAGS="$CFLAGS -fno-schedule-insns")
+  fi
+fi
+
 if test "$enable_axp_asm" = "yes"; then
   case "${host_cpu}" in
     alpha*) 
@@ -349,7 +384,7 @@ AC_PROG_LN_S
 ############################################################################
 # Checks for libraries.
 ############################################################################
-AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR([No math library found]))
+#AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR([No math library found]))
 
 #####
 # IBM provides a MASS library with vectorized and optimized math stuff,