The HECToR Service is now closed and has been superceded by ARCHER.

Compiling Amber 11 on HECToR phase 3 (XE6)

Programming Environment

Switch to the GNU programming environment:

module swap PrgEnv-cray PrgEnv-gnu

Load the required modules:

module add fftw/2.1.5.2
module add netcdf

Modules loaded for centrally-installed version:


Currently Loaded Modulefiles: 
1) modules/3.2.6.6 2) nodestat/2.2-1.0400.29866.4.3.gem 3) sdb/1.0-1.0400.30000.6.18.gem 4) MySQL/5.0.64-1.0000.4667.20.1 5) lustre-cray_gem_s/1.8.4_2.6.32.45_0.3.2_1.0400.6221.1.1-1.0400.30252.1.29 6) udreg/2.3.1-1.0400.3911.5.6.gem 7) ugni/2.3-1.0400.3912.4.29.gem 8) gni-headers/2.1-1.0400.3906.5.1.gem 9) dmapp/3.2.1-1.0400.3965.10.12.gem 10) xpmem/0.1-2.0400.29883.4.6.gem 11) hss-llm/6.0.0 12) Base-opts/1.0.2-1.0400.29823.8.1.gem 13) xtpe-network-gemini 14) PrgEnv-gnu/4.0.30 15) xt-mpich2/5.3.4 16) atp/1.3.0 17) xt-asyncpe/5.03 18) pmi/2.1.4-1.0000.8596.8.9.gem 19) xt-libsci/11.0.03 20) gcc/4.6.1 21) pbs/10.4.0.101257 22) packages-phase2b 23) budgets/1.0 24) xtpe-interlagos 25) hdf5/1.8.6 26) netcdf/4.1.2 27) fftw/2.1.5.2

Unpack the source

Both Amber 11 and AmberTools 1.4 should be unpacked into the same source tree:

tar -xjvf Amber11.tar.bz2
tar -xjvf AmberTools-1.4.tar.bz2

will produce the amber11 folder.

Set $AMBERHOME

cd amber11
export AMBERHOME=`pwd`

Apply bugfixes

Download the latest bugfixes from the ambermd.org website and apply them:

cd $AMBERHOME
patch -p0 -N < [bugfix file]

Set Build AmberTools

cd AmberTools/src

Modify the configure script to skip configuration of NetCDF and FFTW:

--snip--
          echo
          echo "Configuring Parallel NetCDF; (may be time-consuming)"
          echo
#          cd pnetcdf
#          netcdfflag="--prefix=$AMBERTOOLSHOME/src/pnetcdf --disable-cxx --disable-fortran" 
#          if [ "$crayxt5" = 'yes' ]; then
#              pnetcc="cc"
#          else
#              pnetcc="mpicc"
#          fi
#          case "$compiler" in
#          pgi*)
#              env CC="$pnetcc" LDFLAGS="$ldflags" \
#                  CFLAGS="$cflags" CPPFLAGS="-DNDEBUG -DpgiFortran" ./configure \
#                  $netcdfflag > ../pnetcdf_config.log 2>&1
#              ;;
#          *)
#              env CC="$pnetcc" LDFLAGS="$ldflags" \
#                  CFLAGS="$cflags" CPPFLAGS="-DNDEBUG" ./configure $netcdfflag \
#                  > ../pnetcdf_config.log 2>&1
#              ;;
#          esac
#          ncerror=$?
#          if [ $ncerror -gt 0 ]; then
#              echo "    Error: parallel NetCDF configure returned $ncerror"
#              echo "    Parallel NetCDF configure failed!  Check the pnetcdf/config.log file."
#              echo "    Continuing but parallel NetCDF will be skipped."
#              pnetcdf='no'
#              pnetcdflib=''
#          else
              echo "    Parallel NetCDF configure succeeded."
              pnetcdf='yes'
              pnetcdflib='../pnetcdf/lib/libpnetcdf.a'
#          fi
          cd ../
--snip--

--snip--
      echo
      echo "Configuring NetCDF; (may be time-consuming)"
      echo
