#!/bin/bash source ./make.mvapich.def arch # Mandatory variables. All are checked except CXX and F90. MTHOME=/usr/local/ibgd/driver/infinihost PREFIX=/ixdata/IX_Software/mvapich export CC=gcc export CXX=g++ export F77=g77 export F90= if [ $ARCH = "SOLARIS" ]; then die_setup "MVAPICH VAPI is not supported on Solaris." elif [ $ARCH = "MAC_OSX" ]; then MTHOME=/usr/SmallTree export PATH=$PATH:/opt/ibmcmp/xlf/8.1/bin export FC=xlf export F90=xlf90 export MAC_OSX=yes SUPPRESS="-multiply_defined suppress" fi # Check mandatory variable settings. if [ -z "$MTHOME" ] || [ -z "$PREFIX" ] || [ -z "$CC" ] || [ -z "$F77" ]; then die_setup "Please set mandatory variables in this script." elif [ ! -d $MTHOME ]; then die_setup "MTHOME directory $MTHOME does not exist." elif [ $ARCH = "_EM64T_" ] || [ $ARCH = "_X86_64_" ]; then if [ -d $MTHOME/lib64 ]; then MTHOME_LIB=$MTHOME/lib64 elif [ -d $MTHOME/lib ]; then MTHOME_LIB=$MTHOME/lib else die_setup "Could not find the MTHOME/lib64 or MTHOME/lib directory." fi elif [ -d $MTHOME/lib ]; then MTHOME_LIB=$MTHOME/lib else die_setup "Could not find the MTHOME/lib directory." fi # Optional variables. Most of these are prompted for if not set. # # Whether to enable ROMIO support. This is necessary if building the # F90 modules. if [ -n "$F90" ]; then ROMIO="--with-romio" else ROMIO=${ROMIO:---without-romio} fi # I/O Bus type. # Supported: "_PCI_X_" and "_PCI_EX_" IO_BUS= if [ -z "$IO_BUS" ]; then prompt_io_bus fi # Link speed rate. # Supported: "_DDR_" and "_SDR_" (PCI-Express) # "_SDR_" (PCI-X) LINKS= if [ -z "$LINKS" ]; then prompt_link fi # Whether to use an optimized queue pair exchange scheme. This is not # checked for a setting in in the script. It must be set here explicitly. # Supported: "-DUSE_MPD_RING", "-DUSE_MPD_BASIC" and "" (to disable) HAVE_MPD_RING="" # Set this to override automatic optimization setting (-03). OPT_FLAG= if [ -z $OPT_FLAG ]; then OPT_FLAG=-O3 fi export LIBS="-L${MTHOME_LIB} -lmtl_common -lvapi -lpthread -lmosal -lmpga $SUPPRESS" export FFLAGS="-L${MTHOME_LIB}" export CFLAGS="-D${ARCH} -DEARLY_SEND_COMPLETION -DSRQ -DADAPTIVE_RDMA_FAST_PATH \ -DVIADEV_RPUT_SUPPORT -DLAZY_MEM_UNREGISTER -D_SMP_ -D_SMP_RNDV_ \ -fPIC $SUPPRESS -D${IO_BUS} -D${LINKS} \ ${HAVE_MPD_RING} -I${MTHOME}/include $OPT_FLAG" # Prelogue make distclean &>/dev/null set -o pipefail # Configure MVAPICH echo "Configuring MVAPICH..." ./configure --with-device=vapi --with-arch=LINUX -prefix=${PREFIX} \ $ROMIO --without-mpe \ -lib="-L${MTHOME_LIB} -lmtl_common -lvapi -lmosal -lmpga -lpthread" \ 2>&1 |tee config-mine.log ret=$? test $ret = 0 || die "configuration." # Build MVAPICH echo "Building MVAPICH..." make 2>&1 |tee make-mine.log ret=$? test $ret = 0 || die "building MVAPICH." # Install MVAPICH echo "MVAPICH installation..." rm -f install-mine.log make install 2>&1 |tee install-mine.log ret=$? test $ret = 0 || die "installing MVAPICH."