-
Notifications
You must be signed in to change notification settings - Fork 286
189 lines (165 loc) · 7.39 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Ubuntu-dep-src
# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
on:
pull_request:
types: [opened, reopened, synchronize]
schedule:
- cron: '0 2 * * SUN'
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre#comment133398800_72408109
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
env:
# Function to get the most recent tag of a remote repository without having to clone it, excluding tag with 'pr' as in Pre Release
FUNCTION_GET_LATEST: 'git -c "versionsort.suffix=-" ls-remote --exit-code --refs --sort="version:refname" --tags ${GIT_ADDRESS} "*.*.*" | cut --delimiter="/" --fields=3 | grep -v -e pr | tail --lines=1'
jobs:
build-ubuntu-dep-src:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Print system information
run: lscpu
- name: Print OS information
run: lsb_release -a
- name: Install dependencies for ubuntu 20.04
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update && sudo apt-get install -y libdc1394-22-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-latest
if: matrix.os == 'ubuntu-latest'
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_ADDRESS=https://github.com/xianyi/OpenBLAS.git
LATEST_TAG=`eval ${FUNCTION_GET_LATEST}`
echo "Newest tag is ${LATEST_TAG}"
git clone --depth 1 --branch ${LATEST_TAG} ${GIT_ADDRESS} ${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
# We set GIT_CLONE_PROTECTION_ACTIVE=false to avoid the issue described in
# https://github.com/git-lfs/git-lfs/issues/5749
run: |
pwd
echo "GIT_CLONE_PROTECTION_ACTIVE=false" >> $GITHUB_ENV
export GIT_CLONE_PROTECTION_ACTIVE=false
GIT_ADDRESS="https://github.com/Kitware/VTK.git"
LATEST_TAG=`eval ${FUNCTION_GET_LATEST}`
echo "Newest tag is ${LATEST_TAG}"
git clone --recursive --depth 1 --branch ${LATEST_TAG} ${GIT_ADDRESS} ${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_ADDRESS="https://github.com/opencv/opencv.git"
LATEST_TAG=`eval ${FUNCTION_GET_LATEST}`
echo "Newest tag is ${LATEST_TAG}"
git clone --depth 1 --branch ${LATEST_TAG} ${GIT_ADDRESS} ${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_ADDRESS="https://github.com/IntelRealSense/librealsense.git"
LATEST_TAG=`eval ${FUNCTION_GET_LATEST}`
echo "Newest tag is ${LATEST_TAG}"
git clone --depth 1 --branch ${LATEST_TAG} ${GIT_ADDRESS} ${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_ADDRESS="https://github.com/PointCloudLibrary/pcl.git"
LATEST_TAG=`eval ${FUNCTION_GET_LATEST}`
echo "Newest tag is ${LATEST_TAG}"
git clone --depth 1 --branch ${LATEST_TAG} ${GIT_ADDRESS} ${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: Build visp-config script
working-directory: build
run: |
make -j$(nproc) developer_scripts
./bin/visp-config --cflags
./bin/visp-config --libs
- name: Build and install ViSP
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)