-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
127 lines (112 loc) · 5.22 KB
/
Dockerfile
File metadata and controls
127 lines (112 loc) · 5.22 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
# Copyright (c) 2023 John Buonagurio <jbuonagurio@exponent.com>
FROM alpine:latest as build
LABEL description="CDM Build Container"
RUN apk update && apk add --no-cache binutils cmake make libgcc musl-dev gcc g++ ninja git
RUN git clone --branch v3.8.2 https://bitbucket.org/blaze-lib/blaze.git /tmp/blaze \
&& cmake -S /tmp/blaze -B /tmp/blaze-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_LAPACK=Off \
-DBLAZE_SHARED_MEMORY_PARALLELIZATION=Off \
&& cmake --install /tmp/blaze-build \
&& rm -rf /tmp/blaze && rm -rf /tmp/blaze-build
RUN git clone --branch v1.77-standalone https://github.com/boostorg/math.git /tmp/boost-math \
&& cp -R /tmp/boost-math/include/* /usr/local/include \
&& rm -rf /tmp/boost-math
RUN git clone --branch 10.1.1 https://github.com/fmtlib/fmt.git /tmp/fmt \
&& cmake -S /tmp/fmt -B /tmp/fmt-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=Off \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-DCMAKE_C_VISIBILITY_PRESET="hidden" \
-DCMAKE_CXX_VISIBILITY_PRESET="hidden" \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=On \
&& cmake --build /tmp/fmt-build \
&& cmake --install /tmp/fmt-build \
&& rm -rf /tmp/fmt && rm -rf /tmp/fmt-build
RUN git clone --branch v3.11.3 https://github.com/nlohmann/json.git /tmp/nlohmann-json \
&& cmake -S /tmp/nlohmann-json -B /tmp/nlohmann-json-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DJSON_MultipleHeaders=On \
&& cmake --install /tmp/nlohmann-json-build \
&& rm -rf /tmp/nlohmann-json && rm -rf /tmp/nlohmann-json-build
RUN git clone --branch v2.2.2 https://github.com/gflags/gflags.git /tmp/gflags \
&& cmake -S /tmp/gflags -B /tmp/gflags-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=Off \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-DCMAKE_C_VISIBILITY_PRESET="hidden" \
-DCMAKE_CXX_VISIBILITY_PRESET="hidden" \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=On \
&& cmake --build /tmp/gflags-build \
&& cmake --install /tmp/gflags-build \
&& rm -rf /tmp/gflags && rm -rf /tmp/gflags-build
RUN git clone --branch v0.6.0 https://github.com/google/glog.git /tmp/glog \
&& cmake -S /tmp/glog -B /tmp/glog-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=Off \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-DCMAKE_C_VISIBILITY_PRESET="hidden" \
-DCMAKE_CXX_VISIBILITY_PRESET="hidden" \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=On \
&& cmake --build /tmp/glog-build \
&& cmake --install /tmp/glog-build \
&& rm -rf /tmp/glog && rm -rf /tmp/glog-build
RUN git clone --branch 3.4.0 https://gitlab.com/libeigen/eigen.git /tmp/eigen \
&& cmake -S /tmp/eigen -B /tmp/eigen-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
&& cmake --install /tmp/eigen-build \
&& rm -rf /tmp/eigen && rm -rf /tmp/eigen-build
RUN git clone --branch 2.1.0 https://github.com/ceres-solver/ceres-solver.git /tmp/ceres \
&& cmake -S /tmp/ceres -B /tmp/ceres-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=Off \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-DCMAKE_C_VISIBILITY_PRESET="hidden" \
-DCMAKE_CXX_VISIBILITY_PRESET="hidden" \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=On \
-DBUILD_BENCHMARKS=Off \
-DBUILD_DOCUMENTATION=Off \
-DBUILD_EXAMPLES=Off \
-DBUILD_TESTING=Off \
-DSCHUR_SPECIALIZATIONS=Off \
&& cmake --build /tmp/ceres-build \
&& cmake --install /tmp/ceres-build \
&& rm -rf /tmp/ceres && rm -rf /tmp/ceres-build
RUN git clone --branch v6.6.2 https://github.com/LLNL/sundials.git /tmp/sundials \
&& cmake -S /tmp/sundials -B /tmp/sundials-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=Off \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-DCMAKE_C_VISIBILITY_PRESET="hidden" \
-DCMAKE_CXX_VISIBILITY_PRESET="hidden" \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=On \
-DEXAMPLES_ENABLE_C=Off \
-DEXAMPLES_ENABLE_CXX=Off \
-DEXAMPLES_INSTALL=Off \
-DBUILD_ARKODE=Off \
-DBUILD_CVODE=On \
-DBUILD_CVODES=Off \
-DBUILD_IDA=Off \
-DBUILD_IDAS=Off \
-DBUILD_KINSOL=Off \
&& cmake --build /tmp/sundials-build \
&& cmake --install /tmp/sundials-build \
&& rm -rf /tmp/sundials && rm -rf /tmp/sundials-build
# Static Build
WORKDIR /src
COPY . .
RUN cmake -B /build -S /src -G Ninja \
-DVCPKG_MANIFEST_MODE=Off \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=Off \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-DCMAKE_EXE_LINKER_FLAGS="-static" \
-DCMAKE_VERBOSE_MAKEFILE=On \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DCMAKE_SKIP_RPATH=On \
&& cmake --build /build \
&& cmake --install /build
WORKDIR /build
RUN cpack -G TGZ -C Release
FROM scratch as artifact
COPY --from=build /build/cdm-*-Linux.tar.gz .