Verified Commit d086f9dd authored by Marc Vef's avatar Marc Vef
Browse files

Adding working psm2 dependencies to scripts

parent 66fd6893
Loading
Loading
Loading
Loading
+35 −14
Original line number Diff line number Diff line
@@ -2,12 +2,12 @@

MOGON2_DEPS=(
    "zstd" "lz4" "snappy" "bmi" "mercury" "argobots" "margo" "rocksdb" 
    "capstone" "syscall_intercept" "date"
    "capstone" "syscall_intercept" "date" "psm2"
)

usage_short() {
	echo "
usage: compile_dep.sh [-h] [-l] [-n <NAPLUGIN>] [-c <CLUSTER>] [-d <DEPENDENCY>] [-j <COMPILE_CORES>]
usage: compile_dep.sh [-h] [-l] [-n <NAPLUGIN>] [-c <CLUSTER>] [-d <DEPENDENCY>] [--use-bundled-psm2] [-j <COMPILE_CORES>]
                      source_path install_path
	"
}
@@ -36,6 +36,12 @@ optional arguments:
    -d <DEPENDENCY>, --dependency <DEPENDENCY>
                build and install a specific dependency. If unspecified 
                all dependencies are built and installed.
    --use-psm2
                Link opa-psm2 to libfabric. Uses system installed one
                if --use-bundled-psm2 is not given.
    --use-bundled-psm2          
                Build libfabric with the recommended opa-psm2 library.
                Otherwise system opa-psm2 is linked to libfabric
    -j <COMPILE_CORES>, --compilecores <COMPILE_CORES>
                number of cores that are used to compile the dependencies
                defaults to number of available cores
@@ -81,6 +87,8 @@ NA_LAYER=""
CORES=""
SOURCE=""
INSTALL=""
USE_PSM2=false
USE_BUNDLED_PSM2=false

POSITIONAL=()
while [[ $# -gt 0 ]]
@@ -98,6 +106,14 @@ case ${key} in
    shift # past argument
    shift # past value
    ;;
    --use-psm2)
    USE_PSM2=true
    shift # past argument
    ;;
    --use-bundled-psm2)
    USE_BUNDLED_PSM2=true
    shift # past argument
    ;;
    -d|--dependency)
    if [[ -z "$2" ]]; then
        echo "Missing argument for -d/--dependency option"
@@ -242,7 +258,7 @@ fi

# build bmi
if [[ ( "${DEPENDENCY}" == "" ) || ( "${DEPENDENCY}" == "bmi" ) ]]; then
    if [ "$NA_LAYER" == "bmi" ] || [ "$NA_LAYER" == "all" ]; then
    if [[ ( "${NA_LAYER}" == "bmi" ) || ( "${NA_LAYER}" == "all" ) ]]; then
        USE_BMI="-DNA_USE_BMI:BOOL=ON"
        echo "############################################################ Installing:  BMI"
        # BMI
@@ -259,22 +275,26 @@ fi

# build ofi
if [[ ( "${DEPENDENCY}" == "" ) || ( "${DEPENDENCY}" == "ofi" ) ]]; then
    if [ "$NA_LAYER" == "ofi" ] || [ "$NA_LAYER" == "all" ]; then
    if [[ ( "${NA_LAYER}" == "ofi" ) || ( "${NA_LAYER}" == "all" ) ]]; then
        USE_OFI="-DNA_USE_OFI:BOOL=ON"
        # Mogon2 already has libfabric installed in a version that Mercury supports.
        if [[ ("${CLUSTER}" != "mogon2") ]]; then
        echo "############################################################ Installing:  LibFabric"
        #libfabric
        CURR=${SOURCE}/libfabric
        prepare_build_dir ${CURR}
        cd ${CURR}/build
        # decide if to build with psm2
        if [[ ( "${CLUSTER}" == "mogon2" ) || [[ ( ${USE_PSM2} == true ) && ( ${USE_BUNDLED_PSM2} == true ) ]] ]]; then
            ../configure --prefix=${INSTALL} --enable-tcp=yes --enable-psm2=yes --with-psm2-src=${SOURCE}/psm2
        elif [[ ( ${USE_PSM2} == true ) && ( ${USE_BUNDLED_PSM2} == false ) ]]; then
            ../configure --prefix=${INSTALL} --enable-tcp=yes --enable-psm2=yes
        else
            ../configure --prefix=${INSTALL} --enable-tcp=yes
        fi
        make -j${CORES}
        make install
        [ "${PERFORM_TEST}" ] && make check
    fi
