-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_dependencies
executable file
·109 lines (99 loc) · 3.02 KB
/
install_dependencies
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
#!/bin/bash
if [ ! -f "install_dependencies" ]; then
echo "Wrong working dir! Execute when in root of Project!"
exit 1
fi
if [ ! command -v make &> /dev/null ]; then
echo "Please install make first. (e.g. \"sudo apt install make\")"
exit 1;
fi
if [ ! command -v cmake &> /dev/null ]; then
echo "Please install cmake first. (e.g. \"sudo apt install cmake\")"
exit 1;
fi
if [ ! command -v g++ &> /dev/null ]; then
echo "Please install g++ first. (e.g. \"sudo apt install g++\")"
exit 1;
fi
if [ ! command -v gnuplot &> /dev/null ]; then
echo "Please install gnuplot first. (e.g. \"sudo apt install gnuplot\")"
exit 1;
fi
if [ "$EUID" -ne 0 ]; then
echo "Please run as root for the \"make install\" sections (sudo is enough)"
exit 1
fi
if [ ! -d "lib" ]; then
mkdir lib
fi
cd lib
#FFTW3.3.10
if [ ! -d "fftw3" ]; then
#download fftw3 from http://www.fftw.org/
echo "downloading fftw3 now..."
mkdir fftw3
cd fftw3
wget http://www.fftw.org/fftw-3.3.10.tar.gz
tar -xf fftw-3.3.10.tar.gz --strip 1
rm fftw-3.3.10.tar.gz
cd ..
fi
if [ ! -f "/usr/local/include/fftw3.h" ]; then
echo "installing fftw3 now..."
cd fftw3
./configure
make
sudo make install
cd ..
fi
#WS281x
if [ ! -d "rpi_ws281x" ]; then
#get specific commit from archife of https://github.com/jgarff/rpi_ws281x
echo "downloading ws281x library now..."
wget https://github.com/jgarff/rpi_ws281x/archive/ee7522e3b053950af33bc7e4364742cd3aeaf594.zip
unzip ee7522e3b053950af33bc7e4364742cd3aeaf594.zip
mv rpi_ws281x-ee7522e3b053950af33bc7e4364742cd3aeaf594/ rpi_ws281x
rm ee7522e3b053950af33bc7e4364742cd3aeaf594.zip
fi
if [ ! -d "/usr/local/include/ws2811" ]; then
#make and make install
echo "installing ws2811 now..."
cd rpi_ws281x
sudo cmake CMakeLists.txt
make
sudo make install
cd ..
fi
#Portaudio
if [ ! -d "portaudio" ]; then
#download stable release 19.7 from portaudio (http://files.portaudio.com/)
echo "downloading portaudio now..."
wget http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz
tar -xf pa_stable_v190700_20210406.tgz
rm pa_stable_v190700_20210406.tgz
fi
if [ ! -f "/usr/local/include/portaudio.h" ]; then
echo "installing portaudio now..."
cd portaudio
./configure
make
sudo make install
cd ..
fi
#WiringPi
if [ ! -d "WiringPi" ]; then
#download specific Commit directly from git
wget "https://github.com/WiringPi/WiringPi/archive/5de0d8f5739ccc00ab761639a7e8d3d1696a480a.zip"
unzip 5de0d8f5739ccc00ab761639a7e8d3d1696a480a.zip
mv WiringPi-5de0d8f5739ccc00ab761639a7e8d3d1696a480a/ WiringPi/
fi
if [ ! -f "/usr/local/include/wiringPi.h" ]; then
#use automatic script to install wiringPi
cd WiringPi
./build
cd ..
fi
cd ..
echo "------------------------------------------------------"
echo "All done now. Now you can simply type 'make' to compile the program."
echo "Note that you compile the FrequencyCorrection helper with 'make CalculationCorrection'."