#!/bin/sh # # PMEMD Configuration utility. # Author: Bob Duke # #------------------------------------------------------------------------------ # set up usage statement: #------------------------------------------------------------------------------ usage(){ cat << EOD Usage: ./configure [parallel option] where is one of aix_spx (IBM AIX, IBM SPx processors) aix_sp4_massvp4 (IBM AIX, IBM SP4 processors, massvp4 library available) cray_t3e (UNICOS/mk UNIX, Cray T3E processors) linux_athlon (Athlon or later AMD processors) linux_opteron (Opteron or later AMD processors) linux_p3 (Pentium III or later Intel processors) linux_p4 (Pentium IV or later Intel processors) osf_alpha (OSF1 Tru64 UNIX, HP or Compaq AlphaServer processors) sgi altix (SGI Linux, Intel Itanium 2 processors) sgi_mips (SGI IRIX UNIX, MIPS R8k,10k,12k,14k or 16k processors) where is one of compaqf90 (Compaq Fortran 90, osf1_alpha only) f90 (Native Fortran 90, sgi_mips, cray_t3e only) ifc7 (Intel Fortran Compiler, v7, linux_*, sgi_altix) ifort (Intel Fortran Compiler, v8, linux_*, sgi_altix) (WARNING - IA32 compiler broken at time of release; Look on amber.scripps.edu website for updates) lahey_f95 (Lahey Fortran 95, linux_p3, linux_athlon only) xlf90 (IBM XLF90, aix_spx only) pgf90 (Portland Group Fortran Compiler) where [parallel option] is one of nopar (uniprocessor, no mpi, all platforms except cray_t3e) mpi (native mpi, aix_spx, osf_alpha, sgi_altix, sgi_mips, cray_t3e only) mpich (MPICH mpi, linux_*, ifc7 only) lam (LAM mpi, linux_*, ifc7 only) mpich_gm (Myrinet MPICH GM mpi, linux_*, ifc7 only) quadrics (Quadrics mpi, osf1_alpha only) The architecture and compiler MUST be specified. If a parallel option is not specified, the default is nopar. PMEMD 8 ships with support for the above options. Users may define other architecture/compiler/parallel options by creating a file config_data/.. =========================================================== EOD exit 1 } #set -x umask 022 command="$0 $*" basedir=`basename $PWD` if [ $# -eq 1 ]; then if [ $1 = -help -o $1 = -HELP ]; then usage fi if [ $1 = -h -o $1 = -H ]; then usage fi fi if [ $basedir != pmemd ]; then echo echo The PMEMD configuration script must be executed from within echo the pmemd directory! echo PMEMD Configuration Failed! exit 1 fi if [ ! -d config_data ]; then echo echo The PMEMD configuration script requires data in the config_data echo directory, which does not exist! echo PMEMD Configuration Failed! exit 1 fi if [ $# -ne 2 -a $# -ne 3 ]; then echo echo The command \"$command\" echo has an incorrect number of parameters! echo PMEMD Configuration Failed! usage fi arch=$1 compiler=$2 if [ $# -eq 3 ]; then parallel=$3 else parallel=nopar fi if [ ! -f config_data/$arch.$compiler.$parallel ]; then echo echo No configuration information found for the combination: echo Architecture Option = $arch echo Compiler Option = $compiler echo Parallel Option = $parallel echo If you need this combination, you must create an appropriate file echo \"$arch.$compiler.$parallel\" in the config_data directory. echo PMEMD Configuration Failed! usage fi rm -f config.h if [ -f config.h ]; then echo Error deleting old config.h file! echo PMEMD Configuration Failed! exit 1 fi cat << EOD > config.h #!/bin/csh -f EOD if [ $parallel = mpich ]; then if [ -z $MPICH_HOME ]; then echo Please enter name of directory where MPICH files are installed: read MPICH_HOME else echo PMEMD is assuming MPICH files are installed in $MPICH_HOME. fi cat << EOD >> config.h setenv MPICH_HOME $MPICH_HOME EOD elif [ $parallel = lam ]; then if [ -z $LAM_HOME ]; then echo Please enter name of directory where LAM files are installed: read LAM_HOME else echo PMEMD is assuming LAM files are installed in $LAM_HOME. fi cat << EOD >> config.h setenv LAM_HOME $LAM_HOME EOD elif [ $parallel = mpich_gm ]; then if [ -z $MPICH_HOME ]; then echo Please enter name of directory where Myrinet MPICH files are installed: read MPICH_HOME else echo PMEMD is assuming Myrinet MPICH files are installed in $MPICH_HOME. fi if [ -z $MPICH_LIBDIR2 ]; then echo Please enter name of directory where Myrinet libgm.a is installed: read MPICH_LIBDIR2 else echo PMEMD is assuming Myrinet libgm.a file is installed in $MPICH_LIBDIR2. fi cat << EOD >> config.h setenv MPICH_HOME $MPICH_HOME setenv MPICH_LIBDIR2 $MPICH_LIBDIR2 EOD else : fi if [ ! -f config.h ]; then echo Error creating config.h file! echo PMEMD Configuration Failed! exit 1 fi echo PMEMD Configurate successfully completed. cat config_data/$arch.$compiler.$parallel >> config.h