Skip to content
Closed
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
34 changes: 31 additions & 3 deletions etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,17 @@ _install_EL7_CleanUp() {
yum clean -y all
}

# Build deps for yosys (compiled inside OpenROAD's installer). Must run
# before _installORDependencies, since OpenROAD no longer installs readline.
_installYosysBuildDeps_EL7() {
yum -y install readline-devel
}
Comment on lines +71 to +73

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.

medium

It is recommended to run yum -y update before installing packages to ensure the metadata is current, especially since this function is now called early in the installation process and might be the first package manager interaction.

Suggested change
_installYosysBuildDeps_EL7() {
yum -y install readline-devel
}
_installYosysBuildDeps_EL7() {
yum -y update
yum -y install readline-devel
}


# Enterprise Linux 7 package installation (EL7 = RHEL 7 or CentOS 7)
_install_EL7_Packages() {
yum -y update

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.

medium

This yum -y update call is now redundant if the update is performed in the hoisted _installYosysBuildDeps_EL7 function, which runs earlier in the same execution path.

yum -y install \
time \
readline \
ruby \
ruby-devel

Expand All @@ -95,6 +100,12 @@ _install_EL8_EL9_CleanUp() {
dnf clean -y all
}

# Build deps for yosys (compiled inside OpenROAD's installer). Must run
# before _installORDependencies, since OpenROAD no longer installs readline.
_installYosysBuildDeps_EL8_EL9() {
dnf -y install readline-devel
}
Comment on lines +105 to +107

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.

medium

Similar to the EL7 case, adding dnf -y update here ensures that the package manager has the latest metadata before attempting to install readline-devel.

Suggested change
_installYosysBuildDeps_EL8_EL9() {
dnf -y install readline-devel
}
_installYosysBuildDeps_EL8_EL9() {
dnf -y update
dnf -y install readline-devel
}


# Enterprise Linux 8/9 package installation (EL8/EL9 = RHEL, Rocky Linux, AlmaLinux, or CentOS 8 as no CentOS 9 exists)
_install_EL8_EL9_Packages() {
# Re-detect EL version for appropriate KLayout package
Expand All @@ -109,7 +120,6 @@ _install_EL8_EL9_Packages() {
dnf -y update

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.

medium

This dnf -y update call is redundant as the metadata update is now handled by the hoisted dependency installation function.

dnf -y install \
time \
readline \
ruby \
ruby-devel

Expand Down Expand Up @@ -168,6 +178,14 @@ _installKlayoutDependenciesUbuntuAarch64() {
echo "All dependencies installed successfully"
}

# Build deps for yosys (compiled inside OpenROAD's installer). Must run
# before _installORDependencies, since OpenROAD no longer installs readline.
_installYosysBuildDeps_Ubuntu() {
export DEBIAN_FRONTEND="noninteractive"
apt-get -y update
apt-get -y install --no-install-recommends libreadline-dev
}

_installUbuntuPackages() {
export DEBIAN_FRONTEND="noninteractive"
apt-get -y update
Comment on lines 190 to 191

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.

medium

The export DEBIAN_FRONTEND and apt-get -y update calls are redundant here. DEBIAN_FRONTEND was already exported in _installYosysBuildDeps_Ubuntu (or _installCI), and the package list was updated in those same functions which run earlier in the script.

Expand All @@ -188,7 +206,6 @@ _installUbuntuPackages() {
libqt5opengl5 \
libqt5svg5-dev \
libqt5xmlpatterns5-dev \
libreadline-dev \
libtbb-dev \
libz-dev \
perl \
Expand Down Expand Up @@ -456,6 +473,14 @@ case "${os}" in
exit 1
fi

# Install yosys build deps before OpenROAD's installer compiles yosys
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
case "${elVersion}" in
"7") _installYosysBuildDeps_EL7 ;;
"8"|"9") _installYosysBuildDeps_EL8_EL9 ;;
esac
fi

# First install OpenROAD base
_installORDependencies

Expand Down Expand Up @@ -494,6 +519,9 @@ case "${os}" in
echo "Installing CI Tools"
_installCI
fi
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
_installYosysBuildDeps_Ubuntu
fi
_installORDependencies
if [[ "${option}" == "base" || "${option}" == "all" ]]; then
_installUbuntuPackages "${version}"
Expand Down