Skip to content

Commit c27524a

Browse files
oharboeclaude
andcommitted
installer: no KLayout application
The flow writes its GDS file and runs its DRC and LVS decks with KLayout's Python module, from the installer's Python packages, so the installer no longer installs the KLayout application. Deleted: - etc/DependencyInstaller.sh: klayoutVersion, and the KLayout install for each OS: the CentOS 7, CentOS 8 and Rocky Linux 9 RPMs with their version check and reinstall, the Ubuntu .deb with its md5 table per release and the "Unsupported Ubuntu version" exit, the build from source on Ubuntu aarch64 with its Qt, Ruby and libgit2 build dependencies, `klayout` from apt on rodete and the Homebrew cask on macOS. - env.sh: the KLayout.app PATH entry on macOS. - flow/scripts/variables.mk: the lookup of a KLayout built into tools/install/klayout, which nothing installs. KLAYOUT_CMD is the klayout on PATH unless set, and is exported bare. - docs/user/BuildWithPrebuilt.md: the KLayout version note and the LD_LIBRARY_PATH line for a KLayout built from source. A deprecated Ruby DRC/LVS deck, the gallery and the viewers still need the KLayout application, installed by those who use them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018PFLaCzFtFbnWE4nPTDwpC Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent d1148f0 commit c27524a

4 files changed

Lines changed: 14 additions & 125 deletions

File tree

‎docs/user/BuildWithPrebuilt.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Using Pre-built Binaries
22

