[mvapich-discuss] Compile error

Peter Cebull peter.cebull at inl.gov
Fri May 16 17:35:10 EDT 2008


An HTML attachment was scrubbed...
URL: http://mail.cse.ohio-state.edu/pipermail/mvapich-discuss/attachments/20080516/dec11dd5/attachment.html
-------------- next part --------------
#!/bin/bash

# Most variables here can be overridden by exporting them in the environment
# before running this script.  Default values have been provided if the
# environment variable is not already set.

source ./make.mvapich2.def

# The target architecture.  If not exported outside of this script,
# it will be found automatically or prompted for if necessary.
# Supported: "_IA32_", "_IA64_", "_EM64T_", "_X86_64_"
if [ -z "$ARCH" ]; then
    arch
fi

if [ $ARCH = "SOLARIS" ] || [ $ARCH = "MAC_OSX" ]; then
    die_setup "MVAPICH2 OFA is not supported on this architecture: $ARCH."
fi

# Mandatory variables.  All are checked except CXX and F90.
OPEN_IB_HOME=${OPEN_IB_HOME:-/usr}
#PREFIX=${PREFIX:-/usr/local/mvapich2/mvapich2-1.0.2/intel-dbg}
#export CC=${CC:-icc}
#export CXX=${CXX:-icpc}
#export F77=${F77:-ifort}
#export F90=${F90:-ifort}
#PREFIX=${PREFIX:-/usr/local/mvapich2/mvapich2-1.0.2/gcc-dbg}
#export CC=${CC:-gcc}
#export CXX=${CXX:-g++}
#export F77=${F77:-gfortran}
#export F90=${F90:-gfortran}
#PREFIX=${PREFIX:-/usr/local/mvapich2/mvapich2-1.0.2/gcc-opt}
#export CC=${CC:-gcc}
#export CXX=${CXX:-g++}
#export F77=${F77:-gfortran}
#export F90=${F90:-gfortran}
PREFIX=${PREFIX:-/usr/local/mvapich2/mvapich2-1.0.2/intel-opt}
export CC=${CC:-icc}
export CXX=${CXX:-icpc}
export F77=${F77:-ifort}
export F90=${F90:-ifort}

# Check mandatory variable settings.
if [ -z "$OPEN_IB_HOME" ] || [ -z "$PREFIX" ] || [ -z "$CC" ] || [ -z "$F77" ]; then
    die_setup "Please set mandatory variables in this script or the environment."
elif [ ! -d $OPEN_IB_HOME ]; then
    die_setup "OPEN_IB_HOME directory $OPEN_IB_HOME does not exist."
elif [ -d $OPEN_IB_HOME/lib64 ]; then
    OPEN_IB_LIB=$OPEN_IB_HOME/lib64
elif [ -d $OPEN_IB_HOME/lib ]; then
    OPEN_IB_LIB=$OPEN_IB_HOME/lib
else
    die_setup "Could not find the OPEN_IB_HOME/lib64 or OPEN_IB_HOME/lib directory."
fi

# Set this to override automatic optimization setting (-O2).
OPT_FLAG=${OPT_FLAG:--fPIC -O2}
export MPI_F90FLAGS=$OPT_FLAG

# Checkpoint-Restart Support.  This is disabled by default.  Enable with
# "yes".  If this is enabled, the following rules apply:
#
# - PTMALLOC must be enabled
# - multithreading cannot be enabled
# - rdma-cm support cannot be enabled
ENABLE_CKPT=${ENABLE_CKPT:-}

if [ "$ENABLE_CKPT" = "yes" ]; then
    if [ ! -z "$BLCR_HOME" ]; then
        BLCR_LIB="-L$BLCR_HOME/lib -lcr"
        BLCR_INC="-I$BLCR_HOME/include"
        CR_FLAG="-DCKPT -DSYNC_CKPT"
	SMP_FLAG=""
        export MPIEXEC_CR=mpiexec_cr # to compile mpiexec_cr
        LD_LIBRARY_PATH=$BLCR_HOME/lib:$LD_LIBRARY_PATH
    else
        die_setup "Please install BLCR and have set BLCR_HOME pointing to the directory."
    fi
else
    SMP_FLAG="-D_SMP_"
fi

