This commit is contained in:
Bassem Girgis
2019-08-10 18:26:42 -05:00
parent 724b4a3eb1
commit 8d7f2d4513

113
mpi/mpich/build.sh Executable file
View File

@@ -0,0 +1,113 @@
#!/bin/bash
libVer=3.3.1
echo libVer=$libVer
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
originalPath=$scriptDir/original
buildPath=$scriptDir/build
installPath=$scriptDir/install
libFilePath=$originalPath/googletest-release-$libVer.tar.gz
libBuildPath=$buildPath/$libVer
libInstallPath=$installPath/$libVer
libSrcPath=$buildPath/googletest-release-$libVer
echo
echo libFilePath=$libFilePath
echo libBuildPath=$libBuildPath
echo libInstallPath=$libInstallPath
echo libSrcPath=$libSrcPath
echo
rm -rf $buildPath $installPath
mkdir -p $libBuildPath
mkdir -p $libInstallPath
mkdir -p $libSrcPath
tar zxvpf $libFilePath -C $buildPath
if [ -z "$1" ]; then
BuildType="release"
else
BuildType="$1"
fi
echo
echo "BuildType = $BuildType"
echo
# check on 1st argument: build type
if [ "$BuildType" = "debug" ]; then
echo "debug build selected ..."
BCFLAGS=-g
BCXXFLAGS=-g
BFFLAGS=-g
elif [ "$BuildType" = "release" ]; then
echo "release build selected ..."
BCFLAGS=-O3
BCXXFLAGS=-O3
BFFLAGS=-O3
else
echo "Error: unrecognized build type. Check 1st input argument!"
exit
fi
echo
echo "BCFLAGS = $BCFLAGS"
echo "BCXXFLAGS = $BCXXFLAGS"
echo "BFFLAGS = $BFFLAGS"
echo
# MPICH directory
MPICHRoot=/home/brgirgis/Documents/code/thirdparty/mpi/mpich_/src/mpich-3.2.1
if [ -d $MPICHRoot ]; then
echo "MPICHRoot = $MPICHRoot"
else
echo "Error: MPICH directory is missing!"
exit
fi
# target install directory
InstallRoot=$PWD/../${BuildType}_install
echo "InstallRoot = $InstallRoot"
# clean the build area
rm -rf $InstallRoot \
./config \
./config.log \
./config.status \
./contrib \
./libtool \
./Makefile \
./ompi \
./opal \
./orte \
./test
# create the install directory
mkdir $InstallRoot
# print current LD_LIBRARY_PATH for reference
echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
# run the configure command with all build options
$MPICHRoot/configure --prefix=$InstallRoot \
--disable-fc \
--disable-f77 \
--disable-fortran \
--disable-cxx \
--enable-fast=all \
MPICHLIB_CFLAGS=$BCFLAGS \
CC=gcc \
CXX=g++ \
2>&1 | tee c.txt
# clean, build, and install
make clean
make all -j8 2>&1 | tee m.txt
make install 2>&1 | tee mi.txt