代码拉取完成,页面将自动刷新
同步操作将从 芯华章科技股份有限公司/EpicSim 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
read -r -p "
#####################################################################
#!!!Warning!!!: #
# #
# This script is used for Building/Installing EpicSim From Source #
# #
# Step 1:Download Sourcecode. #
# Step 2:Backup Repo and Install devDependencies. #
# Step 3:Building and Installing EpicSim. #
# Step 4:Set up the EpicSim Environment Variable. #
# Step 5:Install Successfully!! #
# #
# Test: Run “epicsim -v” to have a test. #
# #
# https://www.edagit.com/ #
# #
#####################################################################
Start to Build and Install, Are You Sure ? [Y/n]" input
case $input in
[yY][eE][sS]|[yY])
#Download Sourcecode
yum install -y wget unzip
wget https://gitee.com/x-epic/EpicSim/repository/archive/master.zip
unzip master.zip
#Backup "epel repo"
repo1="/etc/yum.repos.d/epel.repo"
repo2="/etc/yum.repos.d/epel-testing.repo"
if [ -f "$repo1" ]; then
echo "rename epel.repo to epel.repo.backup"
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
fi
if [ -f "$repo2" ]; then
echo "rename epel-testing.repo to epel-testing.repo.backup"
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
fi
#Install devDependencies
stat=`cat /etc/redhat-release|sed -r 's/.* ([0-9]+)\..*/\1/'`
if [ $stat == 6 ];then
yum install -y gperf
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
ln -s /bin/bash /usr/bin/bash
yum install -y cmake3 make bison flex bzip2-devel zlib zlib-devel ncurses-devel centos-release-scl
yum install -y devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils
echo "source /opt/rh/devtoolset-7/enable" >>/etc/profile
source /etc/profile
elif [ $stat == 7 ];then
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install -y gperf cmake3 make gcc-c++ gcc bison flex bzip2-devel zlib zlib-devel ncurses-devel
elif [ $stat == 8 ];then
dnf --enablerepo=PowerTools install -y gperf
yum install -y cmake3 make gcc-c++ gcc bison flex bzip2-devel zlib zlib-devel ncurses-devel
else
echo "The version of your system is not adapted yet. The version is:"$stat
fi
#Building and Installing EpicSim
cd EpicSim
mkdir build && cd build
cmake3 ..
make install
#Set up the EpicSim environment variable
cd ..
echo "export PATH=$PATH:`pwd`/install/bin/" >> /etc/profile
source /etc/profile
#run "epicsim -v" have a test
echo "Install successfully,Pleae run “epicsim -v” have a test"
;;
[nN][oO]|[nN])
echo "Goodbye!"
;;
*)
echo "Invalid input... Please retry!"
exit 1
;;
esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。