-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv-install-scripts.sh
148 lines (135 loc) · 6.93 KB
/
env-install-scripts.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#################################################################################################
# 1. Optional: setup VPN for fast download
#################################################################################################
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
# !!! you have to make sure you can use `git clone` from github
#################################################################################################
# 2. install pre-requirements
#################################################################################################
# Optional: install nvidia-driver
# sudo ubuntu-drivers autoinstall && sudo reboot now
sudo apt update
# tools
sudo apt install flameshot -y
# install necessary library
sudo apt install proxychains4 shadowsocks-libev vim wget git tmux make gcc time curl libreadline6-dev libsdl2-dev gcc-riscv64-linux-gnu openjdk-11-jre zlib1g-dev device-tree-compiler flex autoconf bison sqlite3 libsqlite3-dev -y
sudo apt-get install perl python3 make autoconf g++ flex bison clang -y
sudo apt-get install libgoogle-perftools-dev numactl perl-doc -y
sudo apt-get install libfl2 -y # Ubuntu only (ignore if gives error)
sudo apt-get install libfl-dev -y # Ubuntu only (ignore if gives error)
sudo apt-get install zlibc zlib1g zlib1g-dev -y # Ubuntu only (ignore if gives error)
sudo apt-get install help2man perl python3 make autoconf g++ flex bison ccache -y
sudo apt-get install libgoogle-perftools-dev numactl perl-doc -y
sudo apt-get install libfl2 -y # Ubuntu only (ignore if gives error)
sudo apt-get install libfl-dev -y # Ubuntu only (ignore if gives error)
sudo apt-get install zlibc zlib1g zlib1g-dev -y # Ubuntu only (ignore if gives error)
sudo apt-get install help2man -y
sudo apt-get install build-essential -y # build-essential packages, include binary utilities, gcc, make, and so on
sudo apt-get install man -y # on-line reference manual
sudo apt-get install gcc-doc -y # on-line reference manual for gcc
sudo apt-get install gdb -y # GNU debugger
sudo apt-get install git -y # revision control system
sudo apt-get install libreadline-dev -y # a library used later
sudo apt-get install libsdl2-dev -y # a library used later
sudo apt-get install llvm llvm-dev -y # llvm project, which contains libraries used later
# sudo apt-get install llvm-11 llvm-11-dev # only for ubuntu20.04
# instal zsh git
sudo apt install zsh -y
chsh -s /usr/bin/zsh
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
p10k configure
# config zsh from my config files
sudo apt install stow -y
cd ~
git clone [email protected]:timemeansalot/env_config.git .env_config
cd .env_config
stow nvim && stow tmux && stow zsh
#################################################################################################
# 3. install verilator
#################################################################################################
# https://verilator.org/guide/latest/install.html
sudo apt-get install git perl python3 make autoconf g++ flex bison clang -y
sudo apt-get install libgoogle-perftools-dev numactl perl-doc -y
sudo apt-get install libfl2 -y # Ubuntu only (ignore if gives error)
sudo apt-get install libfl-dev -y # Ubuntu only (ignore if gives error)
sudo apt-get install zlibc zlib1g zlib1g-dev -y # Ubuntu only (ignore if gives error)
git clone https://github.com/verilator/verilator
# Every time you need to build:
unset VERILATOR_ROOT # For bash
cd verilator
# XiangShan uses Verilator v4.218
git checkout v4.218 # XiangShan Verilator Version
autoconf # Create ./configure script
# Configure and create Makefile
# ./configure CC=clang CXX=clang++ # We use clang as default compiler
./configure
make -j `nproc` # Build Verilator itself
sudo make install
verilator --version
# install verilator
sudo apt-get install verilator -y
#################################################################################################
# 4. install riscv toolchain
#################################################################################################
sudo apt-get install autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev -y
git clone https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain
# git submodule update --init --recursive
./configure --prefix=/opt/riscv
# compile newlib
make -j `nproc`
# compile riscv-toolchain
make linux -j `nproc`
#################################################################################################
# 5. install nodejs
#################################################################################################
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
source ~/.zshrc
# nvm ls-remote
nvm install 18
source ~/.zshrc
npm config set registry https://registry.npm.taobao.org
# install hexo
npm install hexo -g
npm fund
npm install
sudo apt-get install pandoc -y # used by hexo
#################################################################################################
# 6. install tmux, neovim
#################################################################################################
# install neovim
wget https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz
mkdir ~/app
tar -xvzf nvim-linux64.tar.gz -C ~/app
sudo ln -s ~/app/nvim-linux64/bin/nvim /usr/bin/nvim
nvim --version
# config neovim
sudo apt-get install ripgrep -y
sudo apt install cargo -y
cargo install stylua # lua formatter
cargo install svls # system verilog lsp
sudo apt remove cmdtest
sudo apt remove yarn
npm install -g prettier # used by neovim
npm install picgo -g # install picgo-core
picgo set uploader
npm install -g yarn
cd ~/.local/share/nvim/site/pack/packer/start/
git clone https://github.com/iamcco/markdown-preview.nvim.git
cd markdown-preview.nvim
yarn install
yarn build
# install tmux
sudo apt-get install tmux -y
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm # tmux package manager
#################################################################################################
# 7. clone my useful github repos
################################################################################################
mkdir -p ~/Developer/git_repos
cd ~/Developer/git_repos
git clone [email protected]:timemeansalot/SourceFiles.git
git clone [email protected]:ChipDesign/FAST_INTR_CPU.git
git clone [email protected]:oscc-ip/vga.git