It looks like you're new here. If you want to get involved, click one of these buttons!
Hello,
I have made a windows executable (using pyInstaller) that's built on top of klayout.
One of my scripts is utilizing from pcells.
When I execute it from the source code it works fine, however when I execute it from the compiled executable I get the following error:
RuntimeError: Stream has unknown format: data in Layout.add_pcell_variant
Maybe there is a missing binary that I need to add. (I have already added all of the dll files in db_plugins)
Do you have any idea on what is going wrong ?
Thanks!
Comments
@Ege_Bey The stream readers/writers are dynamically loaded. You have to supply them separately I assume. If pyInstaller does what I think it does, it will analyze the DLLs and package all dependencies. I cannot know about dynamically loaded libraries.
The "db" core library will try to locate them next to itself in a folder called "db_plugins".
So look for a folder called "db_plugins" and make sure the files there are installed too, at the same place as "klayout_db.dll" (the "db" core library).
Matthias
Hi @Matthias @Ege_Bey
I'm trying to build a similar application and ran into the same issue. I tried to build it with the db_plugins added with the command below
pyinstaller --onefile --add-data "/home/user/miniconda3/envs/dreamsfab/lib/python3.11/site-packages/klayout/db_plugins:./db_plugins" klayout_app.py
However, when the application executes layout.read, it returns error loading plugins errors:
any thoughts on why this is happening? I also tried compiling it with older python versions. The application is able to read the layout well before building it.
Thanks!
Hi @Mustafacc,
I ssume some .so dependencies are not satisfied. You can run the application with
LD_DEBUG=files
to get more information about what is actually happening. In the log you should see the attempts the loader performs and why it finally fails.I suspect that the db_plugins have been built with RPATH baked in - if you move them to /tmp, they will not find the dependency libraries.
In addition, the "Aborted" as the end is weird, but without further information I can't say why this happens.
Matthias