Loading ifs/main.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ int main(int argc, const char* argv[]) { if (!hosts.empty()) { auto i = static_cast<uint64_t>(0); auto found_hostname = false; auto hostname = get_my_hostname(false); auto hostname = get_my_hostname(true); if (hostname.empty()) { cerr << "Unable to read the machine's hostname" << endl; ADAFS_DATA->spdlogger()->error("{}() Unable to read the machine's hostname", __func__); Loading ifs/scripts/compile_dep.sh +184 −118 Original line number Diff line number Diff line #!/bin/bash usage() { usage_short() { echo " usage: compile_dep.sh [-h] [-n <NAPLUGIN>] [-c <CLUSTER>] [-j <COMPILE_CORES>] source_path install_path " } help_msg() { usage_short echo " This script compiles all ADA-FS dependencies (excluding the fs itself) positional arguments: source_path path to the cloned dependencies path from clone_dep.sh install_path path to the install path of the compiled dependencies echo "Usage: ./compile_dep [ clone_path ] [ install_path ] [ na_plugin ] [ cluster ] Valid na_plugin arguments: {bmi,cci,ofi,all} Valid cluster arguments: {mogon1}" optional arguments: -h, --help shows this help message and exits -n <NAPLUGIN>, --na <NAPLUGIN> network layer that is used for communication. Valid: {bmi,cci,ofi,all} defaults to 'all' -c <CLUSTER>, --cluster <CLUSTER> additional configurations for specific compute clusters supported clusters: {mogon1,fh2} -j <COMPILE_CORES>, --compilecores <COMPILE_CORES> number of cores that are used to compile the depdencies defaults to number of available cores " } prepare_build_dir() { Loading @@ -14,106 +38,148 @@ prepare_build_dir() { fi rm -rf $1/build/* } CLUSTER="" NA_LAYER="" CORES="" SOURCE="" INSTALL="" POSITIONAL=() while [[ $# -gt 0 ]] do key="$1" if [[ ( -z ${1+x} ) || ( -z ${2+x} ) || ( -z ${3+x} ) ]]; then echo "Arguments missing." usage case ${key} in -n|--na) NA_LAYER="$2" shift # past argument shift # past value ;; -c|--cluster) CLUSTER="$2" shift # past argument shift # past value ;; -j|--compilecores) CORES="$2" shift # past argument shift # past value ;; -h|--help) help_msg exit fi # if cluster is given, put it into a variable CLUSTER="" if [[ ! (-z ${4+x} ) ]]; then CLUSTER=$4 fi #shift # past argument ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument ;; esac done set -- "${POSITIONAL[@]}" # restore positional parameters #LOG=/tmp/adafs_install.log #echo "" &> $LOG GIT=$1 # deal with positional arguments if [[ ( -z ${1+x} ) || ( -z ${2+x} ) ]]; then echo "Positional arguments missing." usage_short exit fi SOURCE=$1 INSTALL=$2 NA_LAYER=$3 USE_BMI="-DNA_USE_BMI:BOOL=OFF" USE_CCI="-DNA_USE_CCI:BOOL=OFF" USE_OFI="-DNA_USE_OFI:BOOL=OFF" # deal with optional arguments if [ "${NA_LAYER}" == "" ]; then echo "Defaulting NAPLUGIN to 'all'" NA_LAYER="all" fi if [ "${CORES}" == "" ]; then CORES=$(grep -c ^processor /proc/cpuinfo) if [ "$NA_LAYER" == "cci" ] || [ "$NA_LAYER" == "bmi" ] || [ "$NA_LAYER" == "ofi" ] || [ "$NA_LAYER" == "all" ]; then echo "$NA_LAYER plugin(s) selected" echo "CORES = ${CORES} (default)" else if [ ! "${CORES}" -gt "0" ]; then echo "CORES set to ${CORES} which is invalid. Input must be numeric and greater than 0." usage_short exit else echo CORES = "${CORES}" fi fi if [ "${NA_LAYER}" == "cci" ] || [ "${NA_LAYER}" == "bmi" ] || [ "${NA_LAYER}" == "ofi" ] || [ "${NA_LAYER}" == "all" ]; then echo NAPLUGIN = "${NA_LAYER}" else echo "No valid plugin selected" usage usage_short exit fi if [ "$CLUSTER" != "" ]; then if [ "$CLUSTER" == "mogon1" ]; then echo "$CLUSTER cluster configuration selected" if [[ "${CLUSTER}" != "" ]]; then if [[ ( "${CLUSTER}" == "mogon1" ) || ( "${CLUSTER}" == "fh2" ) ]]; then echo CLUSTER = "${CLUSTER}" else echo "$CLUSTER cluster configuration is invalid. Exiting ..." usage echo "${CLUSTER} cluster configuration is invalid. Exiting ..." usage_short exit fi else echo "No cluster configuration set." fi #LOG=/tmp/adafs_install.log #echo "" &> $LOG USE_BMI="-DNA_USE_BMI:BOOL=OFF" USE_CCI="-DNA_USE_CCI:BOOL=OFF" USE_OFI="-DNA_USE_OFI:BOOL=OFF" echo "Source path = '$1'"; echo "Install path = '$2'"; echo "Git path is set to '$1'"; echo "Install path is set to '$2'"; mkdir -p $GIT mkdir -p ${SOURCE} # Set cluster dependencies first if [ "$CLUSTER" == "mogon1" ]; then # Make sure these modules are enabled #module load devel/CMake/3.8.0 || exit 1 #module load mpi/OpenMPI/2.0.2-GCC-6.3.0 || exit 1 #module load devel/Boost/1.63.0-foss-2017a || exit 1 # because of mercury echo "Done" if [[ ( "${CLUSTER}" == "mogon1" ) || ( "${CLUSTER}" == "fh2" ) ]]; then # get libtool echo "############################################################ Installing: libtool" CURR=$GIT/libtool prepare_build_dir $CURR cd $CURR/build ../configure --prefix=$INSTALL || exit 1 make -j$CORES || exit 1 CURR=${SOURCE}/libtool prepare_build_dir ${CURR} cd ${CURR}/build ../configure --prefix=${INSTALL} || exit 1 make -j${CORES} || exit 1 make install || exit 1 # compile libev echo "############################################################ Installing: libev" CURR=$GIT/libev prepare_build_dir $CURR cd $CURR/build ../configure --prefix=$INSTALL || exit 1 make -j$CORES || exit 1 CURR=${SOURCE}/libev prepare_build_dir ${CURR} cd ${CURR}/build ../configure --prefix=${INSTALL} || exit 1 make -j${CORES} || exit 1 make install || exit 1 # compile gflags echo "############################################################ Installing: gflags" CURR=$GIT/gflags prepare_build_dir $CURR cd $CURR/build cmake -DCMAKE_INSTALL_PREFIX=$INSTALL -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j$CORES || exit 1 CURR=${SOURCE}/gflags prepare_build_dir ${CURR} cd ${CURR}/build cmake -DCMAKE_INSTALL_PREFIX=${INSTALL} -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j${CORES} || exit 1 make install || exit 1 # compile zstd echo "############################################################ Installing: zstd" CURR=$GIT/zstd/build/cmake prepare_build_dir $CURR cd $CURR/build cmake -DCMAKE_INSTALL_PREFIX=$INSTALL -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j$CORES || exit 1 CURR=${SOURCE}/zstd/build/cmake prepare_build_dir ${CURR} cd ${CURR}/build cmake -DCMAKE_INSTALL_PREFIX=${INSTALL} -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j${CORES} || exit 1 make install || exit 1 echo "############################################################ Installing: lz4" CURR=$GIT/lz4 cd $CURR make -j$CORES || exit 1 make DESTDIR=$INSTALL PREFIX="" install || exit 1 CURR=${SOURCE}/lz4 cd ${CURR} make -j${CORES} || exit 1 make DESTDIR=${INSTALL} PREFIX="" install || exit 1 echo "############################################################ Installing: snappy" CURR=$GIT/snappy prepare_build_dir $CURR cd $CURR/build cmake -DCMAKE_INSTALL_PREFIX=$INSTALL -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j$CORES || exit 1 CURR=${SOURCE}/snappy prepare_build_dir ${CURR} cd ${CURR}/build cmake -DCMAKE_INSTALL_PREFIX=${INSTALL} -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j${CORES} || exit 1 make install || exit 1 fi Loading @@ -121,13 +187,13 @@ if [ "$NA_LAYER" == "bmi" ] || [ "$NA_LAYER" == "all" ]; then USE_BMI="-DNA_USE_BMI:BOOL=ON" echo "############################################################ Installing: BMI" # BMI CURR=$GIT/bmi prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/bmi prepare_build_dir ${CURR} cd ${CURR} ./prepare || exit 1 cd $CURR/build ../configure --prefix=$INSTALL --enable-shared --enable-bmi-only || exit 1 make -j$CORES || exit 1 cd ${CURR}/build ../configure --prefix=${INSTALL} --enable-shared --enable-bmi-only || exit 1 make -j${CORES} || exit 1 make install || exit 1 fi Loading @@ -135,17 +201,17 @@ if [ "$NA_LAYER" == "cci" ] || [ "$NA_LAYER" == "all" ]; then USE_CCI="-DNA_USE_CCI:BOOL=ON" echo "############################################################ Installing: CCI" # CCI CURR=$GIT/cci prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/cci prepare_build_dir ${CURR} cd ${CURR} ./autogen.pl || exit 1 cd $CURR/build cd ${CURR}/build if [ "$CLUSTER" == "mogon1" ]; then ../configure --with-verbs --prefix=$INSTALL LIBS="-lpthread" || exit 1 ../configure --with-verbs --prefix=${INSTALL} LIBS="-lpthread" || exit 1 else ../configure --prefix=$INSTALL LIBS="-lpthread" || exit 1 ../configure --prefix=${INSTALL} LIBS="-lpthread" || exit 1 fi make -j$CORES || exit 1 make -j${CORES} || exit 1 make install || exit 1 make check || exit 1 fi Loading @@ -154,13 +220,13 @@ if [ "$NA_LAYER" == "ofi" ] || [ "$NA_LAYER" == "all" ]; then USE_OFI="-DNA_USE_OFI:BOOL=ON" echo "############################################################ Installing: LibFabric" #libfabric CURR=$GIT/libfabric prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/libfabric prepare_build_dir ${CURR} cd ${CURR} ./autogen.sh || exit 1 cd $CURR/build ../configure --prefix=$INSTALL || exit 1 make -j$CORES || exit 1 cd ${CURR}/build ../configure --prefix=${INSTALL} || exit 1 make -j${CORES} || exit 1 make install || exit 1 make check || exit 1 fi Loading @@ -168,60 +234,60 @@ fi echo "############################################################ Installing: Mercury" # Mercury CURR=$GIT/mercury prepare_build_dir $CURR cd $CURR/build CURR=${SOURCE}/mercury prepare_build_dir ${CURR} cd ${CURR}/build # XXX Note: USE_EAGER_BULK is temporarily disabled due to bugs in Mercury with smaller amounts of data cmake -DMERCURY_USE_SELF_FORWARD:BOOL=ON -DMERCURY_USE_CHECKSUMS:BOOL=OFF -DBUILD_TESTING:BOOL=ON \ -DMERCURY_USE_BOOST_PP:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_INSTALL_PREFIX=$INSTALL \ -DCMAKE_BUILD_TYPE:STRING=Release -DMERCURY_USE_EAGER_BULK:BOOL=OFF $USE_BMI $USE_CCI $USE_OFI ../ || exit 1 make -j$CORES || exit 1 -DMERCURY_USE_BOOST_PP:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_INSTALL_PREFIX=${INSTALL} \ -DCMAKE_BUILD_TYPE:STRING=Release -DMERCURY_USE_EAGER_BULK:BOOL=OFF ${USE_BMI} ${USE_CCI} ${USE_OFI} ../ || exit 1 make -j${CORES} || exit 1 make install || exit 1 echo "############################################################ Installing: Argobots" # Argobots CURR=$GIT/argobots prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/argobots prepare_build_dir ${CURR} cd ${CURR} ./autogen.sh || exit 1 cd $CURR/build ../configure --prefix=$INSTALL || exit 1 make -j$CORES || exit 1 cd ${CURR}/build ../configure --prefix=${INSTALL} || exit 1 make -j${CORES} || exit 1 make install || exit 1 make check || exit 1 echo "############################################################ Installing: Abt-snoozer" # Abt snoozer CURR=$GIT/abt-snoozer prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/abt-snoozer prepare_build_dir ${CURR} cd ${CURR} ./prepare.sh || exit 1 cd $CURR/build ../configure --prefix=$INSTALL PKG_CONFIG_PATH=$INSTALL/lib/pkgconfig || exit 1 make -j$CORES || exit 1 cd ${CURR}/build ../configure --prefix=${INSTALL} PKG_CONFIG_PATH=${INSTALL}/lib/pkgconfig || exit 1 make -j${CORES} || exit 1 make install || exit 1 make check || exit 1 echo "############################################################ Installing: Margo" # Margo CURR=$GIT/margo prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/margo prepare_build_dir ${CURR} cd ${CURR} ./prepare.sh || exit 1 cd $CURR/build ../configure --prefix=$INSTALL PKG_CONFIG_PATH=$INSTALL/lib/pkgconfig CFLAGS="-g -Wall" || exit 1 make -j$CORES || exit 1 cd ${CURR}/build ../configure --prefix=${INSTALL} PKG_CONFIG_PATH=${INSTALL}/lib/pkgconfig CFLAGS="-g -Wall" || exit 1 make -j${CORES} || exit 1 make install || exit 1 make check || exit 1 echo "############################################################ Installing: Rocksdb" # Rocksdb CURR=$GIT/rocksdb cd $CURR CURR=${SOURCE}/rocksdb cd ${CURR} make clean || exit 1 sed -i.bak "s#INSTALL_PATH ?= /usr/local#INSTALL_PATH ?= $INSTALL#g" Makefile make -j$CORES static_lib || exit 1 sed -i.bak "s#INSTALL_PATH ?= /usr/local#INSTALL_PATH ?= ${INSTALL}#g" Makefile make -j${CORES} static_lib || exit 1 make install || exit 1 echo "Done" ifs/scripts/clone_dep.sh→ifs/scripts/dl_dep.sh +187 −0 Original line number Diff line number Diff line Loading @@ -2,21 +2,21 @@ clonedeps() { FOLDER=$1 GITCLONE=$2 CLONE=$2 COMMIT=$3 echo "#########################################################" echo "Cloning into $GIT/$FOLDER ..." echo "Cloning into ${SOURCE}/${FOLDER} ..." if [ -d "$GIT/$FOLDER" ]; then echo "$FOLDER directory exists. Pulling instead." cd $GIT/$FOLDER && git pull origin master &>> $LOG if [ -d "${SOURCE}/${FOLDER}" ]; then echo "${FOLDER} directory exists. Pulling instead." cd ${SOURCE}/${FOLDER} && git pull origin master &>> ${LOG} else cd $GIT && $GITCLONE &>> $LOG cd ${SOURCE} && ${CLONE} &>> ${LOG} fi # fix the version cd $GIT/$FOLDER && git checkout $COMMIT &>> $LOG cd ${SOURCE}/${FOLDER} && git checkout ${COMMIT} &>> ${LOG} echo "Done" } Loading @@ -24,74 +24,126 @@ wgetdeps() { FOLDER=$1 URL=$2 echo "#########################################################" echo "Wgetting into $GIT/$FOLDER ..." if [ -d "$GIT/$FOLDER" ]; then echo "$FOLDER directory exists. Removing its content first." rm -rf $GIT/$FOLDER/* &>> $LOG echo "Wgetting into ${SOURCE}/${FOLDER} ..." if [ -d "${SOURCE}/${FOLDER}" ]; then echo "${FOLDER} directory exists. Removing its content first." rm -rf ${SOURCE}/${FOLDER}/* &>> ${LOG} else mkdir $GIT/$FOLDER mkdir ${SOURCE}/${FOLDER} fi cd $GIT cd ${SOURCE} FILENAME=$(basename $URL) if [ -f "$GIT/$FILENAME" ]; then rm $GIT/$FILENAME if [ -f "${SOURCE}/$FILENAME" ]; then rm ${SOURCE}/$FILENAME fi wget $URL &>> $LOG || exit 1 tar -xf $FILENAME --directory $GIT/$FOLDER --strip-components=1 &>> $LOG wget $URL &>> ${LOG} || exit 1 tar -xf $FILENAME --directory ${SOURCE}/${FOLDER} --strip-components=1 &>> ${LOG} rm $FILENAME echo "Done" } usage() { usage_short() { echo " usage: dl_dep.sh [-h] [-n <NAPLUGIN>] [-c <CLUSTER>] source_path " } help_msg() { usage_short echo " This script gets all ADA-FS dependency sources (excluding the fs itself) echo "Usage: ./clone_dep [ clone_path ] [ NA_Plugin ] Valid NA_Plugin arguments: {bmi,cci,ofi,all} Valid cluster arguments: {mogon1}" positional arguments: source_path path where the dependency downloads are put optional arguments: -h, --help shows this help message and exits -n <NAPLUGIN>, --na <NAPLUGIN> network layer that is used for communication. Valid: {bmi,cci,ofi,all} defaults to 'all' -c <CLUSTER>, --cluster <CLUSTER> additional configurations for specific compute clusters supported clusters: {mogon1,fh2} " } CLUSTER="" NA_LAYER="" if [[ ( -z ${1+x} ) || ( -z ${2+x} ) ]]; then echo "Arguments missing." usage POSITIONAL=() while [[ $# -gt 0 ]] do key="$1" case ${key} in -n|--na) NA_LAYER="$2" shift # past argument shift # past value ;; -c|--cluster) CLUSTER="$2" shift # past argument shift # past value ;; -h|--help) help_msg exit #shift # past argument ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument ;; esac done set -- "${POSITIONAL[@]}" # restore positional parameters # positional arguments if [[ -z ${1+x} ]]; then echo "Positional arguments missing." usage_short exit fi # if cluster is given, put it into a variable CLUSTER="" if [[ ! (-z ${3+x} ) ]]; then CLUSTER=$3 SOURCE=$1 LOG="/tmp/adafs_download_deps.log" echo "" &> ${LOG} # optional arguments if [ "${NA_LAYER}" == "" ]; then echo "Defaulting NAPLUGIN to 'all'" NA_LAYER="all" fi LOG=/tmp/adafs_clone.log echo "" &> $LOG GIT=$1 NA_LAYER=$2 # sanity checks if [ "$NA_LAYER" == "cci" ] || [ "$NA_LAYER" == "bmi" ] || [ "$NA_LAYER" == "ofi" ] || [ "$NA_LAYER" == "all" ]; then echo "$NA_LAYER plugin(s) selected" if [[ ( "${NA_LAYER}" == "cci" ) || ( "${NA_LAYER}" == "bmi" ) || ( "${NA_LAYER}" == "ofi" ) || ( "${NA_LAYER}" == "all" ) ]]; then echo NAPLUGIN = "${NA_LAYER}" else echo "No valid plugin selected" usage usage_short exit fi if [ "$CLUSTER" != "" ]; then if [ "$CLUSTER" == "mogon1" ]; then echo "$CLUSTER cluster configuration selected" if [[ "${CLUSTER}" != "" ]]; then if [[ ( "${CLUSTER}" == "mogon1" ) || ( "${CLUSTER}" == "fh2" ) ]]; then echo CLUSTER = "${CLUSTER}" else echo "$CLUSTER cluster configuration is invalid. Exiting ..." usage echo "${CLUSTER} cluster configuration is invalid. Exiting ..." usage_short exit fi else echo "No cluster configuration set." fi echo "Clone path is set to '$1'" echo "Cloning output is logged at /tmp/adafs_clone.log" echo "Source path is set to '$1'" echo "Download progress is logged at /tmp/adafs_download_deps.log" mkdir -p $GIT mkdir -p ${SOURCE} # get cluster dependencies if [ "$CLUSTER" == "mogon1" ]; then if [[ ( "${CLUSTER}" == "mogon1" ) || ( "${CLUSTER}" == "fh2" ) ]]; then # get libtool for cci wgetdeps "libtool" "http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz" # get libev for mercury Loading @@ -105,17 +157,20 @@ if [ "$CLUSTER" == "mogon1" ]; then # get snappy for rocksdb wgetdeps "snappy" "https://github.com/google/snappy/archive/1.1.7.tar.gz" fi #if [ "${CLUSTER}" == "fh2" ]; then # no distinct 3rd party software needed as of now. #fi # get BMI if [ "$NA_LAYER" == "bmi" ] || [ "$NA_LAYER" == "all" ]; then if [ "${NA_LAYER}" == "bmi" ] || [ "${NA_LAYER}" == "all" ]; then clonedeps "bmi" "git clone git://git.mcs.anl.gov/bmi" "2abbe991edc45b713e64c5fed78a20fdaddae59b" fi # get CCI if [ "$NA_LAYER" == "cci" ] || [ "$NA_LAYER" == "all" ]; then if [ "${NA_LAYER}" == "cci" ] || [ "${NA_LAYER}" == "all" ]; then clonedeps "cci" "git clone https://github.com/CCI/cci" "58fd58ea2aa60c116c2b77c5653ae36d854d78f2" fi # get libfabric if [ "$NA_LAYER" == "ofi" ] || [ "$NA_LAYER" == "all" ]; then if [ "${NA_LAYER}" == "ofi" ] || [ "${NA_LAYER}" == "all" ]; then clonedeps "libfabric" "git clone https://github.com/ofiwg/libfabric" "tags/v1.5.2" fi # get Mercury Loading Loading
ifs/main.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ int main(int argc, const char* argv[]) { if (!hosts.empty()) { auto i = static_cast<uint64_t>(0); auto found_hostname = false; auto hostname = get_my_hostname(false); auto hostname = get_my_hostname(true); if (hostname.empty()) { cerr << "Unable to read the machine's hostname" << endl; ADAFS_DATA->spdlogger()->error("{}() Unable to read the machine's hostname", __func__); Loading
ifs/scripts/compile_dep.sh +184 −118 Original line number Diff line number Diff line #!/bin/bash usage() { usage_short() { echo " usage: compile_dep.sh [-h] [-n <NAPLUGIN>] [-c <CLUSTER>] [-j <COMPILE_CORES>] source_path install_path " } help_msg() { usage_short echo " This script compiles all ADA-FS dependencies (excluding the fs itself) positional arguments: source_path path to the cloned dependencies path from clone_dep.sh install_path path to the install path of the compiled dependencies echo "Usage: ./compile_dep [ clone_path ] [ install_path ] [ na_plugin ] [ cluster ] Valid na_plugin arguments: {bmi,cci,ofi,all} Valid cluster arguments: {mogon1}" optional arguments: -h, --help shows this help message and exits -n <NAPLUGIN>, --na <NAPLUGIN> network layer that is used for communication. Valid: {bmi,cci,ofi,all} defaults to 'all' -c <CLUSTER>, --cluster <CLUSTER> additional configurations for specific compute clusters supported clusters: {mogon1,fh2} -j <COMPILE_CORES>, --compilecores <COMPILE_CORES> number of cores that are used to compile the depdencies defaults to number of available cores " } prepare_build_dir() { Loading @@ -14,106 +38,148 @@ prepare_build_dir() { fi rm -rf $1/build/* } CLUSTER="" NA_LAYER="" CORES="" SOURCE="" INSTALL="" POSITIONAL=() while [[ $# -gt 0 ]] do key="$1" if [[ ( -z ${1+x} ) || ( -z ${2+x} ) || ( -z ${3+x} ) ]]; then echo "Arguments missing." usage case ${key} in -n|--na) NA_LAYER="$2" shift # past argument shift # past value ;; -c|--cluster) CLUSTER="$2" shift # past argument shift # past value ;; -j|--compilecores) CORES="$2" shift # past argument shift # past value ;; -h|--help) help_msg exit fi # if cluster is given, put it into a variable CLUSTER="" if [[ ! (-z ${4+x} ) ]]; then CLUSTER=$4 fi #shift # past argument ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument ;; esac done set -- "${POSITIONAL[@]}" # restore positional parameters #LOG=/tmp/adafs_install.log #echo "" &> $LOG GIT=$1 # deal with positional arguments if [[ ( -z ${1+x} ) || ( -z ${2+x} ) ]]; then echo "Positional arguments missing." usage_short exit fi SOURCE=$1 INSTALL=$2 NA_LAYER=$3 USE_BMI="-DNA_USE_BMI:BOOL=OFF" USE_CCI="-DNA_USE_CCI:BOOL=OFF" USE_OFI="-DNA_USE_OFI:BOOL=OFF" # deal with optional arguments if [ "${NA_LAYER}" == "" ]; then echo "Defaulting NAPLUGIN to 'all'" NA_LAYER="all" fi if [ "${CORES}" == "" ]; then CORES=$(grep -c ^processor /proc/cpuinfo) if [ "$NA_LAYER" == "cci" ] || [ "$NA_LAYER" == "bmi" ] || [ "$NA_LAYER" == "ofi" ] || [ "$NA_LAYER" == "all" ]; then echo "$NA_LAYER plugin(s) selected" echo "CORES = ${CORES} (default)" else if [ ! "${CORES}" -gt "0" ]; then echo "CORES set to ${CORES} which is invalid. Input must be numeric and greater than 0." usage_short exit else echo CORES = "${CORES}" fi fi if [ "${NA_LAYER}" == "cci" ] || [ "${NA_LAYER}" == "bmi" ] || [ "${NA_LAYER}" == "ofi" ] || [ "${NA_LAYER}" == "all" ]; then echo NAPLUGIN = "${NA_LAYER}" else echo "No valid plugin selected" usage usage_short exit fi if [ "$CLUSTER" != "" ]; then if [ "$CLUSTER" == "mogon1" ]; then echo "$CLUSTER cluster configuration selected" if [[ "${CLUSTER}" != "" ]]; then if [[ ( "${CLUSTER}" == "mogon1" ) || ( "${CLUSTER}" == "fh2" ) ]]; then echo CLUSTER = "${CLUSTER}" else echo "$CLUSTER cluster configuration is invalid. Exiting ..." usage echo "${CLUSTER} cluster configuration is invalid. Exiting ..." usage_short exit fi else echo "No cluster configuration set." fi #LOG=/tmp/adafs_install.log #echo "" &> $LOG USE_BMI="-DNA_USE_BMI:BOOL=OFF" USE_CCI="-DNA_USE_CCI:BOOL=OFF" USE_OFI="-DNA_USE_OFI:BOOL=OFF" echo "Source path = '$1'"; echo "Install path = '$2'"; echo "Git path is set to '$1'"; echo "Install path is set to '$2'"; mkdir -p $GIT mkdir -p ${SOURCE} # Set cluster dependencies first if [ "$CLUSTER" == "mogon1" ]; then # Make sure these modules are enabled #module load devel/CMake/3.8.0 || exit 1 #module load mpi/OpenMPI/2.0.2-GCC-6.3.0 || exit 1 #module load devel/Boost/1.63.0-foss-2017a || exit 1 # because of mercury echo "Done" if [[ ( "${CLUSTER}" == "mogon1" ) || ( "${CLUSTER}" == "fh2" ) ]]; then # get libtool echo "############################################################ Installing: libtool" CURR=$GIT/libtool prepare_build_dir $CURR cd $CURR/build ../configure --prefix=$INSTALL || exit 1 make -j$CORES || exit 1 CURR=${SOURCE}/libtool prepare_build_dir ${CURR} cd ${CURR}/build ../configure --prefix=${INSTALL} || exit 1 make -j${CORES} || exit 1 make install || exit 1 # compile libev echo "############################################################ Installing: libev" CURR=$GIT/libev prepare_build_dir $CURR cd $CURR/build ../configure --prefix=$INSTALL || exit 1 make -j$CORES || exit 1 CURR=${SOURCE}/libev prepare_build_dir ${CURR} cd ${CURR}/build ../configure --prefix=${INSTALL} || exit 1 make -j${CORES} || exit 1 make install || exit 1 # compile gflags echo "############################################################ Installing: gflags" CURR=$GIT/gflags prepare_build_dir $CURR cd $CURR/build cmake -DCMAKE_INSTALL_PREFIX=$INSTALL -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j$CORES || exit 1 CURR=${SOURCE}/gflags prepare_build_dir ${CURR} cd ${CURR}/build cmake -DCMAKE_INSTALL_PREFIX=${INSTALL} -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j${CORES} || exit 1 make install || exit 1 # compile zstd echo "############################################################ Installing: zstd" CURR=$GIT/zstd/build/cmake prepare_build_dir $CURR cd $CURR/build cmake -DCMAKE_INSTALL_PREFIX=$INSTALL -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j$CORES || exit 1 CURR=${SOURCE}/zstd/build/cmake prepare_build_dir ${CURR} cd ${CURR}/build cmake -DCMAKE_INSTALL_PREFIX=${INSTALL} -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j${CORES} || exit 1 make install || exit 1 echo "############################################################ Installing: lz4" CURR=$GIT/lz4 cd $CURR make -j$CORES || exit 1 make DESTDIR=$INSTALL PREFIX="" install || exit 1 CURR=${SOURCE}/lz4 cd ${CURR} make -j${CORES} || exit 1 make DESTDIR=${INSTALL} PREFIX="" install || exit 1 echo "############################################################ Installing: snappy" CURR=$GIT/snappy prepare_build_dir $CURR cd $CURR/build cmake -DCMAKE_INSTALL_PREFIX=$INSTALL -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j$CORES || exit 1 CURR=${SOURCE}/snappy prepare_build_dir ${CURR} cd ${CURR}/build cmake -DCMAKE_INSTALL_PREFIX=${INSTALL} -DCMAKE_BUILD_TYPE:STRING=Release .. || exit 1 make -j${CORES} || exit 1 make install || exit 1 fi Loading @@ -121,13 +187,13 @@ if [ "$NA_LAYER" == "bmi" ] || [ "$NA_LAYER" == "all" ]; then USE_BMI="-DNA_USE_BMI:BOOL=ON" echo "############################################################ Installing: BMI" # BMI CURR=$GIT/bmi prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/bmi prepare_build_dir ${CURR} cd ${CURR} ./prepare || exit 1 cd $CURR/build ../configure --prefix=$INSTALL --enable-shared --enable-bmi-only || exit 1 make -j$CORES || exit 1 cd ${CURR}/build ../configure --prefix=${INSTALL} --enable-shared --enable-bmi-only || exit 1 make -j${CORES} || exit 1 make install || exit 1 fi Loading @@ -135,17 +201,17 @@ if [ "$NA_LAYER" == "cci" ] || [ "$NA_LAYER" == "all" ]; then USE_CCI="-DNA_USE_CCI:BOOL=ON" echo "############################################################ Installing: CCI" # CCI CURR=$GIT/cci prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/cci prepare_build_dir ${CURR} cd ${CURR} ./autogen.pl || exit 1 cd $CURR/build cd ${CURR}/build if [ "$CLUSTER" == "mogon1" ]; then ../configure --with-verbs --prefix=$INSTALL LIBS="-lpthread" || exit 1 ../configure --with-verbs --prefix=${INSTALL} LIBS="-lpthread" || exit 1 else ../configure --prefix=$INSTALL LIBS="-lpthread" || exit 1 ../configure --prefix=${INSTALL} LIBS="-lpthread" || exit 1 fi make -j$CORES || exit 1 make -j${CORES} || exit 1 make install || exit 1 make check || exit 1 fi Loading @@ -154,13 +220,13 @@ if [ "$NA_LAYER" == "ofi" ] || [ "$NA_LAYER" == "all" ]; then USE_OFI="-DNA_USE_OFI:BOOL=ON" echo "############################################################ Installing: LibFabric" #libfabric CURR=$GIT/libfabric prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/libfabric prepare_build_dir ${CURR} cd ${CURR} ./autogen.sh || exit 1 cd $CURR/build ../configure --prefix=$INSTALL || exit 1 make -j$CORES || exit 1 cd ${CURR}/build ../configure --prefix=${INSTALL} || exit 1 make -j${CORES} || exit 1 make install || exit 1 make check || exit 1 fi Loading @@ -168,60 +234,60 @@ fi echo "############################################################ Installing: Mercury" # Mercury CURR=$GIT/mercury prepare_build_dir $CURR cd $CURR/build CURR=${SOURCE}/mercury prepare_build_dir ${CURR} cd ${CURR}/build # XXX Note: USE_EAGER_BULK is temporarily disabled due to bugs in Mercury with smaller amounts of data cmake -DMERCURY_USE_SELF_FORWARD:BOOL=ON -DMERCURY_USE_CHECKSUMS:BOOL=OFF -DBUILD_TESTING:BOOL=ON \ -DMERCURY_USE_BOOST_PP:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_INSTALL_PREFIX=$INSTALL \ -DCMAKE_BUILD_TYPE:STRING=Release -DMERCURY_USE_EAGER_BULK:BOOL=OFF $USE_BMI $USE_CCI $USE_OFI ../ || exit 1 make -j$CORES || exit 1 -DMERCURY_USE_BOOST_PP:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_INSTALL_PREFIX=${INSTALL} \ -DCMAKE_BUILD_TYPE:STRING=Release -DMERCURY_USE_EAGER_BULK:BOOL=OFF ${USE_BMI} ${USE_CCI} ${USE_OFI} ../ || exit 1 make -j${CORES} || exit 1 make install || exit 1 echo "############################################################ Installing: Argobots" # Argobots CURR=$GIT/argobots prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/argobots prepare_build_dir ${CURR} cd ${CURR} ./autogen.sh || exit 1 cd $CURR/build ../configure --prefix=$INSTALL || exit 1 make -j$CORES || exit 1 cd ${CURR}/build ../configure --prefix=${INSTALL} || exit 1 make -j${CORES} || exit 1 make install || exit 1 make check || exit 1 echo "############################################################ Installing: Abt-snoozer" # Abt snoozer CURR=$GIT/abt-snoozer prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/abt-snoozer prepare_build_dir ${CURR} cd ${CURR} ./prepare.sh || exit 1 cd $CURR/build ../configure --prefix=$INSTALL PKG_CONFIG_PATH=$INSTALL/lib/pkgconfig || exit 1 make -j$CORES || exit 1 cd ${CURR}/build ../configure --prefix=${INSTALL} PKG_CONFIG_PATH=${INSTALL}/lib/pkgconfig || exit 1 make -j${CORES} || exit 1 make install || exit 1 make check || exit 1 echo "############################################################ Installing: Margo" # Margo CURR=$GIT/margo prepare_build_dir $CURR cd $CURR CURR=${SOURCE}/margo prepare_build_dir ${CURR} cd ${CURR} ./prepare.sh || exit 1 cd $CURR/build ../configure --prefix=$INSTALL PKG_CONFIG_PATH=$INSTALL/lib/pkgconfig CFLAGS="-g -Wall" || exit 1 make -j$CORES || exit 1 cd ${CURR}/build ../configure --prefix=${INSTALL} PKG_CONFIG_PATH=${INSTALL}/lib/pkgconfig CFLAGS="-g -Wall" || exit 1 make -j${CORES} || exit 1 make install || exit 1 make check || exit 1 echo "############################################################ Installing: Rocksdb" # Rocksdb CURR=$GIT/rocksdb cd $CURR CURR=${SOURCE}/rocksdb cd ${CURR} make clean || exit 1 sed -i.bak "s#INSTALL_PATH ?= /usr/local#INSTALL_PATH ?= $INSTALL#g" Makefile make -j$CORES static_lib || exit 1 sed -i.bak "s#INSTALL_PATH ?= /usr/local#INSTALL_PATH ?= ${INSTALL}#g" Makefile make -j${CORES} static_lib || exit 1 make install || exit 1 echo "Done"
ifs/scripts/clone_dep.sh→ifs/scripts/dl_dep.sh +187 −0 Original line number Diff line number Diff line Loading @@ -2,21 +2,21 @@ clonedeps() { FOLDER=$1 GITCLONE=$2 CLONE=$2 COMMIT=$3 echo "#########################################################" echo "Cloning into $GIT/$FOLDER ..." echo "Cloning into ${SOURCE}/${FOLDER} ..." if [ -d "$GIT/$FOLDER" ]; then echo "$FOLDER directory exists. Pulling instead." cd $GIT/$FOLDER && git pull origin master &>> $LOG if [ -d "${SOURCE}/${FOLDER}" ]; then echo "${FOLDER} directory exists. Pulling instead." cd ${SOURCE}/${FOLDER} && git pull origin master &>> ${LOG} else cd $GIT && $GITCLONE &>> $LOG cd ${SOURCE} && ${CLONE} &>> ${LOG} fi # fix the version cd $GIT/$FOLDER && git checkout $COMMIT &>> $LOG cd ${SOURCE}/${FOLDER} && git checkout ${COMMIT} &>> ${LOG} echo "Done" } Loading @@ -24,74 +24,126 @@ wgetdeps() { FOLDER=$1 URL=$2 echo "#########################################################" echo "Wgetting into $GIT/$FOLDER ..." if [ -d "$GIT/$FOLDER" ]; then echo "$FOLDER directory exists. Removing its content first." rm -rf $GIT/$FOLDER/* &>> $LOG echo "Wgetting into ${SOURCE}/${FOLDER} ..." if [ -d "${SOURCE}/${FOLDER}" ]; then echo "${FOLDER} directory exists. Removing its content first." rm -rf ${SOURCE}/${FOLDER}/* &>> ${LOG} else mkdir $GIT/$FOLDER mkdir ${SOURCE}/${FOLDER} fi cd $GIT cd ${SOURCE} FILENAME=$(basename $URL) if [ -f "$GIT/$FILENAME" ]; then rm $GIT/$FILENAME if [ -f "${SOURCE}/$FILENAME" ]; then rm ${SOURCE}/$FILENAME fi wget $URL &>> $LOG || exit 1 tar -xf $FILENAME --directory $GIT/$FOLDER --strip-components=1 &>> $LOG wget $URL &>> ${LOG} || exit 1 tar -xf $FILENAME --directory ${SOURCE}/${FOLDER} --strip-components=1 &>> ${LOG} rm $FILENAME echo "Done" } usage() { usage_short() { echo " usage: dl_dep.sh [-h] [-n <NAPLUGIN>] [-c <CLUSTER>] source_path " } help_msg() { usage_short echo " This script gets all ADA-FS dependency sources (excluding the fs itself) echo "Usage: ./clone_dep [ clone_path ] [ NA_Plugin ] Valid NA_Plugin arguments: {bmi,cci,ofi,all} Valid cluster arguments: {mogon1}" positional arguments: source_path path where the dependency downloads are put optional arguments: -h, --help shows this help message and exits -n <NAPLUGIN>, --na <NAPLUGIN> network layer that is used for communication. Valid: {bmi,cci,ofi,all} defaults to 'all' -c <CLUSTER>, --cluster <CLUSTER> additional configurations for specific compute clusters supported clusters: {mogon1,fh2} " } CLUSTER="" NA_LAYER="" if [[ ( -z ${1+x} ) || ( -z ${2+x} ) ]]; then echo "Arguments missing." usage POSITIONAL=() while [[ $# -gt 0 ]] do key="$1" case ${key} in -n|--na) NA_LAYER="$2" shift # past argument shift # past value ;; -c|--cluster) CLUSTER="$2" shift # past argument shift # past value ;; -h|--help) help_msg exit #shift # past argument ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument ;; esac done set -- "${POSITIONAL[@]}" # restore positional parameters # positional arguments if [[ -z ${1+x} ]]; then echo "Positional arguments missing." usage_short exit fi # if cluster is given, put it into a variable CLUSTER="" if [[ ! (-z ${3+x} ) ]]; then CLUSTER=$3 SOURCE=$1 LOG="/tmp/adafs_download_deps.log" echo "" &> ${LOG} # optional arguments if [ "${NA_LAYER}" == "" ]; then echo "Defaulting NAPLUGIN to 'all'" NA_LAYER="all" fi LOG=/tmp/adafs_clone.log echo "" &> $LOG GIT=$1 NA_LAYER=$2 # sanity checks if [ "$NA_LAYER" == "cci" ] || [ "$NA_LAYER" == "bmi" ] || [ "$NA_LAYER" == "ofi" ] || [ "$NA_LAYER" == "all" ]; then echo "$NA_LAYER plugin(s) selected" if [[ ( "${NA_LAYER}" == "cci" ) || ( "${NA_LAYER}" == "bmi" ) || ( "${NA_LAYER}" == "ofi" ) || ( "${NA_LAYER}" == "all" ) ]]; then echo NAPLUGIN = "${NA_LAYER}" else echo "No valid plugin selected" usage usage_short exit fi if [ "$CLUSTER" != "" ]; then if [ "$CLUSTER" == "mogon1" ]; then echo "$CLUSTER cluster configuration selected" if [[ "${CLUSTER}" != "" ]]; then if [[ ( "${CLUSTER}" == "mogon1" ) || ( "${CLUSTER}" == "fh2" ) ]]; then echo CLUSTER = "${CLUSTER}" else echo "$CLUSTER cluster configuration is invalid. Exiting ..." usage echo "${CLUSTER} cluster configuration is invalid. Exiting ..." usage_short exit fi else echo "No cluster configuration set." fi echo "Clone path is set to '$1'" echo "Cloning output is logged at /tmp/adafs_clone.log" echo "Source path is set to '$1'" echo "Download progress is logged at /tmp/adafs_download_deps.log" mkdir -p $GIT mkdir -p ${SOURCE} # get cluster dependencies if [ "$CLUSTER" == "mogon1" ]; then if [[ ( "${CLUSTER}" == "mogon1" ) || ( "${CLUSTER}" == "fh2" ) ]]; then # get libtool for cci wgetdeps "libtool" "http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz" # get libev for mercury Loading @@ -105,17 +157,20 @@ if [ "$CLUSTER" == "mogon1" ]; then # get snappy for rocksdb wgetdeps "snappy" "https://github.com/google/snappy/archive/1.1.7.tar.gz" fi #if [ "${CLUSTER}" == "fh2" ]; then # no distinct 3rd party software needed as of now. #fi # get BMI if [ "$NA_LAYER" == "bmi" ] || [ "$NA_LAYER" == "all" ]; then if [ "${NA_LAYER}" == "bmi" ] || [ "${NA_LAYER}" == "all" ]; then clonedeps "bmi" "git clone git://git.mcs.anl.gov/bmi" "2abbe991edc45b713e64c5fed78a20fdaddae59b" fi # get CCI if [ "$NA_LAYER" == "cci" ] || [ "$NA_LAYER" == "all" ]; then if [ "${NA_LAYER}" == "cci" ] || [ "${NA_LAYER}" == "all" ]; then clonedeps "cci" "git clone https://github.com/CCI/cci" "58fd58ea2aa60c116c2b77c5653ae36d854d78f2" fi # get libfabric if [ "$NA_LAYER" == "ofi" ] || [ "$NA_LAYER" == "all" ]; then if [ "${NA_LAYER}" == "ofi" ] || [ "${NA_LAYER}" == "all" ]; then clonedeps "libfabric" "git clone https://github.com/ofiwg/libfabric" "tags/v1.5.2" fi # get Mercury Loading