-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.sh
More file actions
executable file
·54 lines (46 loc) · 1.73 KB
/
Copy pathenv.sh
File metadata and controls
executable file
·54 lines (46 loc) · 1.73 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
47
48
49
50
51
52
53
54
#!/bin/bash
# Colora
ORANGE='\e[38;5;214m'
NC='\033[0m' # No Color
BLUE='\e[38;5;75m'
echo -e "${ORANGE}====================================================${NC}"
echo -e "${BLUE} RISC-V DEVELOPMENT ENVIRONMENT CHECK ${NC}"
echo -e "${ORANGE}====================================================${NC}"
# print function
print_version() {
if command -v $2 &> /dev/null; then
echo -e "${BLUE}# $1:${NC}"
$2 --version | head -n 1
echo ""
else
echo -e "${BLUE}# $1:${NC} No instalado"
echo ""
fi
}
# 1. GCC Compilers
print_version "GCC C Compiler (Linux)" "riscv64-linux-gnu-gcc"
print_version "GCC C++ Compiler (Linux)" "riscv64-linux-gnu-g++"
print_version "GCC Fortran Compiler (Linux)" "riscv64-linux-gnu-gfortran"
# 2. LLVM - Clang and Flang
print_version "Clang (C/C++ Compiler)" "clang"
print_version "Flang (Fortran Compiler)" "flang"
# 3. Emulators
print_version "QEMU User Mode" "qemu-riscv64"
print_version "QEMU System Mode" "qemu-system-riscv64"
# 4. Rust (Optional)
if command -v rustc &> /dev/null; then
print_version "Rust Compiler" "rustc"
echo -e "${BLUE}# Rust Targets:${NC}"
rustup target list --installed | grep riscv
echo ""
else
echo -e "${BLUE}# Rust:${NC} Not installed"
echo ""
fi
echo -e "${ORANGE}=====================================================${NC}"
echo -e "Alias for compiling with vector support RVV 1.0:"
echo -e " - ${ORANGE}GCC / G++:${NC} rv-g++ <src> -o <dest>"
echo -e " - ${ORANGE}Clang++:${NC} rv-clang++ <src> -o <dest>"
echo -e " - ${ORANGE}Flang:${NC} rv-flang <src> -o <des>"
echo -e " - ${ORANGE}QEMU (RVV):${NC} rv-qemu ./<binary>"
echo -e "${ORANGE}=====================================================${NC}"