2018-05-12 mkl2018.2.199.sh-20180505-yuan

mkl2018.2.199.sh-20180505-yuan

Please uncomment each line of the script for single step run to make sure no error.

#!/bin/bash

# add variables
i1=0
if [ "$1" ]; then
    i1=$1
fi

# add functions
function prompt()
{
    read -p "$1 [YES/NO]: " input
}

# script name
function myecho0script()
{
    echo
    echo '==========================================================='
    echo "$1"
    echo '==========================================================='
    echo
}

# task title
function myecho1task()
{
    echo
    if [ "$1" ]; then
        # 蓝底白字
        echo -e "\033[44;37m --> $i1. $1\033[0m"
    fi
    i1=$[$i1+1]
}

# things title
function myecho2thing()
{
    echo
    # 红色字
    #echo -e "\033[31m - $1 \033[0m"
    # 绿色字
    echo -e "\033[32m - $1 \033[0m"
    # 红底白字
    #echo -e "\033[41;37m- $1\033[0m"
}

# steps title
function myecho3step()
{
    echo
    echo -e " * $1"
}

# reference title
function myecho4ref()
{
    #echo
    echo -e "\t$1"
}

# highlight title
function myechoy()
{
    echo
    # 黄底黑字
    echo -e "\033[43;30m$1\033[0m"
    #echo -e "\t\t$1"
}

# call outside script
function mysource()
{
    (source $1 $i1)
    i1=$[$i1+1]
}


myecho1task 'install Intel MKL 2018.2.199'

myecho2thing 'intel MKL'
myecho4ref 'l_mkl_2018.2.199.tgz'
    #prompt '[Downlaod manually] https://registrationcenter.intel.com/en/products/postregistration/?sn=NVGW-F7967LCN&EmailID=yuan.xiong%40intel.com&Sequence=1765794&dnld=t'
    #cd tools/
    #tar zxvf l_mkl_2018.2.199.tgz
    #cd -

    #cd tools/l_mkl_2018.2.199
    #sudo sh install_GUI.sh
    #cd -

    echo 'intel MKL'
    echo '/opt/intel/'

myecho2thing 'configurate for MKL and CUDA interaction'
    myecho3step 'intel MKL conf'

    #echo '/opt/intel/lib/intel64' | sudo tee -a /etc/ld.so.conf.d/intel_mkl.conf
    #echo '/opt/intel/mkl/lib/intel64' | sudo tee -a /etc/ld.so.conf.d/intel_mkl.conf
    #echo '/usr/local/cuda/lib64' | sudo tee -a /etc/ld.so.conf.d/cuda.conf
    #echo '/lib' | sudo tee -a /etc/ld.so.conf.d/cuda.conf

    #cd /usr/local/cuda-9.1/targets/x86_64-linux/lib
    #sudo mv libcudnn.so.7 libcudnn.so.7-bak
    #sudo ldconfig
    #cd -

    #source /opt/intel/mkl/bin/mklvars.sh intel64
    ldconfig -v | grep No
    echo '----'
    ldconfig -v | grep Can

    # Verify mkl installation.
    #cd /opt/intel/mkl/examples/examples_core_c/cblas
    #source /opt/intel/mkl/bin/mklvars.sh intel64
    #sudo make libintel64 compiler=gnu

    #prompt 'set mkl to BLAS in Makefile.config'

# new chapter
echo 'End'

你可能感兴趣的:(2018-05-12 mkl2018.2.199.sh-20180505-yuan)