From 80ab993577e9521538b80b87bb01591cb01d1ba2 Mon Sep 17 00:00:00 2001 From: SombraSoft Date: Wed, 20 May 2026 23:18:49 +0000 Subject: [PATCH 1/2] etc: install readline as a yosys build dep Add _install_yosys_dependencies() that installs the OS-appropriate readline development package (libreadline-dev on Debian/Ubuntu, readline-devel on RHEL/openSUSE, readline brew formula on Darwin) and call it from inside _install_yosys right before the git clone / make. OpenROAD itself uses vendored linenoise so readline is no longer in the base package lists, but _install_yosys still requires the headers at compile time. This co-locates the dep with its consumer instead of relying on downstream callers to add readline to their own package lists. Signed-off-by: SombraSoft --- etc/DependencyInstaller.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index 23cf9832569..cccc67a7083 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -157,6 +157,33 @@ _verify_checksum() { _execute "Verifying ${filename} checksum..." bash -c "echo '${checksum} ${filename}' | md5sum --quiet -c -" } +# ------------------------------------------------------------------------------ +# Yosys build dependencies +# ------------------------------------------------------------------------------ +# OpenROAD itself uses vendored linenoise, so readline is no longer in the +# base package lists. Yosys still requires it at compile time, so install it +# here right before the yosys build. +_install_yosys_dependencies() { + case "${os}" in + "Ubuntu" | "Debian GNU/Linux" | "Debian GNU/Linux rodete") + export DEBIAN_FRONTEND="noninteractive" + _execute "Installing libreadline-dev for yosys..." \ + apt-get -y install --no-install-recommends libreadline-dev + ;; + "Red Hat Enterprise Linux" | "Rocky Linux" | "AlmaLinux") + _execute "Installing readline-devel for yosys..." \ + dnf -y install readline-devel + ;; + "openSUSE Leap") + _execute "Installing readline-devel for yosys..." \ + zypper -n install readline-devel + ;; + "Darwin") + _execute "Installing readline for yosys..." brew install readline + ;; + esac +} + # ------------------------------------------------------------------------------ # Yosys # ------------------------------------------------------------------------------ @@ -173,6 +200,7 @@ _install_yosys() { local required_version="${YOSYS_VERSION#v}" log "Checking Yosys (System: ${yosys_installed_version}, Required: ${required_version})" if [[ "${yosys_installed_version}" != "${required_version}" ]]; then + _install_yosys_dependencies ( cd "${BASE_DIR}" _execute "Cloning Yosys ${YOSYS_VERSION}..." git clone --depth=1 -b "${YOSYS_VERSION}" --recursive https://github.com/YosysHQ/yosys From e7dc61397bd6176ec50646b8348f087c1f2ec200 Mon Sep 17 00:00:00 2001 From: SombraSoft Date: Thu, 21 May 2026 01:40:17 +0000 Subject: [PATCH 2/2] Use _command_exists dispatch for yosys readline deps Refactor _install_yosys_dependencies to use _command_exists for package manager detection (matching _install_bazel's pattern) and switch from dnf to yum on RHEL paths (matching _install_rhel_packages and the rest of the script). Removes the implicit dependency on the dynamically scoped ${os} variable. Signed-off-by: SombraSoft --- etc/DependencyInstaller.sh | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index cccc67a7083..e39ed49096c 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -164,24 +164,19 @@ _verify_checksum() { # base package lists. Yosys still requires it at compile time, so install it # here right before the yosys build. _install_yosys_dependencies() { - case "${os}" in - "Ubuntu" | "Debian GNU/Linux" | "Debian GNU/Linux rodete") - export DEBIAN_FRONTEND="noninteractive" - _execute "Installing libreadline-dev for yosys..." \ - apt-get -y install --no-install-recommends libreadline-dev - ;; - "Red Hat Enterprise Linux" | "Rocky Linux" | "AlmaLinux") - _execute "Installing readline-devel for yosys..." \ - dnf -y install readline-devel - ;; - "openSUSE Leap") - _execute "Installing readline-devel for yosys..." \ - zypper -n install readline-devel - ;; - "Darwin") - _execute "Installing readline for yosys..." brew install readline - ;; - esac + if _command_exists "apt-get"; then + export DEBIAN_FRONTEND="noninteractive" + _execute "Installing libreadline-dev for yosys..." \ + apt-get -y install --no-install-recommends libreadline-dev + elif _command_exists "yum"; then + _execute "Installing readline-devel for yosys..." \ + yum -y install readline-devel + elif _command_exists "zypper"; then + _execute "Installing readline-devel for yosys..." \ + zypper -n install readline-devel + elif [[ "$OSTYPE" == "darwin"* ]]; then + _execute "Installing readline for yosys..." brew install readline + fi } # ------------------------------------------------------------------------------