# PTMALLOC support for MVAPICH2 memory hooks.  Enabling this will allow
# MVAPICH2 to release memory to the Operating System (when registration
# cache is enabled).  Enabled by default.  Disable with "no".
PTMALLOC=${PTMALLOC:-}

if [ "$PTMALLOC" = "no" ]; then
    if [ "$ENABLE_CKPT" = "yes" ]; then
        die_setup "Checkpoint-Restart requires PTMALLOC support."
    fi

    PTMALLOC="-DDISABLE_PTMALLOC"
else
    PTMALLOC=""
fi

# Whether or not to build rdma-cm support. Disabled by default.
# Enable with "yes".
RDMA_CM_SUPPORT=${RDMA_CM_SUPPORT:-"yes"}

if [ "$RDMA_CM_SUPPORT" = "yes" ]; then
    if [ "$ENABLE_CKPT" = "yes" ]; then
        die_setup "Checkpoint-Restart does not support rdma-cm."
    fi

    RDMA_CM_LIBS="-lrdmacm"
    RDMA_CM_FLAG="-DRDMA_CM"
#    RDMA_CM_FLAG="-DRDMA_CM -DOFED_VERSION_1_1"
fi

# Whether or not to build with ROMIO MPI I/O support.  Disabled by default.
# Enable with "yes".
ROMIO=${ROMIO:-}

if [ "$ROMIO" = "yes" ]; then
    ROMIO="--enable-romio"
else
    ROMIO="--disable-romio"
fi

# Whether or not to build with shared library support.  Disabled by default.
# Enabled with "yes".
SHARED_LIBS=${SHARED_LIBS:-}

if [ "$SHARED_LIBS" = "yes" ]; then
    SHARED_LIBS="--enable-sharedlibs=gcc"
else
    SHARED_LIBS=""
fi

export LD_LIBRARY_PATH=$OPEN_IB_LIB:$LD_LIBRARY_PATH
export LIBS=${LIBS:--L${OPEN_IB_LIB} ${BLCR_LIB} ${RDMA_CM_LIBS} -libverbs -libumad -lpthread}
export FFLAGS=${FFLAGS:--L${OPEN_IB_LIB} -fPIC}
export CFLAGS=${CFLAGS:--fPIC -D${ARCH} ${SMP_FLAG} -DUSE_HEADER_CACHING ${PTMALLOC} -DONE_SIDED -DMPIDI_CH3_CHANNEL_RNDV -DMPID_USE_SEQUENCE_NUMBERS  ${RDMA_CM_FLAG} ${CR_FLAG} ${BLCR_INC} -I${OPEN_IB_HOME}/include $OPT_FLAG}

# Prelogue
make distclean &>/dev/null
rm -rf *.cache *.log *.status lib bin
set -o pipefail

echo "Configuring MVAPICH2..."
#./configure  --prefix=${PREFIX} \
#    --with-device=osu_ch3:mrail --with-rdma=gen2 --with-pm=mpd \
#    --enable-g=dbg --enable-shared=gcc --enable-sharedlibs=gcc --enable-debuginfo --enable-totalview \
#    ${ROMIO} ${SHARED_LIBS} --without-mpe 2>&1 |tee config-mine.log
./configure  --prefix=${PREFIX} \
    --with-device=osu_ch3:mrail --with-rdma=gen2 --with-pm=mpd \
    --enable-shared=gcc --enable-sharedlibs=gcc \
    ${ROMIO} ${SHARED_LIBS} --without-mpe 2>&1 |tee config-mine.log
ret=$?
tail config-mine.log
test $ret = 0 ||  die "configuration."

# Build MVAPICH2
echo "Building MVAPICH2..."
make 2>&1 |tee make-mine.log 
ret=$?
tail make-mine.log
test $ret = 0 ||  die "building MVAPICH2."

# Install MVAPICH2
echo "MVAPICH2 installation..."
rm -f install-mine.log 
make install 2>&1 |tee install-mine.log
ret=$?
tail install-mine.log
test $ret = 0 ||  die "installing MVAPICH2."

# Epilogue
echo "Congratulations on successfully building MVAPICH2. Please send your feedback to mvapich-discuss at cse.ohio-state.edu." 


More information about the mvapich-discuss mailing list