diff options
Diffstat (limited to 'scripts/build_rsocket.sh')
-rwxr-xr-x | scripts/build_rsocket.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/build_rsocket.sh b/scripts/build_rsocket.sh new file mode 100755 index 0000000..ef31c88 --- /dev/null +++ b/scripts/build_rsocket.sh @@ -0,0 +1,34 @@ +#!/bin/bash -x + +set -x + +OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') + +DMM_DIR=`dirname $(readlink -f $0)`/../ +BUILD_DIR=${DMM_DIR}/build + +############### build rsocket +echo "rsocket build start" +cd $DMM_DIR/stacks/rsocket +if [ "$OS_ID" == "ubuntu" ]; then + wget http://www.mellanox.com/downloads/ofed/MLNX_OFED-4.4-1.0.0.0/MLNX_OFED_LINUX-4.4-1.0.0.0-ubuntu16.04-x86_64.tgz + tar -zxvf MLNX_OFED_LINUX-4.4-1.0.0.0-ubuntu16.04-x86_64.tgz + cd MLNX_OFED_LINUX-4.4-1.0.0.0-ubuntu16.04-x86_64 +elif [ "$OS_ID" == "centos" ]; then + CENT_VERSION=`grep -oE '[0-9]+\.[0-9]+' /etc/redhat-release` + wget http://www.mellanox.com/downloads/ofed/MLNX_OFED-4.4-1.0.0.0/MLNX_OFED_LINUX-4.4-1.0.0.0-rhel${CENT_VERSION}-x86_64.tgz + tar -zxvf MLNX_OFED_LINUX-4.4-1.0.0.0-rhel${CENT_VERSION}-x86_64.tgz + cd MLNX_OFED_LINUX-4.4-1.0.0.0-rhel${CENT_VERSION}-x86_64 +fi + +sudo ./mlnxofedinstall --force || exit 1 + +cd $BUILD_DIR +make dmm_rsocket +if [ $? -eq 0 ]; then + echo "rsocket build has SUCCESS" +else + echo "rsocket build has FAILED" + exit 1 +fi +echo "rsocket build finished"
\ No newline at end of file |