Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 31 additions & 10 deletions etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ _installORDependencies() {
YOSYS_VER=v$(grep 'yosys_ver =' tools/yosys/docs/source/conf.py | awk -F'"' '{print $2}')
fi
./tools/OpenROAD/etc/DependencyInstaller.sh ${OR_INSTALLER_ARGS} -yosys-ver="${YOSYS_VER}"
# bazelisk goes to /usr/local in the privileged step, because the -common
# prefix is not on PATH. A bare -bazel installs it and its runtime
# libraries.
if [[ "${buildSystem}" == "bazel" ]] && [[ "${option}" == "base" || "${option}" == "all" ]]; then
./tools/OpenROAD/etc/DependencyInstaller.sh -bazel
fi
Comment on lines +37 to +39

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Calling the OpenROAD DependencyInstaller.sh with only -bazel and no option flag (such as -base or -all) will cause it to fail or do nothing, because the installer requires an option to be specified. Since we are already inside a block that guards for option being base or all, we should pass the corresponding option flag to the second installer call.

Suggested change
if [[ "${buildSystem}" == "bazel" ]] && [[ "${option}" == "base" || "${option}" == "all" ]]; then
./tools/OpenROAD/etc/DependencyInstaller.sh -bazel
fi
if [[ "${buildSystem}" == "bazel" ]] && [[ "${option}" == "base" || "${option}" == "all" ]]; then
./tools/OpenROAD/etc/DependencyInstaller.sh -bazel -${option}
fi

}

_installPipCommon() {
Expand Down Expand Up @@ -337,13 +343,23 @@ Usage: $0 [-all|-base|-common] [-<ARGS>]
#
$0 -base
# Installs OpenROAD's dependencies using
# package managers, including Bazel
# (bazelisk). -common must be executed
# in another command.
# package managers. -common must be
# executed in another command.
$0 -common
# Installs OpenROAD's common dependencies
# (-base must be executed in another
# command).
$0 -bazel
# Default. Installs Bazel (bazelisk) and
# its runtime libraries with -base or
# -all. build_openroad.sh builds
# OpenROAD with Bazel.
$0 -cmake
# Skips Bazel and installs only the CMake
# dependencies. Use it to build
# OpenROAD with CMake, e.g.
# build_openroad.sh --openroad-args
# -cmake-build (deprecated upstream).
$0 -prefix=DIR
# Installs common dependencies in an existing
# user-specified directory. Only used
Expand Down Expand Up @@ -378,6 +394,8 @@ option="none"
isLocal="false"
constantBuildDir="false"
CI="no"
# OpenROAD build system to install dependencies for: bazel or cmake
buildSystem="bazel"

# default values, can be overwritten by cmdline args
while [ "$#" -gt 0 ]; do
Expand All @@ -403,6 +421,12 @@ while [ "$#" -gt 0 ]; do
fi
option="common"
;;
-bazel)
buildSystem="bazel"
;;
-cmake)
buildSystem="cmake"
;;
-local)
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -local"
;;
Expand Down Expand Up @@ -441,13 +465,10 @@ if [[ "${option}" == "none" ]]; then
_help
fi

OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -${option}"
# build_openroad.sh builds OpenROAD with Bazel, so bazelisk and its runtime
# libraries are base dependencies. They need root, and -common may run
# unprivileged, so they ride along with -base only.
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -bazel"
fi
# Yosys, EQY and kepler-formal need the OpenROAD CMake dependency set for
# both build systems. build_openroad.sh builds OpenROAD with Bazel by default,
# so _installORDependencies also installs the Bazel set unless -cmake is given.
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -cmake -${option}"

platform="$(uname -s)"
case "${platform}" in
Expand Down
2 changes: 1 addition & 1 deletion tools/OpenROAD
Submodule OpenROAD updated 769 files