From 8d7f2d4513399686e427d497651d05158c0ddcc7 Mon Sep 17 00:00:00 2001 From: Bassem Girgis Date: Sat, 10 Aug 2019 18:26:42 -0500 Subject: [PATCH] mpi WIP --- mpi/mpich/build.sh | 113 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100755 mpi/mpich/build.sh diff --git a/mpi/mpich/build.sh b/mpi/mpich/build.sh new file mode 100755 index 0000000..88e280b --- /dev/null +++ b/mpi/mpich/build.sh @@ -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 +