-
Notifications
You must be signed in to change notification settings - Fork 1
/
syn_gpgpu_sim.sh
32 lines (28 loc) · 1.09 KB
/
syn_gpgpu_sim.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# install your modified GPGPUSIM from your local dir on spack
# GPGPUSIM : name of GPGPU-Sim on spack (include version)
# GPGPUSIM_DIR : source of GPGPUSIM to install (modify or not)
# MIRROR_DIR : dir of spack manual mirror (recommend ~/.spack/manual_mirror)
# MIRROR_NAME : name of spack mirror
# make sure GPGPUSIM_DIR match GPGPUSIM
GPGPUSIM_DIR=~/gpgpu-sim
MIRROR_DIR=~/.spack/manual_mirror
MIRROR_NAME=manual_mirror
GPGPUSIM_MIRROR_DIR=${MIRROR_DIR}/$(echo ${GPGPUSIM} | sed 's/@.*//')
GPGPUSIM_TARBALL=${GPGPUSIM_MIRROR_DIR}/$(echo ${GPGPUSIM} | sed 's/@/-/').tar.gz
CUR_DIR=$(pwd)
if spack -V > /dev/null ; [ $? -ne 0 ]
then
echo "fail to find spack"
elif [ ! -d ${GPGPUSIM_DIR} ]
then
echo "GPGPUSIM_DIR" ${GPGPUSIM_DIR} "not exists"
else
[ ! -d ${MIRROR_DIR} ] && mkdir ${MIRROR_DIR}
[ ! -d ${GPGPUSIM_MIRROR_DIR} ] && mkdir ${GPGPUSIM_MIRROR_DIR}
spack mirror add ${MIRROR_NAME} ${MIRROR_DIR} 2>&1 1>&/dev/null
cd ${GPGPUSIM_DIR} && tar -czf ${GPGPUSIM_TARBALL} *
spack uninstall -y ${GPGPUSIM}
spack install ${GPGPUSIM}
cd ${CUR_DIR}
fi