-
Notifications
You must be signed in to change notification settings - Fork 287
164 lines (141 loc) · 5.86 KB
/
ubuntu-dep-src.yml
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Ubuntu-dep-src
# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
on:
push:
pull_request:
schedule:
- cron: '0 2 * * SUN'
jobs:
build-ubuntu-dep-src:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
steps:
# https://github.com/marketplace/actions/cancel-workflow-action
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Print system information
run: lscpu
- name: Print OS information
run: lsb_release -a
- name: Install dependencies for ubuntu 18.04 and 20.04
if: matrix.os != 'ubuntu-22.04'
run: |
sudo apt-get update && sudo apt-get install -y libdc1394-22-dev
- name: Install dependencies for ubuntu 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update && sudo apt-get install -y libdc1394-dev
- name: Install common dependencies for ubuntu
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libv4l-dev gfortran liblapack-dev libeigen3-dev
sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install -y mesa-common-dev mesa-utils freeglut3-dev libflann-dev libboost-all-dev
sudo apt-get install -y nlohmann-json3-dev
- name: Install dependencies for ubuntu 22.04
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev gfortran liblapack-dev libeigen3-dev
sudo apt-get update && sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
- name: Build OpenBLAS from source
run: |
pwd
echo $GITHUB_WORKSPACE
git clone --depth 1 https://github.com/xianyi/OpenBLAS.git ${HOME}/OpenBLAS
cd ${HOME}/OpenBLAS
mkdir install
make -j$(nproc)
make -j$(nproc) install PREFIX=$(pwd)/install
echo "OpenBLAS_HOME=$(pwd)/install" >> $GITHUB_ENV
echo $OpenBLAS_HOME
- name: Build VTK from source
run: |
pwd
git clone --recursive --depth 1 https://github.com/Kitware/VTK.git ${HOME}/VTK
cd ${HOME}/VTK
mkdir build && cd build && mkdir install
cmake .. -DVTK_ANDROID_BUILD=OFF -DVTK_BUILD_DOCUMENTATION=OFF -DVTK_BUILD_EXAMPLES=OFF -DVTK_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release \
-DVTK_GROUP_ENABLE_Imaging=DONT_WANT -DVTK_GROUP_ENABLE_MPI=DONT_WANT -DVTK_GROUP_ENABLE_Web=DONT_WANT -DCMAKE_INSTALL_PREFIX=$(pwd)/install
make -j$(nproc) install
echo "VTK_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $VTK_DIR
- name: Build OpenCV from source
run: |
pwd
git clone --depth 1 https://github.com/opencv/opencv.git ${HOME}/opencv
cd ${HOME}/opencv
mkdir build && cd build && mkdir install
cmake .. -DBUILD_EXAMPLES=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
make -j$(nproc) install
echo "OpenCV_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $OpenCV_DIR
- name: Build librealsense2 from source
run: |
pwd
git clone --depth 1 https://github.com/IntelRealSense/librealsense.git ${HOME}/librealsense
cd ${HOME}/librealsense
mkdir build && cd build && mkdir install
cmake .. -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
make -j$(nproc) install
echo "REALSENSE2_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $REALSENSE2_DIR
- name: Build PCL from source
run: |
pwd
git clone --depth 1 https://github.com/PointCloudLibrary/pcl.git ${HOME}/pcl
cd ${HOME}/pcl
mkdir build && cd build && mkdir install
cmake .. -DBUILD_tools=OFF -DBUILD_global_tests=OFF -DPCL_DISABLE_GPU_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
make -j$(nproc) install
echo "PCL_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $PCL_DIR
- name: Clone visp-images
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/
run: |
git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images
echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV
echo ${VISP_INPUT_IMAGE_PATH}
- name: Configure CMake
run: |
pwd
mkdir build && cd build && mkdir install
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/install
cat ViSP-third-party.txt
- name: Compile
working-directory: build
run: |
make -j$(nproc) install
echo "VISP_DIR=$(pwd)/install" >> $GITHUB_ENV
echo $VISP_DIR
- name: Run unit tests
working-directory: build
run: ctest -j$(nproc) --output-on-failure
- name: Clone camera_localization
run: |
git clone --depth 1 https://github.com/lagadic/camera_localization ${HOME}/camera_localization
- name: Build camera_localization with ViSP as 3rdparty
run: |
cd ${HOME}/camera_localization
mkdir camera_localization-build
cd camera_localization-build
cmake ..
make -j$(nproc)
- name: Clone visp_started
run: |
git clone --depth 1 https://github.com/lagadic/visp_started ${HOME}/visp_started
- name: Build visp_started with ViSP as 3rdparty
run: |
cd ${HOME}/visp_started
mkdir visp_started-build
cd visp_started-build
cmake ..
make -j$(nproc)