Author: Dave Case, from Kay Tiong Khoo at apple Date: 08/28/03 Programs: sander, anal, nmode, gibbs Description: Some small changes are needed to get amber to compile using the NAGF95 compiler, at least under Macintosh OSX, perhaps other platforms using this compiler. There are two basic changes: occurences of DFLOAT() need to be changed to DBLE(), and various routines need a USE F90_UNIX_ENV, a USE F90_UNIX_IO or a USE_F90_PROC module call. There is also an updated Machine file and README file. ------------------------------------------------------------------------------ Here is the README file: Building Amber 7 on Mac OS 10.2.7 *** Prerequisites www.apple.com - X11 for Mac OS X Public Beta v3 - X11 for Mac OS X Public Beta SDK www.nag.co.uk - NAGWare Fortran 95 compiler Release 4.2 Apple Developer Tools - gcc 3.1 *** Setting up the environment - Setting environment variables setenv AMBERHOME /usr/local/amber7 setenv PATH /usr/local/bin:/usr/X11R6/bin:${AMBERHOME}/exe:${PATH} - Creating a link to vecLib in /usr/lib. sudo ln -s /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib libvecLib.dylib *** Machine file We've created a new machine file at "Machines/Machine.nagf95_apple". *** Changes to Source - All changes to source are marked by "#ifdef NAGF95". - Replaced /Users/kaytiong/amber7/src/ptraj/pdb/Makefile:31 with "../../Compile RANLIB $(LIBARCH)" - Replaced /Users/kaytiong/amber7/sander/Makefile:94 with "$(OBJ) ../lib/nxtsec.o $$SYSLIB -lvecLib;" *** Benchmark Timings on Power Mac G5 2GHz DP In 100 steps | Total time 115.50 (100.0% of ALL ) Therefore, time per step is 1.15s. Refer to "http://amber.scripps.edu/amber7.bench4.html". *** Problems with NAG!! These problems occur while testing the installation using "make test.sander". For this installation, I only tested "sander". - NAMELIST issue For all input files, replace &end with / - Incompatible argument size. This is found in mdread.f:1389 call printflags2(' ',1,n,line,.true.) <--- passes in a single character return end c subroutine printflags2(flag,nc,n,line,last) <--- expects flags to be of fixed length 80 implicit none character*80 line,flag <---- Defines flag to be 80 characters wide .... Error message: CHARACTER actual arg LEN=1 shorter than dummy arg LEN=80 Program terminated by fatal error Abort - Negative zero This is causing all known failure while running the "test.sander" testsuite. 195,197c195,197 < BOND = 0.0000 ANGLE = 0.0000 DIHED = 0.0000 < 1-4 NB = 0.0000 1-4 EEL = 0.0000 VDWAALS = 1.9346 < EELEC = 1.9632 EHBOND = 0.0000 RESTRAINT = 0.0000 --- > BOND = -0.0000 ANGLE = -0.0000 DIHED = -0.0000 > 1-4 NB = -0.0000 1-4 EEL = -0.0000 VDWAALS = 1.9346 > EELEC = 1.9632 EHBOND = -0.0000 RESTRAINT = -0.0000 ------------------------------------------------------------------------------ Here is the required Machine file: #! /bin/csh -f ######################################################################## # # # Copyright (c) 1986, 1991, 1995 # # Regents of the University of California # # # # All Rights Reserved # # # # Machine Dependency Handling System # # # # Bill Ross ross@cgl.ucsf.edu # # An extension of work of George Seibel # # # # Dependencies written by various authors. # # # # Permission to use, copy, modify, and distribute this software and # # its documentation for any purpose and without fee is hereby # # granted, provided that the above copyright notice appear in all # # copies and that both that copyright notice and this permission # # notice appear in supporting documentation, and that the name of # # the University of California not be used in advertising or # # publicity pertaining to distribution of the software without # # specific, written prior permission. # # # # THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALL # # WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED # # WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE # # UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR # # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM # # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, # # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # # ######################################################################## # setenv MACHINE "MacOSX" setenv MACH NAGF95 setenv MACHINEFLAGS " " # CPP is the cpp for this machine setenv CPP "cpp -traditional " setenv CC "gcc" # SYSDIR is the name of the system-specific source directory relative to src/*/ setenv SYSDIR Machines/standard # COMPILER ALIASES: # LOADER/LINKER: setenv LOAD "f95" setenv LOADLIB "-lm" setenv NAGF95_COMPAT "-w -dcfuns -dusty -mismatch -maxcontin=100" setenv NAGF95_OPT "-O3 -Wc,-funroll-loops" # little or no optimization: setenv L0 "f95 -c -g $NAGF95_COMPAT" # modest optimization (local scalar): setenv L1 "f95 -c $NAGF95_OPT $NAGF95_COMPAT" # high scalar optimization (but not vectorization): setenv L2 "f95 -c $NAGF95_OPT $NAGF95_COMPAT" # high optimization (may be vectorization, not parallelization): setenv L3 "f95 -c $NAGF95_OPT $NAGF95_COMPAT" # ranlib, if it exists setenv RANLIB ranlib ------------------------------------------------------------------------------ Here is a patch file for sander; changes to other programs are quite similar. *** ew_bspline.f 2001/11/05 19:39:21 1.12 --- ew_bspline.f 2003/08/28 21:07:16 *************** *** 517,523 **** do k = 2,nfft m = k - 1 if ( k .gt. nf )m = k - 1 - nfft ! x = pi*dfloat(m)/nfft g0 = dcos(x)/dsin(x) gp = 1.d0 powcos(1) = 1.d0 --- 517,523 ---- do k = 2,nfft m = k - 1 if ( k .gt. nf )m = k - 1 - nfft ! x = pi*DBLE(m)/nfft g0 = dcos(x)/dsin(x) gp = 1.d0 powcos(1) = 1.d0 *************** *** 650,656 **** gsum = 1.d0 return endif ! frac = dfloat(m)/nfft x = pi*frac gsum = 1.d0 do k = 1,kcut --- 650,656 ---- gsum = 1.d0 return endif ! frac = DBLE(m)/nfft x = pi*frac gsum = 1.d0 do k = 1,kcut *** mdfil.f 2001/10/21 04:55:15 7.19 --- mdfil.f 2003/08/28 21:07:27 *************** *** 23,28 **** --- 23,31 ---- c c OUTPUT: (to common) c + #ifdef NAGF95 + USE F90_UNIX_ENV + #endif #include "files.h" # include "ew_numtasks.h" #ifdef MPI Index: mdread.f =================================================================== RCS file: /thr/gamow/cvsroot/amber7/src/sander/mdread.f,v retrieving revision 7.157 diff -c -r7.157 mdread.f *** mdread.f 2002/08/08 05:24:20 7.157 --- mdread.f 2003/08/28 21:07:33 *************** *** 1388,1394 **** c subroutine printflags2(flag,nc,n,line,last) implicit none ! character*80 line,flag integer nc,n logical last c --- 1388,1395 ---- c subroutine printflags2(flag,nc,n,line,last) implicit none ! character*80 line ! character(*) flag integer nc,n logical last c *** mexit.f 2000/05/30 18:15:08 7.4 --- mexit.f 2003/08/28 21:07:42 *************** *** 1,4 **** --- 1,7 ---- subroutine mexit(ifil, i) + #ifdef NAGF95 + USE F90_UNIX_PROC + #endif C C************************************************************************ C AMBER ** *** pubfft.f 2001/11/05 19:39:23 7.2 --- pubfft.f 2003/08/28 21:07:50 *************** *** 261,267 **** IFAC(1) = N IFAC(2) = NF TPI = 6.28318530717959d0 ! ARGH = TPI/DFLOAT(N) I = 2 L1 = 1 DO 110 K1=1,NF --- 261,268 ---- IFAC(1) = N IFAC(2) = NF TPI = 6.28318530717959d0 ! ! ARGH = TPI/DBLE(N) I = 2 L1 = 1 DO 110 K1=1,NF *************** *** 277,283 **** WA(I) = 0.d0 LD = LD+L1 FI = 0.d0 ! ARGLD = DFLOAT(LD)*ARGH DO 108 II=4,IDOT,2 I = I+2 FI = FI+1.d0 --- 278,284 ---- WA(I) = 0.d0 LD = LD+L1 FI = 0.d0 ! ARGLD = DBLE(LD)*ARGH DO 108 II=4,IDOT,2 I = I+2 FI = FI+1.d0 ------------------------------------------------------------------------------ In amber7/Machines/standard, make the following patch to sys.f: *** sys.f 2000/09/27 22:54:24 6.3 --- sys.f 2003/08/28 21:35:26 *************** *** 50,55 **** --- 50,58 ---- end c----------------------------------------------------------------------- subroutine amflsh(lun) + #ifdef NAGF95 + USE F90_UNIX_IO + #endif c wrapper for i/o buffer flushing routine c Author: George Seibel c ------------------------------------------------------------------------------ Temporary workarounds: none