#!/bin/bash

# Program:
#   Install drbl-mpi
# Author: 
#   adherelinux
# Version:
#    1.0
# History: 
#   2011/07/01  

# [Variable Declation]
cpu_flag="no"
Linux_bit=""
Linux_Distribution=""
Linux_Version=""
VMM_select=""


# [Check Root]
function check_root(){
    if [ $USER != "root" ]; then
        echo -e "Please change root to run it!"
        exit
    fi
}

# [Change root to run]
function check_root_run(){
    if [ $USER != "root" ]; then
        echo -e "Please change root to run it!"
        sudo su -c ~/"$0" "$@"
        exit
    fi
}


# [Check CPU support]
function cpu_check(){
    egrep '(vmx|svm)' --color=always /proc/cpuinfo > /dev/null
    if [ $? == 0 ]; then
        cpu_flag="yes"
    fi
}


# [Check System Version]
function check_systemInfo(){
    Linux_bit=$(uname -m)
    Linux_Distribution=$(lsb_release -i | awk '{print $3}')
    Linux_Version=$(lsb_release -r | awk '{print $2}')
}

# [Check Ubuntu mpich2 package]
function check_ubuntu_mpich2(){
    echo "[Check MPICH2 package in apt server]"
    echo ""
    #apt-get update
    check_ubuntu_mpich2_pkg=$(apt-cache search mpich2)
    if [ -n "$check_ubuntu_mpich2_pkg"  ]; then
        check_ubuntu_mpich2_pkg="yes"
    else
        check_ubuntu_mpich2_pkg="no"
    fi
}