#      cd netcdf/src 
#      netcdfflag="--prefix=$AMBERTOOLSHOME/src/netcdf --disable-cxx"
#      case "$compiler" in
#      pgi*)
#          env FC="$fc" F90="$fc" FFLAGS="$ldflags $foptflags" \
#              FCFLAGS="$ldflags $foptflags" \
#              F90FLAGS="$ldflags $foptflags" CC="$cc" LDFLAGS="$ldflags" \
#              CFLAGS="$cflags" CXX="$cplusplus" CPPFLAGS="-DNDEBUG -DpgiFortran" \
#              ./configure $netcdfflag > ../../netcdf_config.log 2>&1
#          ;;
#      *)
#          env FC="$fc" F90="$fc" FFLAGS="$ldflags $foptflags" \
#              FCFLAGS="$ldflags $foptflags" \
#              F90FLAGS="$ldflags $foptflags" CC="$cc" LDFLAGS="$ldflags" \
#              CFLAGS="$cflags" CPPFLAGS="-DNDEBUG" ./configure $netcdfflag \
#              > ../../netcdf_config.log 2>&1
#          ;;
#      esac
#      ncerror=$?
#      if [ $ncerror -gt 0 ]; then
#          echo "    Error: NetCDF configure returned $ncerror"
#          echo "    NetCDF configure failed!  Check the netcdf_config.log file."
#          echo "    Continuing but NetCDF will be skipped."
#          netcdf=''
#          netcdflib=''
#          pmemd_netcdflib=''
#      else
          echo "    NetCDF configure succeeded."
--snip--

--snip--
          echo
          echo "Configuring fftw-2.1.5; (may be time-consuming)"
          echo
#          cd fftw-2.1.5
#          if [ "$mpi" = 'yes' ]; then
#              ./configure $rismflag --enable-mpi CC="$cc" CFLAGS="$cflags" F77="$fc" FFLAGS="$fflags" \
#                  FLIBS="$flibs_arch" > ../fftw2_config.log 2>&1
#          else
#              ./configure $rismflag CC="$cc" CFLAGS="$cflags" F77="$fc" FFLAGS="$fflags" \
#                  FLIBS="$flibs_arch" > ../fftw2_config.log 2>&1
#          fi
#          ncerror=$?
#          if [ $ncerror -gt 0 ]; then
#              echo "    Error: fftw configure returned $ncerror"
#              echo "    fftw configure failed!  Check the fftw2_config.log file."
#              exit 1
#          else
              echo "    fftw-2.1.5 configure succeeded."
#          fi
#          cd ..
          flibs_fftw2="\$(LIBDIR)/libdrfftw.a \$(LIBDIR)/libdfftw.a"
--snip--

Configure the build:

./configure -static -noX11 -crayxt5 gnu

Modify the config.h file to use the central NetCDF libraries (change all paths) to, e.g.:

/opt/cray/netcdf/4.1.2/gnu/46/lib

Modify the ptraj/netcdf_ptraj.h and ptraj/netcdf_ptraj.h file to point to the correct NetCDF header file:

#    include "/opt/cray/netcdf/4.1.2/gnu/46/include/netcdf.h"

Build the tools

make install

Build serial version of Amber

Change to the simulation packages source directory:

cd $AMBERHOME/src

Link the config.h file created above:

ln -s $AMBERHOME/AmberTools/src/config.h config.h

Modify the sander/Makefile to skip compilation of NetCDF:

netcdf.mod:
        echo /opt/cray/netcdf/4.1.2/gnu/46/include/*.mod .
        cp /opt/cray/netcdf/4.1.2/gnu/46/bin/ncdump$(SFX) $(BINDIR)

Modify pmemd/Makefile and pmemd/src/Makefile to skip compilation of NetCDF:

netcdf.mod:
        echo /opt/cray/netcdf/4.1.2/gnu/46/include/*.mod .

Issue the build command:

make serial

Binaries are in $AMBERHOME/bin

Build the parallel version

cd $AMBERHOME/AmberTools/src

Export the MPI location

export MPI_HOME=$MPICH_DIR

Configure the build

./configure -mpi -static -noX11 -crayxt5 gnu

Modify the config.h file to use the central NetCDF libraries (change all paths) to, e.g.:

/opt/cray/netcdf/4.1.2/gnu/46/lib

Build the parallel version

make clean
make parallel

Go back to the main Amber page