fi
fi


# Mercury
@@ -301,6 +321,7 @@ if [[ ( "${DEPENDENCY}" == "" ) || ( "${DEPENDENCY}" == "mercury" ) ]]; then
        -DMERCURY_USE_BOOST_PP:BOOL=ON \
        -DMERCURY_USE_EAGER_BULK:BOOL=ON \
        -DBUILD_SHARED_LIBS:BOOL=ON \
        -DNA_SM_TMP_DIRECTORY:STRING="/dev/shm" \
        -DCMAKE_INSTALL_PREFIX=${INSTALL} \
        ${USE_BMI} ${USE_OFI} \
        ..
+14 −5
Original line number Diff line number Diff line
@@ -9,10 +9,11 @@ PATCH_DIR="${PATCH_DIR}/patches"
CLUSTER=""
DEPENDENCY=""
NA_LAYER=""
USE_PSM2=false

MOGON2_DEPS=(
    "zstd" "lz4" "snappy" "bmi" "mercury" "argobots" "margo" "rocksdb" 
    "capstone" "syscall_intercept" "date"
    "capstone" "syscall_intercept" "date" "psm2"
)

# Stop all backround jobs on interruption.
@@ -99,7 +100,7 @@ wgetdeps() {

usage_short() {
	echo "
usage: dl_dep.sh [-h] [-l] [-n <NAPLUGIN>] [-c <CLUSTER>] [-d <DEPENDENCY>] 
usage: dl_dep.sh [-h] [-l] [-n <NAPLUGIN>] [-c <CLUSTER>] [-d <DEPENDENCY>] [--get-psm2]
                    source_path
	"
}
@@ -124,9 +125,11 @@ optional arguments:
        -c <CLUSTER>, --cluster <CLUSTER>
                                additional configurations for specific compute clusters
                                supported clusters: {mogon2}
                                mogon2 automatically enables --get-psm2 flag
        -d <DEPENDENCY>, --dependency <DEPENDENCY>
                                download a specific dependency. If unspecified 
                                all dependencies are built and installed.
        --get-psm2              Gets the recommened opa-psm2 library version to build with libfabric.
        "
}

@@ -141,6 +144,10 @@ case ${key} in
    shift # past argument
    shift # past value
    ;;
    --get-psm2)
    USE_PSM2=true
    shift # past argument
    ;;
    -c|--cluster)
    CLUSTER="$2"
    shift # past argument
@@ -244,11 +251,13 @@ fi
# get libfabric
if [[ ( "${DEPENDENCY}" == "" ) || ( "${DEPENDENCY}" == "ofi" ) ]]; then
    if [ "${NA_LAYER}" == "ofi" ] || [ "${NA_LAYER}" == "all" ]; then
        # No need to get libfabric for mogon2 as it is already installed
        if [[ ("${CLUSTER}" != "mogon2") ]]; then
            wgetdeps "libfabric" "https://github.com/ofiwg/libfabric/releases/download/v1.8.1/libfabric-1.8.1.tar.bz2" &
    fi
fi

# get opa-psm2
if [[ ( "${DEPENDENCY}" == "psm2" ) || ( "${CLUSTER}" == "mogon2" ) || ( ${USE_PSM2} == true ) ]]; then
    wgetdeps "psm2" "https://github.com/intel/opa-psm2/archive/PSM2_11.2.86.tar.gz" &
fi

# get Mercury