@@ -157,6 +157,28 @@ _verify_checksum() {
157157 _execute " Verifying ${filename} checksum..." bash -c " echo '${checksum} ${filename} ' | md5sum --quiet -c -"
158158}
159159
160+ # ------------------------------------------------------------------------------
161+ # Yosys build dependencies
162+ # ------------------------------------------------------------------------------
163+ # OpenROAD itself uses vendored linenoise, so readline is no longer in the
164+ # base package lists. Yosys still requires it at compile time, so install it
165+ # here right before the yosys build.
166+ _install_yosys_dependencies () {
167+ if _command_exists " apt-get" ; then
168+ export DEBIAN_FRONTEND=" noninteractive"
169+ _execute " Installing libreadline-dev for yosys..." \
170+ apt-get -y install --no-install-recommends libreadline-dev
171+ elif _command_exists " yum" ; then
172+ _execute " Installing readline-devel for yosys..." \
173+ yum -y install readline-devel
174+ elif _command_exists " zypper" ; then
175+ _execute " Installing readline-devel for yosys..." \
176+ zypper -n install readline-devel
177+ elif [[ " $OSTYPE " == " darwin" * ]]; then
178+ _execute " Installing readline for yosys..." brew install readline
179+ fi
180+ }
181+
160182# ------------------------------------------------------------------------------
161183# Yosys
162184# ------------------------------------------------------------------------------
@@ -173,6 +195,7 @@ _install_yosys() {
173195 local required_version=" ${YOSYS_VERSION# v} "
174196 log " Checking Yosys (System: ${yosys_installed_version} , Required: ${required_version} )"
175197 if [[ " ${yosys_installed_version} " != " ${required_version} " ]]; then
198+ _install_yosys_dependencies
176199 (
177200 cd " ${BASE_DIR} "
178201 _execute " Cloning Yosys ${YOSYS_VERSION} ..." git clone --depth=1 -b " ${YOSYS_VERSION} " --recursive https://github.com/YosysHQ/yosys
0 commit comments