It looks like you're new here. If you want to get involved, click one of these buttons!
Hello here !
I'm playing around with openPDK gf180mcu right now and was very happy to reuse KLayout after so many years for layout edition. It's also awesome that KLayout is first class layout tool for this PDK :-) with DRC and LVS setup. I could not test those last week-end because I ran into some issue:
$ python3 -V
Python 3.11.7
$ python3 $PDK_ROOT/gf180mcuA/libs.tech/klayout/drc/run_drc.py -h
Traceback (most recent call last):
File "/stock/sky130de/share/pdk/gf180mcuA/libs.tech/klayout/drc/run_drc.py", line 59, in <module>
import klayout.db
ModuleNotFoundError: No module named 'klayout'
I downloaded the PKGBUILD from https://archlinux.org/packages/extra/x86_64/klayout and tried to compile changing the ./build.sh options with no success so far. I guess I'm doing something stupid during the compilation if I read the changelog in the sources correctly: it should work if "installed properly".
Now that I write this post I realize that it might be related with this bugfix https://github.com/KLayout/klayout/pull/1618 . Submitting this post anyway in case somebody runs into the same issue: I will try to compile from latest source and come back if it's solving the issue.
$ grep KLAYOUT_VERSION= version.sh
KLAYOUT_VERSION="0.28.15"
$ grep -C 3 -s klayout.db Changelog
* Bugfix/enhancement: some LEF/DEF parser issues solved with the help of a new complete sample case
* Bugfix: Avoid a segfault while editing a ruler. This happens is both a selection and a transient selection is active.
* Enhancement: Some enhancements for image editing (e.g. selection remains after moving handles)
* Enhancement: klayout.db Python module is auto-loaded for providing stream readers
* Enhancement: Spice reader now supports parametric subcircuits
* Enhancement: Build issue fixed for Qt 5.15.2 bindings
* Enhancement: Including Python's matplotlib into Windows binaries
--
KLayout supports production of standalone Python modules
which provide the same features than the "pya" module but
for use without the KLayout binary. If installed properly,
"import klayout" will pull in all modules. "import klayout.db"
will pull in the database part.
Deployment on PyPI is supported.
* Enhancement: Modal help dialog from modal windows
Comments
Compilation from 0.28.17 source (with " Fixed issue #1610: leaking reference in Python debugger #1618 ") is running :-)
Compilation Finished. Retesting. Issue is not solved with last version of KLayout source.
Here is to give an impression about the package content and installed dependencies (in case something should miss). Please ask me in case you need more information for debugging, I'm out of ideas atm.
Archlinux "klayout" package maintainer contacted by email. I've checked dependencies on KLayout GitHub everything looks there… (and next time I will use more cores for compilation)
Some more investigations content of "pymod" directory should not be stored in "/usr/lib/pymod" but likely in such a directory: "/usr/lib/python3.11/site-packages". I will try to figure out what to change.
It's an Archlinux PKGBUILD bug not a KLayout bug. Sorry for bothering here
Now it's working \o/
Root cause was that pymod content wasn't installed at the right place. Now it is:
Relevant PKGBUILD section, I've added the 4 lines below "### deal with python modules":
Sorry again for bothering here for a packaging issue. Writing here forced me to explain the problem, hence find the root cause and solution without real help. Have a great week !
No worries. Thanks for sharing this experience ...