3-
## Install Klayout and Yosys
4-
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).
3+
## Install KLayout and Yosys
4+
The GDS file, DRC and LVS use KLayout's Python module, installed with the
5+
other Python packages from `etc/requirements-common_lock.txt`, or alone
6+
with `pip install klayout`. The KLayout application is needed only for a
7+
deprecated Ruby DRC/LVS deck (see [KLayoutPythonDecks.md](KLayoutPythonDecks.md)),
8+
the gallery and the viewers:
9+
[KLayout](https://www.klayout.de/build.html).
510

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

1013
## Install OpenROAD
@@ -44,9 +47,6 @@ Export path variables accordingly.
4447
export OPENROAD_EXE=$(command -v openroad)
4548
export YOSYS_EXE=$(command -v yosys)
4649
47-
# only if KLayout is built from source
48-
export LD_LIBRARY_PATH="<klayout_location>/bin:$PATH"
49-
5050
yosys -help
5151
yosys -m slang -p "slang_version"
5252
openroad -help

‎env.sh‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ function __setpaths() {
1616
export PATH=${DIR}/tools/install/kepler-formal/bin:$PATH
1717

1818
if [[ "$OSTYPE" == "darwin"* ]]; then
19-
export PATH="/Applications/KLayout/klayout.app/Contents/MacOS:$PATH"
2019
export PATH="$(brew --prefix bison)/bin:$(brew --prefix flex)/bin:$(brew --prefix tcl-tk@8)/bin:$PATH"
2120
export QT_QPA_PLATFORM=cocoa
2221
fi

‎etc/DependencyInstaller.sh‎

Lines changed: 4 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ fi
1212
# Make sure we are on the correct folder before beginning
1313
cd "${_script_dir}/../"
1414

15-
# package versions
16-
klayoutVersion=0.30.12
1715
if [[ "$OSTYPE" == "darwin"* ]]; then
1816
numThreads=$(sysctl -n hw.logicalcpu)
1917
else
@@ -203,19 +201,6 @@ _install_EL7_Packages() {
203201
ruby-devel \
204202
tcl-tclreadline \
205203
tcl-tclreadline-devel
206-
207-
if ! [ -x "$(command -v klayout)" ]; then
208-
yum -y install https://www.klayout.org/downloads/CentOS_7/klayout-${klayoutVersion}-0.x86_64.rpm
209-
else
210-
currentVersion=$(klayout -v | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
211-
if _versionCompare $currentVersion -ge $klayoutVersion; then
212-
echo "KLayout version greater than or equal to ${klayoutVersion}"
213-
else
214-
echo "KLayout version less than ${klayoutVersion}"
215-
sudo yum remove -y klayout
216-
yum -y install https://www.klayout.org/downloads/CentOS_7/klayout-${klayoutVersion}-0.x86_64.rpm
217-
fi
218-
fi
219204
}
220205

221206

@@ -226,7 +211,7 @@ _install_EL8_EL9_CleanUp() {
226211

227212
# Enterprise Linux 8/9 package installation (EL8/EL9 = RHEL, Rocky Linux, AlmaLinux, or CentOS 8 as no CentOS 9 exists)
228213
_install_EL8_EL9_Packages() {
229-
# Re-detect EL version for appropriate KLayout package
214+
# Re-detect EL version
230215
if [[ -f /etc/os-release ]]; then
231216
elVersion=$(awk -F= '/^VERSION_ID/{print $2}' /etc/os-release | sed 's/"//g' | cut -d. -f1)
232217
else
@@ -286,62 +271,13 @@ _install_EL8_EL9_Packages() {
286271
dnf -y install \
287272
https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/readline-devel-8.1-4.el9.x86_64.rpm
288273
fi
289-
290-
# Install KLayout based on EL version, note the different URLs
291-
case "${elVersion}" in
292-
"8")
293-
if ! [ -x "$(command -v klayout)" ]; then
294-
dnf -y install https://www.klayout.org/downloads/CentOS_8/klayout-${klayoutVersion}-0.x86_64.rpm
295-
else
296-
currentVersion=$(klayout -v | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
297-
if _versionCompare "$currentVersion" -ge $klayoutVersion; then
298-
echo "KLayout version greater than or equal to ${klayoutVersion}"
299-
else
300-
echo "KLayout version less than ${klayoutVersion}"
301-
sudo dnf remove -y klayout
302-
dnf -y install https://www.klayout.org/downloads/CentOS_8/klayout-${klayoutVersion}-0.x86_64.rpm
303-
fi
304-
fi
305-
;;
306-
"9")
307-
if ! [ -x "$(command -v klayout)" ]; then
308-
dnf -y install https://www.klayout.org/downloads/RockyLinux_9/klayout-${klayoutVersion}-0.x86_64.rpm
309-
else
310-
currentVersion=$(klayout -v | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
311-
if _versionCompare "$currentVersion" -ge $klayoutVersion; then
312-
echo "KLayout version greater than or equal to ${klayoutVersion}"
313-
else
314-
echo "KLayout version less than ${klayoutVersion}"
315-
sudo dnf remove -y klayout
316-
dnf -y install https://www.klayout.org/downloads/RockyLinux_9/klayout-${klayoutVersion}-0.x86_64.rpm
317-
fi
318-
fi
319-
;;
320-
*)
321-
echo "ERROR: Unsupported Enterprise Linux version: ${elVersion}"
322-
exit 1
323-
;;
324-
esac
325274
}
326275

327276
_installUbuntuCleanUp() {
328277
apt-get autoclean -y
329278
apt-get autoremove -y
330279
}
331280

332-
_installKlayoutDependenciesUbuntuAarch64() {
333-
echo "Installing Klayout dependencies"
334-
export DEBIAN_FRONTEND=noninteractive
335-
apt-get -y update
336-
apt-get -y install build-essential \
337-
qtbase5-dev qttools5-dev libqt5xmlpatterns5-dev qtmultimedia5-dev libqt5multimediawidgets5 libqt5svg5-dev \
338-
ruby ruby-dev \
339-
python3 python3-dev \
340-
libz-dev\
341-
libgit2-dev
342-
echo "All dependencies installed successfully"
343-
}
344-
345281
_installUbuntuPackages() {
346282
export DEBIAN_FRONTEND="noninteractive"
347283
apt-get -y update
@@ -399,44 +335,8 @@ _installUbuntuPackages() {
399335
fi
400336
apt-get install -y --no-install-recommends ${packages[@]}
401337

402-
# install KLayout
403-
if [[ $1 == "rodete" ]]; then
404-
apt-get -y install --no-install-recommends klayout python3-pandas
405-
else
406-
arch=$(uname -m)
407-
lastDir="$(pwd)"
408-
# temp dir to download and compile
409-
baseDir=/tmp/installers
410-
klayoutPrefix=${PREFIX:-"/usr/local"}
411-
mkdir -p "${baseDir}"
412-
cd "${baseDir}"
413-
if [[ $arch == "aarch64" ]]; then
414-
if [ ! -f ${klayoutPrefix}/klayout ]; then
415-
_installKlayoutDependenciesUbuntuAarch64
416-
echo "Installing KLayout for aarch64 architecture"
417-
git clone --depth=1 -b "v${klayoutVersion}" https://github.com/KLayout/klayout.git
418-
cd klayout
419-
./build.sh -bin "${klayoutPrefix}" -option -j "${numThreads}"
420-
else
421-
echo "Klayout is already installed"
422-
fi
423-
else
424-
if [[ $1 == 22.04 ]]; then
425-
klayoutChecksum=6dfffa50f385881768dee30bdc759608
426-
elif [[ $1 == 24.04 ]]; then
427-
klayoutChecksum=0181713e60891e461d6d1664c1b8e213
428-
elif [[ $1 == 26.04 ]]; then
429-
klayoutChecksum=904f60fd05c3a5029cab8a2840029f49
430-
else
431-
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"
432-
exit 1
433-
fi
434-
wget https://www.klayout.org/downloads/Ubuntu-${1%.*}/klayout_${klayoutVersion}-1_amd64.deb
435-
md5sum -c <(echo "${klayoutChecksum} klayout_${klayoutVersion}-1_amd64.deb") || exit 1
436-
dpkg -i klayout_${klayoutVersion}-1_amd64.deb
437-
fi
438-
cd "${lastDir}"
439-
rm -rf "${baseDir}"
338+
if [[ $1 == "rodete" ]]; then
339+
apt-get -y install --no-install-recommends python3-pandas
440340
fi
441341

442342
if command -v docker &> /dev/null; then
@@ -473,7 +373,6 @@ _installDarwinPackages() {
473373
brew install libffi tcl-tk ruby
474374
brew install python libomp doxygen capnp tbb bison flex boost spdlog zlib cmake
475375
brew link --force libomp
476-
brew install --cask klayout
477376
brew install docker docker-buildx
478377
}
479378

@@ -676,7 +575,7 @@ case "${os}" in
676575
# First install OpenROAD base
677576
_installORDependencies
678577

679-
# Determine between EL7 vs EL8/9, since yum vs dnf should be used, and different Klayout builds exist
578+
# Determine between EL7 vs EL8/9, since yum vs dnf should be used
680579
case "${elVersion}" in
681580
"7")
682581
# EL7 = RHEL 7 or CentOS 7

‎flow/scripts/variables.mk‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,13 @@ export YOSYS_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys)
132132

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

135-
# Use locally installed and built klayout if it exists, otherwise use klayout in path
136-
KLAYOUT_DIR = $(abspath $(FLOW_HOME)/../tools/install/klayout/)
137-
KLAYOUT_BIN_FROM_DIR = $(KLAYOUT_DIR)/klayout
138-
139135
KEPLER_FORMAL_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/kepler-formal/bin/kepler-formal)
140136
export KEPLER_FORMAL_EXE
141137

142-
ifeq ($(wildcard $(KLAYOUT_BIN_FROM_DIR)), $(KLAYOUT_BIN_FROM_DIR))
143-
KLAYOUT_CMD ?= sh -c 'LD_LIBRARY_PATH=$(dir $(KLAYOUT_BIN_FROM_DIR)) $$0 "$$@"' $(KLAYOUT_BIN_FROM_DIR)
144-
else
145-
ifeq ($(KLAYOUT_CMD),)
146-
KLAYOUT_CMD ?= $(shell command -v klayout)
138+
ifeq ($(origin KLAYOUT_CMD), undefined)
139+
KLAYOUT_CMD := $(shell command -v klayout)
147140
endif
148-
endif
149-
150-
export KLAYOUT_CMD := $(KLAYOUT_CMD)
141+
export KLAYOUT_CMD
151142

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

0 commit comments

Comments
 (0)