From fed363d10cbed179a06d22a14d59b20501db6b2e Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Fri, 16 Oct 2026 12:36:29 -0300 Subject: [PATCH 1/9] feat(installer): add -cmake for CMake builds of OpenROAD The installer always asks the OpenROAD installer for the Bazel set. Users who build OpenROAD with CMake (build_openroad.sh --openroad-args -cmake-build) need the OpenROAD CMake set instead. -cmake passes -cmake to the OpenROAD installer. -bazel is the default. If both are given, the last one wins. On macOS, install cmake with brew. The OpenROAD installer no longer installs it for a Bazel build, and ORFS builds Yosys and kepler-formal with CMake. Signed-off-by: Vitor Bandeira --- etc/DependencyInstaller.sh | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index a9a763df86..12b572b1a1 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -371,7 +371,7 @@ _installUbuntuPackages() { _installDarwinPackages() { brew install libffi tcl-tk ruby - brew install python libomp doxygen capnp tbb bison flex boost spdlog zlib + brew install python libomp doxygen capnp tbb bison flex boost spdlog zlib cmake brew link --force libomp brew install --cask klayout brew install docker docker-buildx @@ -411,6 +411,14 @@ Usage: $0 [-all|-base|-common] [-] # Installs OpenROAD's common dependencies # (-base must be executed in another # command). + $0 -bazel + # Default. Installs the dependencies to + # build OpenROAD with Bazel. + $0 -cmake + # Installs the dependencies to build + # OpenROAD with CMake instead of Bazel, + # e.g. for build_openroad.sh + # --openroad-args -cmake-build. $0 -prefix=DIR # Installs common dependencies in an existing # user-specified directory. Only used @@ -445,6 +453,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 @@ -470,6 +480,12 @@ while [ "$#" -gt 0 ]; do fi option="common" ;; + -bazel) + buildSystem="bazel" + ;; + -cmake) + buildSystem="cmake" + ;; -local) OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -local" PREFIX="${HOME}/.local" @@ -510,10 +526,13 @@ if [[ "${option}" == "none" ]]; then 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 +# build_openroad.sh builds OpenROAD with Bazel by default. The Bazel runtime +# libraries need root, and -common may run unprivileged, so they ride along +# with -base only; -common installs bazelisk. -cmake asks for the OpenROAD +# CMake dependencies instead. +if [[ "${buildSystem}" == "cmake" ]]; then + OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -cmake" +elif [[ "${option}" == "base" || "${option}" == "all" ]]; then OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -bazel" fi From a88bd32d594a5615d6636e3d9f97ca750283dd29 Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Sun, 18 Oct 2026 19:02:46 -0300 Subject: [PATCH 2/9] fix(build): use an Arm -march for kepler-formal on aarch64 build_openroad.sh always compiles kepler-formal with -march=x86-64-v3, which Arm compilers reject, so the build fails on aarch64 hosts. Use -march=armv8-a there, the Armv8-A baseline, and keep x86-64-v3 on other hosts. Signed-off-by: Vitor Bandeira --- build_openroad.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build_openroad.sh b/build_openroad.sh index 07a4c097c2..6fc4fbf77d 100755 --- a/build_openroad.sh +++ b/build_openroad.sh @@ -418,9 +418,15 @@ __local_build() ${NICE} cmake --build tools/yosys/build --target install -j "${PROC}" echo "[INFO FLW-0031] Compiling kepler-formal" + # -march=x86-64-v3 is valid only for x86 compilers. On Arm, use the + # Armv8-A baseline, so that the binary runs on any aarch64 machine. + case "$(uname -m)" in + aarch64|arm64) KEPLER_MARCH="-march=armv8-a" ;; + *) KEPLER_MARCH="-march=x86-64-v3" ;; + esac ${NICE} cmake -B tools/kepler-formal/build tools/kepler-formal \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS_RELEASE="-Ofast -march=x86-64-v3 -ffast-math -flto" \ + -DCMAKE_CXX_FLAGS_RELEASE="-Ofast ${KEPLER_MARCH} -ffast-math -flto" \ -DCMAKE_EXE_LINKER_FLAGS="-flto" \ -DCMAKE_BUILD_RPATH="${DIR}/tools/kepler-formal/build/thirdparty/naja/src/dnl:${DIR}/tools/kepler-formal/build/thirdparty/naja/src/nl/nl:${DIR}/tools/kepler-formal/build/thirdparty/naja/src/optimization" \ -DCMAKE_INSTALL_RPATH="${INSTALL_PATH}/kepler-formal/lib" \ From 71c2f8a5379382376c7b6a927aaca8b0da770bdd Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Sun, 18 Oct 2026 20:20:07 -0300 Subject: [PATCH 3/9] fix(installer): install the EL build tools in ORFS On EL8 and EL9, ORFS relied on the OpenROAD CMake set for EPEL, pip, the compiler and the Yosys and kepler-formal build tools. The OpenROAD installer now installs that set only with -cmake, so the EL install fails: tcl-tclreadline is not found without EPEL, and pip is missing. Install EPEL and the build tools from the ORFS installer, and run the Kitware CMake step on EL too. Install Python 3.12 on EL8 and EL9, because kepler-formal and the pip lock files need Python 3.10 or newer. On EL8, install gcc-toolset-13 and enable it in build_openroad.sh, because GCC 8 is too old for kepler-formal. gtest is not installed: Yosys builds its unit tests only when gtest is found. Signed-off-by: Vitor Bandeira --- build_openroad.sh | 6 ++++++ etc/DependencyInstaller.sh | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/build_openroad.sh b/build_openroad.sh index 6fc4fbf77d..90ffd01852 100755 --- a/build_openroad.sh +++ b/build_openroad.sh @@ -385,6 +385,12 @@ __local_build() source /opt/rh/devtoolset-8/enable set -u fi + # EL8: the default GCC 8 is too old for kepler-formal. + if [[ -f "/opt/rh/gcc-toolset-13/enable" ]]; then + set +u + source /opt/rh/gcc-toolset-13/enable + set -u + fi if [ -z "${SKIP_OPENROAD+x}" ]; then echo "[INFO FLW-0018] Compiling OpenROAD." diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index 12b572b1a1..fddfc752e3 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -172,16 +172,45 @@ _install_EL8_EL9_Packages() { # EL8 and EL9 use `dnf`, instead of `yum` dnf -y update + # EPEL has tcl-tclreadline and capnproto. + dnf -y install "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${elVersion}.noarch.rpm" + # The rest builds Yosys and kepler-formal. dnf -y install \ - time \ + bison \ + boost-devel \ + capnproto \ + capnproto-devel \ + flex \ + gcc \ + gcc-c++ \ + git \ + libffi-devel \ + make \ + pkgconf-pkg-config \ + python3 \ + python3-devel \ + python3-pip \ readline \ ruby \ - ruby-devel + ruby-devel \ + tbb-devel \ + tcl-devel \ + tcllib \ + time \ + wget \ + zlib-devel + + # kepler-formal and the pip lock files need Python 3.10 or newer, which + # is newer than the EL8 and EL9 defaults. + dnf -y install python3.12 python3.12-devel python3.12-pip + update-alternatives --install /usr/bin/python3 python3 "$(command -v python3.12)" 50 if [[ "${elVersion}" == "8" ]]; then dnf -y install \ tcl-tclreadline \ tcl-tclreadline-devel + # The default GCC 8 is too old for kepler-formal. + dnf -y install gcc-toolset-13 fi if [[ "${elVersion}" == "9" ]]; then @@ -599,6 +628,7 @@ case "${os}" in esac if [[ "${option}" == "common" || "${option}" == "all" ]]; then + _installCmake _installPipCommon fi ;; From 8fda7b4133254999d3dad8222c75abd7c070451c Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Sun, 18 Oct 2026 20:27:13 -0300 Subject: [PATCH 4/9] fix(installer): select Python 3.12 on EL8 EL8 registers its Python 3.6 as the python3 alternative with a higher priority, so the install alone leaves python3 at 3.6 and the pip lock fails. Select Python 3.12 explicitly. Signed-off-by: Vitor Bandeira --- etc/DependencyInstaller.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index fddfc752e3..504a003488 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -204,6 +204,8 @@ _install_EL8_EL9_Packages() { # is newer than the EL8 and EL9 defaults. dnf -y install python3.12 python3.12-devel python3.12-pip update-alternatives --install /usr/bin/python3 python3 "$(command -v python3.12)" 50 + # EL8 registers its Python 3.6 with a higher priority, so select 3.12. + update-alternatives --set python3 "$(command -v python3.12)" if [[ "${elVersion}" == "8" ]]; then dnf -y install \ From d6f9796011e33d3621cb9151014e19570b85a7a6 Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Sun, 18 Oct 2026 20:34:48 -0300 Subject: [PATCH 5/9] fix(installer): build Bison 3.8.2 on EL when the system one is old Yosys needs Bison 3.6 or newer. EL8 ships 3.0.4, which the OpenROAD CMake set used to replace. When the Bison on PATH is older than 3.6, build the release that the OpenROAD installer uses, with the same checksum, in the -common prefix. Signed-off-by: Vitor Bandeira --- etc/DependencyInstaller.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index 504a003488..f17d6e5866 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -78,6 +78,36 @@ _installCmake() { rm -rf "${workDir}" } +# Yosys needs Bison >= 3.6, newer than EL8 ships, so build the release that +# the OpenROAD installer uses when the one on PATH is too old. +bisonMinVersion=3.6 +bisonVersion=3.8.2 +bisonChecksum=1e541a097cda9eca675d29dd2832921f + +_installBison() { + local prefix=${PREFIX:-"/usr/local"} + local current + current=$(_toolVersion "${prefix}" bison) + if _versionAtLeast "${current}" "${bisonMinVersion}"; then + echo "Bison ${current} found, skipping install" + return + fi + local tarball="bison-${bisonVersion}.tar.gz" + local workDir + workDir=$(mktemp -d) + ( + cd "${workDir}" + wget -q "https://ftp.gnu.org/gnu/bison/${tarball}" + md5sum -c <(echo "${bisonChecksum} ${tarball}") + tar xzf "${tarball}" + cd "bison-${bisonVersion}" + ./configure --prefix="${prefix}" + make -j "${numThreads}" + make install + ) + rm -rf "${workDir}" +} + _installORDependencies() { if [[ ${YOSYS_VER} == "" ]]; then YOSYS_VER=v$(grep 'yosys_ver =' tools/yosys/docs/source/conf.py | awk -F'"' '{print $2}') @@ -631,6 +661,7 @@ case "${os}" in if [[ "${option}" == "common" || "${option}" == "all" ]]; then _installCmake + _installBison _installPipCommon fi ;; From 6d86fc62d7a655c8b7caf8aa5099ad2d9572895d Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Sun, 18 Oct 2026 20:40:35 -0300 Subject: [PATCH 6/9] fix(build): allow kepler-formal to build with TBB 2020 EL9 ships TBB 2020, where concurrent_map.h is a preview feature and stops the kepler-formal build unless TBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS is set. Define it for the kepler-formal compile. oneTBB ignores the macro. Signed-off-by: Vitor Bandeira --- build_openroad.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build_openroad.sh b/build_openroad.sh index 90ffd01852..e849106929 100755 --- a/build_openroad.sh +++ b/build_openroad.sh @@ -426,13 +426,15 @@ __local_build() echo "[INFO FLW-0031] Compiling kepler-formal" # -march=x86-64-v3 is valid only for x86 compilers. On Arm, use the # Armv8-A baseline, so that the binary runs on any aarch64 machine. + # EL9 ships TBB 2020, where concurrent_map needs + # TBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS; oneTBB ignores it. case "$(uname -m)" in aarch64|arm64) KEPLER_MARCH="-march=armv8-a" ;; *) KEPLER_MARCH="-march=x86-64-v3" ;; esac ${NICE} cmake -B tools/kepler-formal/build tools/kepler-formal \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS_RELEASE="-Ofast ${KEPLER_MARCH} -ffast-math -flto" \ + -DCMAKE_CXX_FLAGS_RELEASE="-Ofast ${KEPLER_MARCH} -ffast-math -flto -DTBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS=1" \ -DCMAKE_EXE_LINKER_FLAGS="-flto" \ -DCMAKE_BUILD_RPATH="${DIR}/tools/kepler-formal/build/thirdparty/naja/src/dnl:${DIR}/tools/kepler-formal/build/thirdparty/naja/src/nl/nl:${DIR}/tools/kepler-formal/build/thirdparty/naja/src/optimization" \ -DCMAKE_INSTALL_RPATH="${INSTALL_PATH}/kepler-formal/lib" \ From 4d70b9c36aefe878aba81a3aaa30e6daa718cc8d Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Sun, 18 Oct 2026 21:02:07 -0300 Subject: [PATCH 7/9] fix(installer): build oneTBB on EL8 and add the missing EL tools kepler-formal finds TBB with its CMake package. EL8 ships TBB 2018, which has no CMake package and no oneTBB API, so build oneTBB 2021.13.0 on EL8, static because the kepler-formal RPATH does not include the prefix. Install tbb-devel only on EL9. Also install findutils, which dev_env.sh uses, and readline-devel on EL8 for the Yosys readline support. Signed-off-by: Vitor Bandeira --- etc/DependencyInstaller.sh | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index f17d6e5866..2f137a4cb8 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -108,6 +108,34 @@ _installBison() { rm -rf "${workDir}" } +# kepler-formal needs oneTBB and its CMake package. EL8 ships TBB 2018, which +# has neither, so build oneTBB there. Build it static, because the +# kepler-formal RPATH does not include the prefix. +tbbVersion=2021.13.0 +tbbChecksum=3ad5dd08954b39d113dc5b3f8a8dc6dc1fd5250032b7c491eb07aed5c94133e1 + +_installTbb() { + local prefix=${PREFIX:-"/usr/local"} + if compgen -G "${prefix}/lib*/cmake/TBB/TBBConfig.cmake" > /dev/null; then + echo "oneTBB found in ${prefix}, skipping install" + return + fi + local tarball="oneTBB-${tbbVersion}.tar.gz" + local workDir + workDir=$(mktemp -d) + ( + cd "${workDir}" + wget -q -O "${tarball}" "https://github.com/uxlfoundation/oneTBB/archive/refs/tags/v${tbbVersion}.tar.gz" + sha256sum -c <(echo "${tbbChecksum} ${tarball}") + tar xzf "${tarball}" + cmake -S "oneTBB-${tbbVersion}" -B build -DCMAKE_BUILD_TYPE=Release \ + -DTBB_TEST=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="${prefix}" + cmake --build build -j "${numThreads}" + cmake --install build + ) + rm -rf "${workDir}" +} + _installORDependencies() { if [[ ${YOSYS_VER} == "" ]]; then YOSYS_VER=v$(grep 'yosys_ver =' tools/yosys/docs/source/conf.py | awk -F'"' '{print $2}') @@ -210,6 +238,7 @@ _install_EL8_EL9_Packages() { boost-devel \ capnproto \ capnproto-devel \ + findutils \ flex \ gcc \ gcc-c++ \ @@ -223,7 +252,6 @@ _install_EL8_EL9_Packages() { readline \ ruby \ ruby-devel \ - tbb-devel \ tcl-devel \ tcllib \ time \ @@ -239,6 +267,7 @@ _install_EL8_EL9_Packages() { if [[ "${elVersion}" == "8" ]]; then dnf -y install \ + readline-devel \ tcl-tclreadline \ tcl-tclreadline-devel # The default GCC 8 is too old for kepler-formal. @@ -246,6 +275,8 @@ _install_EL8_EL9_Packages() { fi if [[ "${elVersion}" == "9" ]]; then + # EL8 builds oneTBB instead, in -common. + dnf -y install tbb-devel dnf -y install \ https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/readline-devel-8.1-4.el9.x86_64.rpm fi @@ -662,6 +693,9 @@ case "${os}" in if [[ "${option}" == "common" || "${option}" == "all" ]]; then _installCmake _installBison + if [[ "${elVersion}" == "8" ]]; then + _installTbb + fi _installPipCommon fi ;; From bf8892d624d52d98754e80eb69a313e3c7a4eb0c Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Sun, 18 Oct 2026 21:32:24 -0300 Subject: [PATCH 8/9] fix(build): install kepler-formal libraries in lib On EL, CMake installs libraries in lib64 for a prefix outside /usr, but the kepler-formal install RPATH points to lib, so the installed binary cannot find its libnaja libraries. Set CMAKE_INSTALL_LIBDIR to lib for kepler-formal. Signed-off-by: Vitor Bandeira --- build_openroad.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build_openroad.sh b/build_openroad.sh index e849106929..b6d26dc754 100755 --- a/build_openroad.sh +++ b/build_openroad.sh @@ -428,6 +428,7 @@ __local_build() # Armv8-A baseline, so that the binary runs on any aarch64 machine. # EL9 ships TBB 2020, where concurrent_map needs # TBB_PREVIEW_CONCURRENT_ORDERED_CONTAINERS; oneTBB ignores it. + # EL installs libraries in lib64 by default; the RPATH points to lib. case "$(uname -m)" in aarch64|arm64) KEPLER_MARCH="-march=armv8-a" ;; *) KEPLER_MARCH="-march=x86-64-v3" ;; @@ -438,6 +439,7 @@ __local_build() -DCMAKE_EXE_LINKER_FLAGS="-flto" \ -DCMAKE_BUILD_RPATH="${DIR}/tools/kepler-formal/build/thirdparty/naja/src/dnl:${DIR}/tools/kepler-formal/build/thirdparty/naja/src/nl/nl:${DIR}/tools/kepler-formal/build/thirdparty/naja/src/optimization" \ -DCMAKE_INSTALL_RPATH="${INSTALL_PATH}/kepler-formal/lib" \ + -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF \ -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF \ -DCMAKE_INSTALL_PREFIX="${INSTALL_PATH}/kepler-formal" From d55eaa131f982aa05e51e013b05a0854cc20a76b Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Mon, 19 Oct 2026 07:08:46 -0300 Subject: [PATCH 9/9] fix(installer): use the prefix CMake for the oneTBB build _installCmake can install CMake in a prefix that is not on PATH, for example with -prefix or -local. The oneTBB build then fails with "cmake: command not found" when the system has no CMake. Put the prefix bin directory first on PATH for the oneTBB build. Signed-off-by: Vitor Bandeira --- etc/DependencyInstaller.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index 2f137a4cb8..3b8c2ac218 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -124,6 +124,8 @@ _installTbb() { local workDir workDir=$(mktemp -d) ( + # _installCmake may have put CMake in a prefix that is not on PATH. + export PATH="${prefix}/bin:${PATH}" cd "${workDir}" wget -q -O "${tarball}" "https://github.com/uxlfoundation/oneTBB/archive/refs/tags/v${tbbVersion}.tar.gz" sha256sum -c <(echo "${tbbChecksum} ${tarball}")