-
-
Notifications
You must be signed in to change notification settings - Fork 872
Expand file tree
/
Copy pathfetch.sh
More file actions
executable file
·129 lines (110 loc) · 4.61 KB
/
fetch.sh
File metadata and controls
executable file
·129 lines (110 loc) · 4.61 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
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
#!/bin/bash
# Download as many external dependencies as possible to minimise
# the amount of repeated downloads when building Docker images.
#
# Downloaded files are stored in 'dl/' at the top of the AliceVision
# source tree and copied into the Docker environments at image build time.
set -e
test -e docker/fetch.sh || {
echo "This script must be run from the top level of the AliceVision tree"
exit 1
}
# ---------------------------------------------------------------------------
# Static assets
# ---------------------------------------------------------------------------
test -d dl || mkdir dl
test -f dl/vlfeat_K80L3.SIFT.tree || \
wget https://gitlab.com/alicevision/trainedVocabularyTreeData/raw/master/vlfeat_K80L3.SIFT.tree \
-O dl/vlfeat_K80L3.SIFT.tree
test -f dl/sphereDetection_Mask-RCNN.onnx || \
wget https://gitlab.com/alicevision/SphereDetectionModel/-/raw/main/sphereDetection_Mask-RCNN.onnx \
-O dl/sphereDetection_Mask-RCNN.onnx
test -f dl/fcn_resnet50.onnx || \
wget https://gitlab.com/alicevision/semanticSegmentationModel/-/raw/main/fcn_resnet50.onnx \
-O dl/fcn_resnet50.onnx
if [ ! -d dl/ColorChartDetectionModel ]; then
git clone --depth=1 --branch=main \
https://gitlab.com/alicevision/ColorchartDetectionModel.git \
dl/ColorChartDetectionModel
rm -f dl/ColorChartDetectionModel/README.md
rm -rf dl/ColorChartDetectionModel/.git
fi
# CMake tarball (used inside the Docker image build)
#CMAKE_VERSION=3.26.0
#CMAKE_VERSION_MM=3.26
#test -f dl/cmake-${CMAKE_VERSION}.tar.gz || \
# wget https://cmake.org/files/v${CMAKE_VERSION_MM}/cmake-${CMAKE_VERSION}.tar.gz \
# -O dl/cmake-${CMAKE_VERSION}.tar.gz
# ---------------------------------------------------------------------------
# Dependency pre-fetch
# ---------------------------------------------------------------------------
test -d dl/deps || mkdir dl/deps
# Build dir for the configure-only pass
FETCH_BUILD=build-fetch
if [ ! -d "${FETCH_BUILD}" ]; then
mkdir -p "${FETCH_BUILD}/external"
# Symlink download cache into the expected ExternalProject download dir
ln -s "$(pwd)/dl/deps" "${FETCH_BUILD}/external/download"
fi
pushd "${FETCH_BUILD}"
# Configure only — no build, just generate the stamp/download scripts
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DALICEVISION_BUILD_DEPENDENCIES:BOOL=ON \
-DAV_BUILD_ALICEVISION:BOOL=OFF
# ---------------------------------------------------------------------------
# URL-based deps → download-<dep>.cmake (under external/src/<dep>-stamp/)
# ---------------------------------------------------------------------------
# NOTE: stamp dir is now external/src/<dep>-stamp/ (aligned with BUILD_DIR
# prefix in av_add_cmake_dep). Git-based deps do NOT have a download-*.cmake
# — they use gitclone-*.cmake instead and are handled separately below.
# ---------------------------------------------------------------------------
for dep in \
alembic \
assimp \
boost \
eigen \
ffmpeg \
geogram \
gmp \
lapack \
mpfr \
openexr \
openimageio \
png \
suitesparse \
tbb \
turbojpeg \
onnxruntime \
usd
do
STAMP="external/src/${dep}-stamp/download-${dep}.cmake"
if [ -f "${STAMP}" ]; then
cmake -P "${STAMP}"
else
echo "WARNING: ${STAMP} not found — skipping ${dep}"
fi
done
# OpenCV lives under a different prefix (legacy layout kept as-is)
if [ -f "opencv-prefix/src/opencv-stamp/download-opencv.cmake" ]; then
cmake -P "opencv-prefix/src/opencv-stamp/download-opencv.cmake"
else
echo "WARNING: opencv download script not found — skipping opencv"
fi
if [ -f "opencv_contrib-prefix/src/opencv_contrib-stamp/download-opencv_contrib.cmake" ]; then
cmake -P "opencv_contrib-prefix/src/opencv_contrib-stamp/download-opencv_contrib.cmake"
else
echo "WARNING: opencv_contrib download script not found — skipping opencv_contrib"
fi
# ---------------------------------------------------------------------------
# Git-based deps → gitclone-<dep>.cmake (no download-*.cmake for these)
# ---------------------------------------------------------------------------
# tiff, ceres, expat, pybind11, lemon, coinutils, osi, clp, flann,
# nanoflann, libraw, vpx, opencolorio, e57format, popsift, cctag, apriltag
# These are cloned (shallow) at build time; nothing to pre-fetch here unless
# you want to mirror them — comment in as needed.
# ---------------------------------------------------------------------------
# cmake -P "external/src/tiff-stamp/gitclone-tiff.cmake"
# cmake -P "external/src/ceres-stamp/gitclone-ceres.cmake"
popd
rm -rf "${FETCH_BUILD}"