-
Notifications
You must be signed in to change notification settings - Fork 5
/
install_gpgpusim.sh
executable file
·118 lines (107 loc) · 4.91 KB
/
install_gpgpusim.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
# ******************************************
# Scripts for installing GPGPU-Sim on Linux
# by Gunjae Koo ([email protected])
# ******************************************
# This script for automating the installation process of GPGPU-Sim.
# The installation process is tested on Linux Mint 17.3 64-bits (based on Ubuntu 14.04 LTS)
# functions
function confirm() {
# call with a prompt string or use a default
read -r -p "Will you install $1? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
true
;;
*)
false
;;
esac
}
# -------------------------------------
# Installing the basic applications (for Docker environments)
# -------------------------------------
echo " # -------------------------------------"
echo " # Installing the basic applications (for Docker environments)"
echo " # -------------------------------------"
confirm "installing_basic_apps" && \
sudo apt-get update && \
sudo apt-get install gcc g++ git vim wget
# -------------------------------------
# Installing C/C++ compilers
# -------------------------------------
echo " -------------------------------------------------- "
echo " Installing appropriate version of C/C++ compilers "
echo " -------------------------------------------------- "
mkdir -p ~/bin
sudo apt-get install g++
sudo apt-get install gcc-4.4 g++-4.4
echo " -------------------------------------------------- "
echo " Replacie the default compiler links (4.8 is the pre-installed version)"
echo " -------------------------------------------------- "
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
echo " -------------------------------------------------- "
echo " Select the appropriate version of gcc/g++"
echo " -------------------------------------------------- "
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
# -------------------------------------------------
# Installing dependent libraries
# -------------------------------------------------
echo " -------------------------------------------------- "
echo " Installing required libraries"
echo " -------------------------------------------------- "
sudo apt-get install libxi-dev libxmu-dev freeglut3-dev
sudo apt-get install libcuda1-346 libcudart5.5
# -------------------------------------------------
# Installing CUDA Toolkit and CUDA SDK
# -------------------------------------------------
# GPGPU-Sim 3.2.2 supports up to 4.2 version of CUDA SDK
echo " -------------------------------------------------- "
echo " Downloadiing CUDA Toolkit and SDK"
echo " -------------------------------------------------- "
confirm "downalod_cuda_toolkit_and_sdk" && \
wget http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/cudatoolkit_4.2.9_linux_64_ubuntu11.04.run && \
wget http://developer.download.nvidia.com/compute/cuda/4_2/rel/sdk/gpucomputingsdk_4.2.9_linux.run && \
chmod 755 *.run
echo " -------------------------------------------------- "
echo " Installing CUDA Toolkit for nvcc. (target = /usr/local/cuda)"
echo " -------------------------------------------------- "
confirm "install_nvcc" && \
sudo ./cudatoolkit_4.2.9_linux_64_ubuntu11.04.run
echo " -------------------------------------------------- "
echo " Installing CUDA SDK (target = ~/workspace/cuda_sdk4)"
echo " -------------------------------------------------- "
confirm "isntall_cuda_sdk" && \
./gpucomputingsdk_4.2.9_linux.run
# -------------------------------------------------
# Install GPGPU-Sim
# -------------------------------------------------
echo " -------------------------------------------------- "
echo " Installing apps for GPGPU-Sim"
echo " -------------------------------------------------- "
sudo apt-get install build-essential xutils-dev bison zlib1g-dev flex libglu1-mesa-dev
echo " -------------------------------------------------- "
echo " Installing apps for doxygen"
echo " -------------------------------------------------- "
sudo apt-get install doxygen graphviz
echo " -------------------------------------------------- "
echo " Installing apps for AerialVision"
echo " -------------------------------------------------- "
sudo apt-get install python-pmw python-ply python-numpy libpng12-dev python-matplotlib
# ------------------------------------------------
# Before compiling GPGPU-Sim
# ------------------------------------------------
echo ""
echo " ==========================================================="
echo " Source setup_gpgpusim"
echo " ==========================================================="
echo ""
echo " Then, make!!!"