PGI Guide to CHARMM

This guide is intended to aid in building the Chemistry at HARvard Molecular Mechanics (CHARMM) application for use on a x64 systems running 64-bit Linux.

Version Information

This guide was created for Version v30b2 of CHARMM using PGI Compiler Release 7.0 or 7.1.

Application Notes

Information about CHARMM (Chemistry at HARvard Molecular Mechanics) can be found at the CHARMM Web page.

Obtaining the Source Code

Information about obtaining the source can be found at http://yuri.harvard.edu/

Dependencies

None.

Configuration and Set-up Information

Five files need changed to allow the code to be built in 64-bit mode while using dynamic memory allocation. The files are, install.com, cstuff.c, machutil.src, space.src, and ./build/UNX/Makefile_gnu. Below are the changes needed.

./install.com

This change allows specification of the I8 install.com option for architecture "gnu" for any kind of compiler

Before:

   447       if ( $chm_host == sgi64 || \
   448            $chm_host == altix || \
   449            $chm_host == alpha || \
   450            ( $chm_host == gnu && $efc == 1) || \
   451            ( $chm_host == gnu && $cfort == 1) \
   452                                                  ) then
   453         sed -e 's/$(I8DUM1)/-i8/' -e 's/$(I8DUM2)/-Di8/' \
   454           $chmbuild/Makefile_$chmhost > $chmbuild/Makefile_$$
   455         /bin/mv $chmbuild/Makefile_$$ $chmbuild/Makefile_$chmhost
   456       else

After:

   447       if ( $chm_host == sgi64 || \
   448            $chm_host == altix || \
   449            $chm_host == alpha || \
   450            $chm_host == gnu ) then
   451         sed -e 's/$(I8DUM1)/-i8/' -e 's/$(I8DUM2)/-Di8/' \
   452           $chmbuild/Makefile_$chmhost > $chmbuild/Makefile_$$
   453         /bin/mv $chmbuild/Makefile_$$ $chmbuild/Makefile_$chmhost
   454       else

./source/machdep/cstuff.c

This change makes function "loc_" return type "long" rather than "int" when the I8 install.com option is used.

Before:

   612 #if machine_aix370 || gnu
   613 int loc_(numb)
   614 #else
   615 int loc(numb)
   616 #endif

After:

   612  #if machine_aix370 || gnu
   613  INT loc_(numb)
   614  #else
   615  INT loc(numb)
   616  #endif

This change is needed because these functions are called for INTEGER type F77 variables which are 64-bit on x86_64; using INT makes them C type "long" which is also 64-bit.

Before:

   955 unsigned int ishft_(i,j)

After:

   955 unsigned INT ishft_(i,j)

Before:

   961 unsigned int iand_(i,j)

After:

   961 unsigned INT iand_(i,j)

Before:

   966 unsigned int ieor_(i,j)

After:

   966 unsigned INT ieor_(i,j)

./source/machdep/machutil.src

This change specifies the size of the heap word to be 8 when the I8 install.com option is used.

Before:

   857 ##ELIF UNIX IBMRS IBMVM IBMMVS IBMSP GNU OS2 IBMAIX OSX
   858       LOCDIF=LOC(A)-LOC(B)
   859       NMATCH=4
   860 ##ELIF APOLLO
   861       INTEGER IADDR
   862       EXTERNAL IADDR

After:

   857 ##ELIF UNIX IBMRS IBMVM IBMMVS IBMSP GNU OS2 IBMAIX OSX
   858       LOCDIF=LOC(A)-LOC(B)
   859 ##IF INTEGER8
   860       NMATCH=8
   861 ##ELSE
   862       NMATCH=4
   863 ##ENDIF
   864 ##ELIF APOLLO
   865       INTEGER IADDR
   866       EXTERNAL IADDR

./source/machdep/space.src

This change allows the use of the "fmalloc" function defined in ./source/machdep/cstuff.c instead of the intrinsic "malloc".

Before:

   325 ##IF INTEGER8
   326       CODE = LEN*8
   327       B8=MALLOC(CODE)      !##.not.SUN64
   328       B8=MALLOC64(CODE)    !##SUN64

After:

   325 ##IF INTEGER8
   326       CODE = LEN*8
   327 C     B8=MALLOC(CODE)      !##.not.SUN64
   328 C     B8=MALLOC64(CODE)    !##SUN64
   329       B8=FMALLOC(CODE)

./build/UNX/Makefile_gnu

Before:

    65 # pgi pgf77 3.0
    66 ifdef PGI_F77
    67 FC = pgf77 -O2 -Munroll -tp p6 -Mnoframe -Msecond_underscore
    68 LD = pgf77 -O2 -Munroll -tp p6 -Mnoframe -Msecond_underscore
    69 endif

After:

    65 # pgi pgf77 3.0
    66 ifdef PGI_F77
    67 #..FC = pgf77 -O2 -Munroll -tp p6 -Mnoframe -Msecond_underscore
    68 #..LD = pgf77 -O2 -Munroll -tp p6 -Mnoframe -Msecond_underscore
    69
    70 CC = pgcc -Dnographics -Dgnu -Mnoframe -Munderscoring -O2 
    72 FC = pgf77 -Mnoframe -Msecond_underscore $(I8DUM1) -O2
    73 LD = pgf77 -Mnoframe -Msecond_underscore $(I8DUM1) -O2
    74
    75 FC0 = pgf77 -c -Mnoframe -Msecond_underscore  $(I8DUM1) -O2
    76 FC1 = pgf77 -c -Mnoframe -Msecond_underscore  $(I8DUM1) -O2
    77 FC2 = pgf77 -c -Mnoframe -Msecond_underscore  $(I8DUM1) -O2
    78
    79 endif

Before:

   119 ifdef PGI_F77
   120 FC0 = pgf77 -c
   121 else

After:

   129 ifdef PGI_F77
   130 FC0 = pgf77 -c -Mnoframe -Msecond_underscore $(I8DUM1) -O2
   131 #..FC0 = pgf77 -c
   132 else

Building CHARMM

Before building the CHARMM executable make sure that your shells "path" variable includes the location of the PGI compilers. Then execute the following command:

  ./install.com gnu xxlarge FULL PGF77 I8

Running CHARMM

There are a set of tests provided with the CHARMM distribution in the ./test directory. To run these tests, do the following:

cd ./test
./test.com gnu

Verifying Correctness

Provided with the source distribution is a script used to check for correctness when running the tests from the distribution. This script ./test/compare.awk compares output files with previously generated output.

Known Issues and Limitations

None.

Click me