-
Notifications
You must be signed in to change notification settings - Fork 3
/
install_Ubuntu-22.04_k4a.sh
122 lines (110 loc) · 3.91 KB
/
install_Ubuntu-22.04_k4a.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
#!/usr/bin/env bash
set -e
GRASS_RELEASE=8.2.1
PCL_RELEASE=1.11.1
TANGIBLE_RELEASE=1.2.2
RINKINECT_RELEASE=2.1.0
NCORES=2
CDIR=`pwd`
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
# package dependencies
sudo apt-get update && sudo apt install \
build-essential cmake curl pkg-config git wget\
libusb-1.0-0-dev libturbojpeg0-dev libglfw3-dev \
libboost-all-dev libeigen3-dev libflann-dev libopencv-dev \
flex make bison gcc libgcc-s1 g++ ccache \
python3-dateutil libgsl-dev \
python3-numpy python3-pil python3-matplotlib python3-watchdog \
python3-wxgtk4.0 python3-wxgtk-webview4.0 python3-pip \
python-is-python3 \
libncurses-dev \
zlib1g-dev gettext \
libtiff-dev libpnglite-dev \
libcairo2 libcairo2-dev \
sqlite3 libsqlite3-dev \
libpq-dev \
libreadline-dev libfreetype6-dev \
libfftw3-3 libfftw3-dev \
libboost-thread-dev libboost-program-options-dev \
subversion \
libavutil-dev \
libavcodec-dev \
libavformat-dev libswscale-dev \
libglu1-mesa-dev libxmu-dev \
ghostscript \
libproj-dev proj-data proj-bin \
libgeos-dev \
libgdal-dev python3-gdal gdal-bin \
libzstd-dev \
libpdal-dev \
libsdl2-dev
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython
# k4a
wget mirrors.kernel.org/ubuntu/pool/universe/libs/libsoundio/libsoundio1_1.1.0-1_amd64.deb
sudo dpkg -i libsoundio1_1.1.0-1_amd64.deb
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.4/libk4a1.4_1.4.1_amd64.deb > /tmp/libk4a1.4_1.4.1_amd64.deb
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.4-dev/libk4a1.4-dev_1.4.1_amd64.deb > /tmp/libk4a1.4-dev_1.4.1_amd64.deb
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/k/k4a-tools/k4a-tools_1.4.1_amd64.deb > /tmp/k4a-tools_1.4.1_amd64.deb
echo 'libk4a1.4 libk4a1.4/accepted-eula-hash string 0f5d5c5de396e4fee4c0753a21fee0c1ed726cf0316204edda484f08cb266d76' | sudo debconf-set-selections
echo 'libk4a1.4 libk4a1.4/accept-eula select true' | sudo debconf-set-selections
sudo dpkg -i /tmp/libk4a1.4_1.4.1_amd64.deb
sudo dpkg -i /tmp/libk4a1.4-dev_1.4.1_amd64.deb
sudo dpkg -i /tmp/k4a-tools_1.4.1_amd64.deb
sudo mkdir -p /etc/udev/rules.d
sudo wget https://raw.githubusercontent.com/microsoft/Azure-Kinect-Sensor-SDK/develop/scripts/99-k4a.rules -O /etc/udev/rules.d/99-k4a.rules
# PCL
wget https://github.com/PointCloudLibrary/pcl/archive/pcl-${PCL_RELEASE}.tar.gz
tar xvf pcl-${PCL_RELEASE}.tar.gz
rm pcl-${PCL_RELEASE}.tar.gz
cd pcl-pcl-${PCL_RELEASE}
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j${NCORES}
sudo make -j2 install
cd ../..
# GRASS GIS
git clone --branch ${GRASS_RELEASE} https://github.com/OSGeo/grass
cd grass
CFLAGS="-O2 -Wall" LDFLAGS="-s" ./configure \
--enable-largefile=yes \
--with-nls \
--with-cxx \
--with-readline \
--with-pthread \
--with-proj-share=/usr/share/proj \
--with-geos=/usr/bin/geos-config \
--with-cairo \
--with-freetype=yes --with-freetype-includes="/usr/include/freetype2/" \
--with-sqlite=yes \
--with-odbc=no \
--with-liblas=no \
--with-opengl \
--with-pdal
make -j${NCORES}
sudo make install
cd ..
# r.in.kinect
git clone --branch v${RINKINECT_RELEASE} https://github.com/tangible-landscape/r.in.kinect
cd r.in.kinect
make MODULE_TOPDIR=../grass
make install MODULE_TOPDIR=../grass
cd ..
# TL plugin
git clone --branch v${TANGIBLE_RELEASE} https://github.com/tangible-landscape/grass-tangible-landscape
cd grass-tangible-landscape
make MODULE_TOPDIR=../grass
make install MODULE_TOPDIR=../grass
cd ..
# set up GRASS GIS icon in dash
cat << EOF > /tmp/grass.desktop
[Desktop Entry]
Version=1.0
Name=GRASS GIS
Comment=Start GRASS GIS
Exec=/usr/local/bin/grass
Icon=/usr/local/grass82/share/icons/hicolor/scalable/apps/grass.svg
Terminal=true
Type=Application
Categories=GIS;Application;
EOF
sudo mv /tmp/grass.desktop /usr/share/applications/grass.desktop