diff -cr amber8.orig/src/configure amber8/src/configure
*** amber8.orig/src/configure	2004-03-12 09:18:52.000000000 +0900
--- amber8/src/configure	2010-05-24 15:30:10.000000000 +0900
***************
*** 36,41 ****
--- 36,45 ----
        -p4         Optimize for Pentium 4 processor (intel,pgf90).
        -cygwin     Add CygWin flags for Windows (absoft).
  
+       -p4m1       Optimize for 65nm Intel Core2 processor (intel).
+       -p4m2       Optimize for 45nm Hi-k Intel Core2 and Xeon processor (intel).
+       -p4m3       Optimize for Intel Core i processor (intel).
+ 
      General flags:
        -big         Big systems support, ie, 8 byte integers and pointers.
        -fpp_prefix= Define the prefix for FPP preprocessing; default is "_".
***************
*** 44,49 ****
--- 48,57 ----
        -static      Static linking, i.e., prevent linking with shared libraries.
        -verbose     Add verbose compiler comment and warning flags.
  
+     Intel compiler flags:
+       -static-mkl  Static linking for MKL, i.e., prevent effect by difference
+                    library versions.
+ 
      Other environment variables:
        AMBERHOME    Root directory of the Amber tree.
        MKL_HOME     Root directory of the Intel Math Kernel Library
***************
*** 77,82 ****
--- 85,97 ----
  static=$unrequested
  verbose=$unrequested
  verbosity=''
+ # 2010-05-17 by Nob-rin
+ # Intel MKL 10.1 (Intel Compiler 11.0) link option
+ static_mkl=$unrequested
+ sse4=$unrequested
+ intel_libs='-liomp5 -lpthread'
+ intel_mkl_shared='-lmkl_lapack -lmkl_intel -lmkl_intel_thread -lmkl_core'
+ intel_mkl_static='-Wl,--start-group $mkll/libmkl_intel.a $mkll/libmkl_intel_thread.a $mkll/libmkl_core.a $mkll/libmkl_lapack.a -Wl,--end-group'
  
  while [ $# -gt 0 ]; do
      case "$1" in
***************
*** 92,97 ****
--- 107,115 ----
      -opteron) opteron="yes" ;;
      -p4)      p4="yes" ;;
      -cygwin)  cygwin="yes" ; sfx=".exe" ;;
+     -p4m1)    p4="yes" ; sse4="ssse3" ;;
+     -p4m2)    p4="yes" ; sse4="sse4.1" ;;
+     -p4m3)    p4="yes" ; sse4="sse4.2" ;;
  
      -big)     big="yes" ;;
      -fpp_prefix=*) fpp_prefix=${1#-fpp_prefix=} ;;
***************
*** 100,105 ****
--- 118,125 ----
      -static)  static="yes" ;;
      -verbose) verbose="yes" ;;
  
+ 	-static-mkl) static_mkl="yes" ;;
+ 
      -*) usage ;;
  
      *) if [ $# -gt 1 ]; then
***************
*** 111,117 ****
      shift
  done
  
- 
  if [ $arch = "unknown" ]; then
      # Guess architecture/compiler
      arch=`uname -s`
--- 131,136 ----
***************
*** 400,409 ****
  
  ############ IA32 Intel compilers;  ################
  ifc7|ifort|ia32_ifort)
!     cc=gcc
!     altcc=gcc
!     cplusplus=g++
!     cflags=-O2
      loadcc="$cc $static_flag"
      fppflags="$fppflags"
      freeformat_flag='-FR'
--- 419,430 ----
  
  ############ IA32 Intel compilers;  ################
  ifc7|ifort|ia32_ifort)
! 	# 2008-02-18 -- Use Intel Compilers instead of GCC
!     fpp=fpp
!     cc=icc
!     altcc=icc
!     cplusplus=icpc
!     cflags="-O3 -ip"
      loadcc="$cc $static_flag"
      fppflags="$fppflags"
      freeformat_flag='-FR'
***************
*** 424,431 ****
          fflags="$fflags -tpp6 "
  #       cflags="$cflags -march=athlon"
      elif [ $p4 = "yes" ]; then
!         fflags="$fflags -tpp7 "
! #       cflags="$cflags -march=pentium4"
          loadlib="$loadlib -lsvml"
      fi
  
--- 445,459 ----
          fflags="$fflags -tpp6 "
  #       cflags="$cflags -march=athlon"
      elif [ $p4 = "yes" ]; then
