66# instead use etc/DockerHelper.sh
77
88ARG fromImage = openroad /flow -ubuntu22 . 04 -dev :latest
9+ # Image holding the prebuilt tools/install of every tool except OpenROAD
10+ # (a build of the orfs-tools target). By default they are built here.
11+ ARG toolsImage = orfs -tools
912
1013FROM $fromImage AS orfs -base
1114
@@ -22,7 +25,11 @@ RUN sh /tmp/setup_compiler_wrappers.sh && rm /tmp/setup_compiler_wrappers.sh
2225# Prepend wrapper directory to PATH so they override system compilers
2326ENV PATH = "/usr/local/bin/wrapped-cc:$PATH"
2427
25- COPY --link tools tools
28+ FROM orfs -builder -base AS orfs -tools -builder
29+
30+ # Exclude install so a local build's output (e.g. tools/install/OpenROAD)
31+ # cannot leak into the image; the build below starts from an empty install.
32+ COPY --link --exclude = OpenROAD --exclude = AutoTuner --exclude = install tools tools
2633ARG numThreads = $( nproc )
2734ARG verificPath = ""
2835
3643fi
3744./build_openroad.sh --no_init \
3845 --local \
46+ --skip_openroad \
3947 --threads ${numThreads} \
4048 ${verificArgs}
41- if [ ! -x tools/install/OpenROAD/bin/openroad ]; then
42- echo "Error: tools/install/OpenROAD/bin/openroad is missing or not executable." >&2
43- exit 1
44- fi
4549if [ -n "${verificPath}" ]; then
4650 rm -rf "${verificPath}"
4751fi
4852EOF
4953
5054# Collect LICENSE files from tool source trees into the install directory so
51- # they are available in the final image. tools/OpenROAD/src/sta is excluded
52- # because it is covered by a separate commercial license agreement.
55+ # they are available in the final image.
5356RUN find /OpenROAD-flow-scripts/tools \( -name "*LICENSE*" -o -name "*LICENSES*" \) \
54- | grep -v '/OpenROAD/src/sta/' \
55- | grep -v '/AutoTuner/' \
5657 | grep -v '^/OpenROAD-flow-scripts/tools/install/' \
5758 | while IFS = read -r f ; do \
5859 rel = "${f#/OpenROAD-flow-scripts/tools/}" ; \
5960 mkdir -p "/OpenROAD-flow-scripts/tools/install/licenses/$(dirname " $rel")" ; \
6061 cp -r "$f" "/OpenROAD-flow-scripts/tools/install/licenses/$rel" ; \
6162 done
6263
64+ # Yosys, kepler-formal and their licenses, without sources or build trees.
65+ FROM orfs -base AS orfs -tools
66+
67+ COPY --link --from = orfs -tools -builder /OpenROAD -flow -scripts /tools /install tools /install
68+
69+ FROM $toolsImage AS tools
70+
71+ FROM orfs -builder -base AS orfs -openroad -builder
72+
73+ COPY --link --from = tools /OpenROAD -flow -scripts /tools /install tools /install
74+ COPY --link tools /OpenROAD tools /OpenROAD
75+ ARG numThreads = $( nproc )
76+
77+ RUN <<EOF
78+ set -e
79+ ./build_openroad.sh --no_init \
80+ --local \
81+ --openroad_only \
82+ --threads ${numThreads}
83+ if [ ! -x tools/install/OpenROAD/bin/openroad ]; then
84+ echo "Error: tools/install/OpenROAD/bin/openroad is missing or not executable." >&2
85+ exit 1
86+ fi
87+ EOF
88+
89+ # tools/OpenROAD/src/sta is excluded because it is covered by a separate
90+ # commercial license agreement.
91+ RUN find /OpenROAD-flow-scripts/tools /OpenROAD \( -name "*LICENSE*" -o -name "*LICENSES*" \) \
92+ | grep -v '/OpenROAD/src/sta/' \
93+ | while IFS = read -r f ; do \
94+ rel = "${f#/OpenROAD-flow-scripts/tools/}" ; \
95+ mkdir -p "/OpenROAD-flow-scripts/tools/install/licenses/$(dirname " $rel")" ; \
96+ cp -r "$f" "/OpenROAD-flow-scripts/tools/install/licenses/$rel" ; \
97+ done
98+
6399FROM orfs -base
64100
65101# The order for copying the directories is based on the frequency of changes (ascending order),
@@ -74,7 +110,7 @@ COPY --link flow/scripts flow/scripts
74110COPY --link flow /designs flow /designs
75111COPY --link tools /AutoTuner tools /AutoTuner
76112
77- COPY --link --from = orfs -builder - base /OpenROAD -flow -scripts /tools /install tools /install
113+ COPY --link --from = orfs -openroad - builder /OpenROAD -flow -scripts /tools /install tools /install
78114COPY --link \
79115 --exclude = . git * --exclude = tools / --exclude = docs / --exclude = docker / \
80116 --exclude = flow /designs --exclude = flow /platforms --exclude = flow /scripts \
0 commit comments