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
14 changes: 7 additions & 7 deletions docs/user/BuildWithPrebuilt.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Using Pre-built Binaries

## Install Klayout and Yosys
Please ensure the Klayout version (denoted with `klayoutVersion` variable) is consistent with the one used in [DependencyInstaller script](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/etc/DependencyInstaller.sh).
## Install KLayout and Yosys
The GDS file, DRC and LVS use KLayout's Python module, installed with the
other Python packages from `etc/requirements-common_lock.txt`, or alone
with `pip install klayout`. The KLayout application is needed only for a
deprecated Ruby DRC/LVS deck (see [KLayoutPythonDecks.md](KLayoutPythonDecks.md)),
the gallery and the viewers:
[KLayout](https://www.klayout.de/build.html).

Instructions for installing:
- [Klayout>=0.28.8](https://www.klayout.de/build.html)
- [Yosys>=0.58](https://github.com/YosysHQ/oss-cad-suite-build/blob/master/README.md#installation)

## Install OpenROAD
Expand Down Expand Up @@ -44,9 +47,6 @@ Export path variables accordingly.
export OPENROAD_EXE=$(command -v openroad)
export YOSYS_EXE=$(command -v yosys)

# only if KLayout is built from source
export LD_LIBRARY_PATH="<klayout_location>/bin:$PATH"

yosys -help
yosys -m slang -p "slang_version"
openroad -help
Expand Down
1 change: 0 additions & 1 deletion env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function __setpaths() {
export PATH=${DIR}/tools/install/kepler-formal/bin:$PATH

if [[ "$OSTYPE" == "darwin"* ]]; then
export PATH="/Applications/KLayout/klayout.app/Contents/MacOS:$PATH"
export PATH="$(brew --prefix bison)/bin:$(brew --prefix flex)/bin:$(brew --prefix tcl-tk@8)/bin:$PATH"
export QT_QPA_PLATFORM=cocoa
fi
Expand Down
109 changes: 4 additions & 105 deletions etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ fi
# Make sure we are on the correct folder before beginning
cd "${_script_dir}/../"

# package versions
klayoutVersion=0.30.12
if [[ "$OSTYPE" == "darwin"* ]]; then
numThreads=$(sysctl -n hw.logicalcpu)
else
Expand Down Expand Up @@ -203,19 +201,6 @@ _install_EL7_Packages() {
ruby-devel \
tcl-tclreadline \
tcl-tclreadline-devel

if ! [ -x "$(command -v klayout)" ]; then
yum -y install https://www.klayout.org/downloads/CentOS_7/klayout-${klayoutVersion}-0.x86_64.rpm
else
currentVersion=$(klayout -v | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
if _versionCompare $currentVersion -ge $klayoutVersion; then
echo "KLayout version greater than or equal to ${klayoutVersion}"
else
echo "KLayout version less than ${klayoutVersion}"
sudo yum remove -y klayout
yum -y install https://www.klayout.org/downloads/CentOS_7/klayout-${klayoutVersion}-0.x86_64.rpm
fi
fi
}


Expand All @@ -226,7 +211,7 @@ _install_EL8_EL9_CleanUp() {

# 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
# Re-detect EL version
if [[ -f /etc/os-release ]]; then
elVersion=$(awk -F= '/^VERSION_ID/{print $2}' /etc/os-release | sed 's/"//g' | cut -d. -f1)
else
Expand Down Expand Up @@ -286,62 +271,13 @@ _install_EL8_EL9_Packages() {
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

# Install KLayout based on EL version, note the different URLs
case "${elVersion}" in
"8")
if ! [ -x "$(command -v klayout)" ]; then
dnf -y install https://www.klayout.org/downloads/CentOS_8/klayout-${klayoutVersion}-0.x86_64.rpm
else
currentVersion=$(klayout -v | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
if _versionCompare "$currentVersion" -ge $klayoutVersion; then
echo "KLayout version greater than or equal to ${klayoutVersion}"
else
echo "KLayout version less than ${klayoutVersion}"
sudo dnf remove -y klayout
dnf -y install https://www.klayout.org/downloads/CentOS_8/klayout-${klayoutVersion}-0.x86_64.rpm
fi
fi
;;
"9")
if ! [ -x "$(command -v klayout)" ]; then
dnf -y install https://www.klayout.org/downloads/RockyLinux_9/klayout-${klayoutVersion}-0.x86_64.rpm
else
currentVersion=$(klayout -v | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
if _versionCompare "$currentVersion" -ge $klayoutVersion; then
echo "KLayout version greater than or equal to ${klayoutVersion}"
else
echo "KLayout version less than ${klayoutVersion}"
sudo dnf remove -y klayout
dnf -y install https://www.klayout.org/downloads/RockyLinux_9/klayout-${klayoutVersion}-0.x86_64.rpm
fi
fi
;;
*)
echo "ERROR: Unsupported Enterprise Linux version: ${elVersion}"
exit 1
;;
esac
}

_installUbuntuCleanUp() {
apt-get autoclean -y
apt-get autoremove -y
}

_installKlayoutDependenciesUbuntuAarch64() {
echo "Installing Klayout dependencies"
export DEBIAN_FRONTEND=noninteractive
apt-get -y update
apt-get -y install build-essential \
qtbase5-dev qttools5-dev libqt5xmlpatterns5-dev qtmultimedia5-dev libqt5multimediawidgets5 libqt5svg5-dev \
ruby ruby-dev \
python3 python3-dev \
libz-dev\
libgit2-dev
echo "All dependencies installed successfully"
}

_installUbuntuPackages() {
export DEBIAN_FRONTEND="noninteractive"
apt-get -y update
Expand Down Expand Up @@ -399,44 +335,8 @@ _installUbuntuPackages() {
fi
apt-get install -y --no-install-recommends ${packages[@]}

# install KLayout
if [[ $1 == "rodete" ]]; then
apt-get -y install --no-install-recommends klayout python3-pandas
else
arch=$(uname -m)
lastDir="$(pwd)"
# temp dir to download and compile
baseDir=/tmp/installers
klayoutPrefix=${PREFIX:-"/usr/local"}
mkdir -p "${baseDir}"
cd "${baseDir}"
if [[ $arch == "aarch64" ]]; then
if [ ! -f ${klayoutPrefix}/klayout ]; then
_installKlayoutDependenciesUbuntuAarch64
echo "Installing KLayout for aarch64 architecture"
git clone --depth=1 -b "v${klayoutVersion}" https://github.com/KLayout/klayout.git
cd klayout
./build.sh -bin "${klayoutPrefix}" -option -j "${numThreads}"
else
echo "Klayout is already installed"
fi
else
if [[ $1 == 22.04 ]]; then
klayoutChecksum=6dfffa50f385881768dee30bdc759608
elif [[ $1 == 24.04 ]]; then
klayoutChecksum=0181713e60891e461d6d1664c1b8e213
elif [[ $1 == 26.04 ]]; then
klayoutChecksum=904f60fd05c3a5029cab8a2840029f49
else
echo "Unsupported Ubuntu version $1. KLayout ${klayoutVersion} packages are pinned for 22.04, 24.04, and 26.04. Please upgrade to a supported LTS release or install KLayout ${klayoutVersion} manually from https://www.klayout.org/build.html"
exit 1
fi
wget https://www.klayout.org/downloads/Ubuntu-${1%.*}/klayout_${klayoutVersion}-1_amd64.deb
md5sum -c <(echo "${klayoutChecksum} klayout_${klayoutVersion}-1_amd64.deb") || exit 1
dpkg -i klayout_${klayoutVersion}-1_amd64.deb
fi
cd "${lastDir}"
rm -rf "${baseDir}"
if [[ $1 == "rodete" ]]; then
apt-get -y install --no-install-recommends python3-pandas
fi

if command -v docker &> /dev/null; then
Expand Down Expand Up @@ -473,7 +373,6 @@ _installDarwinPackages() {
brew install libffi tcl-tk ruby
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
}

Expand Down Expand Up @@ -676,7 +575,7 @@ case "${os}" in
# First install OpenROAD base
_installORDependencies

# Determine between EL7 vs EL8/9, since yum vs dnf should be used, and different Klayout builds exist
# Determine between EL7 vs EL8/9, since yum vs dnf should be used
case "${elVersion}" in
"7")
# EL7 = RHEL 7 or CentOS 7
Expand Down
13 changes: 1 addition & 12 deletions flow/scripts/variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,11 @@ export YOSYS_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys)

YOSYS_IS_VALID := $(if $(YOSYS_EXE),$(shell test -x $(YOSYS_EXE) && echo "true"),)

# Use locally installed and built klayout if it exists, otherwise use klayout in path
KLAYOUT_DIR = $(abspath $(FLOW_HOME)/../tools/install/klayout/)
KLAYOUT_BIN_FROM_DIR = $(KLAYOUT_DIR)/klayout

KEPLER_FORMAL_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/kepler-formal/bin/kepler-formal)
export KEPLER_FORMAL_EXE

ifeq ($(wildcard $(KLAYOUT_BIN_FROM_DIR)), $(KLAYOUT_BIN_FROM_DIR))
KLAYOUT_CMD ?= sh -c 'LD_LIBRARY_PATH=$(dir $(KLAYOUT_BIN_FROM_DIR)) $$0 "$$@"' $(KLAYOUT_BIN_FROM_DIR)
else
ifeq ($(KLAYOUT_CMD),)
KLAYOUT_CMD ?= $(shell command -v klayout)
endif
endif

export KLAYOUT_CMD := $(KLAYOUT_CMD)
export KLAYOUT_CMD
Comment thread
oharboe marked this conversation as resolved.
Resolved

#-------------------------------------------------------------------------------
WRAPPED_LEFS = $(foreach lef,$(notdir $(WRAP_LEFS)),$(OBJECTS_DIR)/lef/$(lef:.lef=_mod.lef))
Expand Down