File tree Expand file tree Collapse file tree 4 files changed +29
-3
lines changed
Expand file tree Collapse file tree 4 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ COPY --link tools tools
1919ARG numThreads=$(nproc)
2020
2121RUN echo "" > tools/yosys /abc /. gitcommit && \
22+ env CFLAGS = "-D__TIME__=0 -D__DATE__=0 -D__TIMESTAMP__=0 -Wno-builtin-macro-redefined" \
23+ CXXFLAGS = "-D__TIME__=0 -D__DATE__=0 -D__TIMESTAMP__=0 -Wno-builtin-macro-redefined" \
2224 . /build_openroad . sh --no_init --local --threads ${ numThreads }
2325
2426FROM orfs -base
Original file line number Diff line number Diff line change @@ -13,8 +13,11 @@ COPY InstallerOpenROAD.sh \
1313 /tmp/installer/tools/OpenROAD/etc/DependencyInstaller.sh
1414
1515ARG options=""
16+ ARG constantBuildDir="-constant-build-dir"
1617
17- RUN ./DependencyInstaller.sh $options \
18+ RUN env CFLAGS="-D__TIME__=0 -D__DATE__=0 -D__TIMESTAMP__=0 -Wno-builtin-macro-redefined" \
19+ CXXFLAGS="-D__TIME__=0 -D__DATE__=0 -D__TIMESTAMP__=0 -Wno-builtin-macro-redefined" \
20+ ./DependencyInstaller.sh $options $constantBuildDir \
1821 && rm -rf /tmp/installer /tmp/* /var/tmp/* /var/lib/apt/lists/*
1922
2023ARG fromImage
Original file line number Diff line number Diff line change @@ -36,7 +36,15 @@ _installCommon() {
3636 pip3 install --no-cache-dir --user -U $pkgs
3737 fi
3838
39- baseDir=$( mktemp -d /tmp/DependencyInstaller-orfs-XXXXXX)
39+ if [[ " $constantBuildDir " == " true" ]]; then
40+ baseDir=" /tmp/DependencyInstaller-ORFS"
41+ if [[ -d " $baseDir " ]]; then
42+ echo " [INFO] Removing old building directory $baseDir "
43+ fi
44+ mkdir -p " $baseDir "
45+ else
46+ baseDir=$( mktemp -d /tmp/DependencyInstaller-orfs-XXXXXX)
47+ fi
4048
4149 # Install Verilator
4250 verilatorPrefix=` realpath ${PREFIX:- " /usr/local" } `
@@ -239,6 +247,9 @@ Usage: $0
239247 # sudo or with root access.
240248 $0 -ci
241249 # Installs CI tools
250+ $0 -constant-build-dir
251+ # Use constant build directory, instead of
252+ # random one.
242253EOF
243254 exit " ${1:- 1} "
244255}
@@ -251,6 +262,7 @@ PREFIX=""
251262option=" all"
252263# default isLocal
253264isLocal=" false"
265+ constantBuildDir=" false"
254266CI=" no"
255267
256268# default values, can be overwritten by cmdline args
@@ -284,6 +296,10 @@ while [ "$#" -gt 0 ]; do
284296 OR_INSTALLER_ARGS=" ${OR_INSTALLER_ARGS} $1 "
285297 PREFIX=${1#* =}
286298 ;;
299+ -constant-build-dir)
300+ OR_INSTALLER_ARGS=" ${OR_INSTALLER_ARGS} $1 "
301+ constantBuildDir=" true"
302+ ;;
287303 * )
288304 echo " unknown option: ${1} " >&2
289305 _help
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ baseDir="$(pwd)"
99org=openroad
1010
1111DOCKER_CMD=" docker"
12+ noConstantBuildDir=" "
1213
1314_help () {
1415 cat << EOF
@@ -32,6 +33,7 @@ usage: $0 [CMD] [OPTIONS]
3233 -password=PASSWORD Password to loging at the docker registry.
3334 -ci Install CI tools in image
3435 -dry-run Do not push images to the repository
36+ -no-constant-build-dir Do not use constant build directory
3537 -h -help Show this message and exits
3638
3739EOF
@@ -67,7 +69,7 @@ _setup() {
6769 fromImage=" ${FROM_IMAGE_OVERRIDE:- $osBaseImage } "
6870 cp tools/OpenROAD/etc/DependencyInstaller.sh etc/InstallerOpenROAD.sh
6971 context=" etc"
70- buildArgs=" --build-arg options=${options} "
72+ buildArgs=" --build-arg options=${options} ${noConstantBuildDir} "
7173 ;;
7274 * )
7375 echo " Target ${target} not found" >&2
@@ -202,6 +204,9 @@ while [ "$#" -gt 0 ]; do
202204 -tag=* )
203205 tag=" ${1#* =} "
204206 ;;
207+ -no-constant-build-dir )
208+ noConstantBuildDir=" --build-arg constantBuildDir= "
209+ ;;
205210 -os | -target | -threads | -username | -password | -tag )
206211 echo " ${1} requires an argument" >&2
207212 _help
You can’t perform that action at this time.
0 commit comments