! 		# 2008-02-18 Nob-rin.
! 		#   -tpp7 is too old for ic11
! 		#   Use icc as C compiler
!         fflags="$fflags -xsse2 "
!         cflags="$cflags -xsse2 "
!         if [ $sse4 != $unrequested ]; then
! 		    fflags="$fflags -ax$sse4 "
! 			cflags="$cflags -ax$sse4 "
! 		fi
          loadlib="$loadlib -lsvml"
      fi
  
***************
*** 452,466 ****
      if [ $mkll != $unrequested ]; then
          use_lapack=VENDOR_SUPPLIED
          use_blas=VENDOR_SUPPLIED
!         if [ $static = "yes" ]; then
!             # Intel® Math Kernel Library 6.1 for Linux Technical User Notes
!             #  IA-32 static linking of LAPACK and kernels
!             loadlib="$loadlib $mkll/libmkl_lapack.a $mkll/libmkl_ia32.a -L$mkll -lguide -lpthread"
!         else
              # Intel® Math Kernel Library 6.1 for Linux Technical User Notes
              #  IA-32 dynamic linking of double-precision-LAPACK and kernels
!             loadlib="$loadlib -L$mkll -lvml -lmkl_lapack64 -lmkl -lguide -lpthread"
!         fi
          fppflags="$fppflags -DMKL"
      fi
  
--- 480,502 ----
      if [ $mkll != $unrequested ]; then
          use_lapack=VENDOR_SUPPLIED
          use_blas=VENDOR_SUPPLIED
! # --- ignore "-static" option --- by Nob-rin, 2010-05-24 #
! #       if [ $static = "yes" ]; then
! #           # Intel® Math Kernel Library 6.1 for Linux Technical User Notes
! #           #  IA-32 static linking of LAPACK and kernels
! #           loadlib="$loadlib $mkll/libmkl_lapack.a $mkll/libmkl_ia32.a -L$mkll -lguide -lpthread"
! #       else
              # Intel® Math Kernel Library 6.1 for Linux Technical User Notes
              #  IA-32 dynamic linking of double-precision-LAPACK and kernels
!             # Static linking of MKL (for Intel MKL 10.1)
! 			#  MKL 10.2 will fail in ptraj test by Nob-rin, 2010-05-24
!             if [ $static_mkl = "yes" ]; then
!                 intel_libs=`eval echo "$intel_mkl_static $intel_libs"`
!             else
!                 intel_libs="$intel_mkl_shared $intel_libs"
!             fi
!             loadlib="$loadlib -L$mkll $intel_libs"
! #       fi
          fppflags="$fppflags -DMKL"
      fi
  
***************
*** 471,477 ****
          fc=ifc
          load="$fc $static_flag -Vaxlib"
      fi
!     foptflags="$fflags -mp1 -ip -O3"
      fflags="$fflags -mp1 -O0"
  
      # nofor_main prevents linking of the fortran main routine.
--- 507,513 ----
          fc=ifc
          load="$fc $static_flag -Vaxlib"
      fi
!     foptflags="$fflags -mp1 -ip -parallel -O3"
      fflags="$fflags -mp1 -O0"
  
      # nofor_main prevents linking of the fortran main routine.
diff -cr amber8.orig/src/nmode/Makefile amber8/src/nmode/Makefile
*** amber8.orig/src/nmode/Makefile	2004-01-15 07:37:52.000000000 +0900
--- amber8/src/nmode/Makefile	2010-05-24 15:29:00.000000000 +0900
***************
*** 123,129 ****
  	$(ALTCC) -c $(ALTCFLAGS) -o binpos.o ../lib/binpos.c
  
  #-----------
! 
  calink.o:	calink.f
  	$(FPP) -DFORMATTED  $< > _$<
  	$(FC) -c $(FOPTFLAGS) -o $@ _$<
--- 123,131 ----
  	$(ALTCC) -c $(ALTCFLAGS) -o binpos.o ../lib/binpos.c
  
  #-----------
! # 2009-02-18 by Nob-rin.
! # -O3 optimization causes Segmentation fault on test/newton_raph/Run.newton_raph
! FOPTFLAGS+= -O2
  calink.o:	calink.f
  	$(FPP) -DFORMATTED  $< > _$<
  	$(FC) -c $(FOPTFLAGS) -o $@ _$<
