forked from AveZorgen/MatMul-RVM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.sh
More file actions
executable file
·46 lines (39 loc) · 1.19 KB
/
env.sh
File metadata and controls
executable file
·46 lines (39 loc) · 1.19 KB
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
#!/bin/bash
#
# set parameters
#
compiler_file="./3rd-party/Xuantie-gcc-linux-glibc-x86_64-matrix.tar.gz"
compiler_md5="15e6fe82825664494310a1a671b73d6a"
compiler_address="https://github.com/T-head-Semi/riscv-matrix-extension-spec/releases/download/v0.3.0/Xuantie-gcc-linux-glibc-x86_64-matrix.tar.gz"
#
# Make QEMU
#
echo "--- Make qemu ---"
mkdir tools
mkdir tools/qemu
tar -zxvf ./3rd-party/xuantie-qemu-x86_64-Ubuntu-18.04.tar.gz -C tools/qemu
#
# Make GCC
#
if [ -f "$compiler_file" ]; then
if [ "$(md5sum $compiler_file | awk '{ print $1 }')" == "$compiler_md5" ]; then
echo "--- Already have compiler tar ---"
else
echo "--- Wrong compiler tar ---"
rm $compiler_file
fi
fi
if [ ! -f "$compiler_file" ]; then
echo "--- Download compipler ---"
wget -O $compiler_file $compiler_address
if [ $? != 0 ]; then
echo "Download fail. Take a rest and retry it"
echo "Or download compiler from github and put it in toolchain dir"
echo "--- Fatal Error ---"
exit 1
fi
fi
echo "--- Make compiler ---"
mkdir tools/gcc
tar -zxvf ./3rd-party/Xuantie-gcc-linux-glibc-x86_64-matrix.tar.gz -C tools/gcc
echo "--- The environment is ready ---"