Install nix on ubuntu 22.04 - running smoke test - LD_LIBRARY_PATH is past on into NIX shell
Description
Did fresh install of nix on a linux ubuntu 22.04 - cloned the openlane2 repo - opened a nix-shell in that repo and ran openlane --smoke_test
File log: - Looks like libgit2.so.1.1 is missing
File "/nix/store/jr2jxhcp4qybkyz8was3ym6m35cd869d-python3-3.11.6-env/lib/python3.11/site-packages/klayout/db/__init__.py", line 3, in <module>
import klayout.dbcore
ImportError: libgit2.so.1.1: cannot open shared object file: No such file or directory
[11:05:45] ERROR Subprocess had a non-zero exit. step.py:1308
[11:05:45] ERROR Last 9 line(s): step.py:1313
Traceback (most recent call last):
File "/nix/store/jr2jxhcp4qybkyz8was3ym6m35cd869d-python3-3.11.6-env/lib/python3.11/site-packages/openlane/scripts/klayout/stream_out.py", line 50, in <module>
import pya
File "/nix/store/jr2jxhcp4qybkyz8was3ym6m35cd869d-python3-3.11.6-env/lib/python3.11/site-packages/pya/__init__.py", line 5, in <module>
from klayout.db import * # noqa
^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/jr2jxhcp4qybkyz8was3ym6m35cd869d-python3-3.11.6-env/lib/python3.11/site-packages/klayout/db/__init__.py", line 3, in <module>
import klayout.dbcore
ImportError: libgit2.so.1.1: cannot open shared object file: No such file or directory
[11:05:45] ERROR Full log file: '../../../../tmp/tmppxwkart1openlane2/smoke_test_design/runs/RUN_2024-06-22_11-05-04/54-klayout-streamout/klayout-streamout.log' step.py:1316
[11:05:45] WARNING The following warnings were generated by the flow: flow.py:671
[11:05:45] WARNING [Odb.CustomIOPlacement] Overriding minimum distance 0.1 with 0.42 for pins on side N to avoid overlap. flow.py:673
[11:05:45] WARNING [OpenROAD.DetailedRouting] [DRT-0349] LEF58_ENCLOSURE with no CUTCLASS is not supported. Skipping for layer mcon (and 9 similar warnings) flow.py:673
[11:05:45] WARNING [Checker.WireLength] Threshold for Threshold-surpassing long wires is not set. The checker will be skipped. flow.py:673
[11:05:45] WARNING [OpenROAD.IRDropReport] 'VSRC_LOC_FILES' was not given a value, which may make the results of IR drop analysis inaccurate. If you are not integrating a top-level chip for manufacture, you may flow.py:673
ignore this warning, otherwise, see the documentation for 'VSRC_LOC_FILES'.
[11:05:45] ERROR The following error was encountered while running the flow: __main__.py:152
GDSII Stream Out (KLayout): subprocess (1, ['/nix/store/jr2jxhcp4qybkyz8was3ym6m35cd869d-python3-3.11.6-env/bin/python3.11',
'/nix/store/jr2jxhcp4qybkyz8was3ym6m35cd869d-python3-3.11.6-env/lib/python3.11/site-packages/openlane/scripts/klayout/stream_out.py',
'/tmp/tmppxwkart1openlane2/smoke_test_design/runs/RUN_2024-06-22_11-05-04/49-openroad-fillinsertion/spm.def', '--output',
'/tmp/tmppxwkart1openlane2/smoke_test_design/runs/RUN_2024-06-22_11-05-04/54-klayout-streamout/spm.klayout.gds', '--top', 'spm', '--lyp',
'/home/jakobsen/.volare/volare/sky130/versions/bdc9412b3e468c102d01b7cf6337be06ec6e9c9a/sky130A/libs.tech/klayout/tech/sky130A.lyp', '--lyt',
'/home/jakobsen/.volare/volare/sky130/versions/bdc9412b3e468c102d01b7cf6337be06ec6e9c9a/sky130A/libs.tech/klayout/tech/sky130A.lyt', '--lym',
'/home/jakobsen/.volare/volare/sky130/versions/bdc9412b3e468c102d01b7cf6337be06ec6e9c9a/sky130A/libs.tech/klayout/tech/sky130A.map', '--input-lef',
'/home/jakobsen/.volare/volare/sky130/versions/bdc9412b3e468c102d01b7cf6337be06ec6e9c9a/sky130A/libs.ref/sky130_fd_sc_hd/techlef/sky130_fd_sc_hd__nom.tlef', '--input-lef',
'/home/jakobsen/.volare/volare/sky130/versions/bdc9412b3e468c102d01b7cf6337be06ec6e9c9a/sky130A/libs.ref/sky130_fd_sc_hd/lef/sky130_fd_sc_hd.lef', '--input-lef',
'/home/jakobsen/.volare/volare/sky130/versions/bdc9412b3e468c102d01b7cf6337be06ec6e9c9a/sky130A/libs.ref/sky130_fd_sc_hd/lef/sky130_ef_sc_hd.lef', '--with-gds-file',
'/home/jakobsen/.volare/volare/sky130/versions/bdc9412b3e468c102d01b7cf6337be06ec6e9c9a/sky130A/libs.ref/sky130_fd_sc_hd/gds/sky130_fd_sc_hd.gds']) failed
[11:05:45] ERROR OpenLane will now quit. __main__.py:153
Classic - Stage 57 - GDSII Stream Out (KLayout) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━ 56/75 0:00:41
[nix-shell:~/opentools/openlane2]$ klayout
klayout: error while loading shared libraries: libgit2.so.1.1: cannot open shared object file: No such file or directory
[nix-shell:~/opentools/openlane2]$
Expected Behavior
Build some thing :-)
Environment report
kernel: Linux
kernel_version: 6.8.1-060801-generic
supported: True
distro: ubuntu
distro_version: 22.04
python_version: 3.11.6
python_path:
- /nix/store/9jb8wsk32ny2yy5ghcaq3y7mbmmavi2c-python3.11-openlane/bin
- /nix/store/jr2jxhcp4qybkyz8was3ym6m35cd869d-python3-3.11.6-env/lib/python3.11/site-packages
- /nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python311.zip
- /nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11
- /nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11/lib-dynload
- /nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11/site-packages
- /nix/store/9jb8wsk32ny2yy5ghcaq3y7mbmmavi2c-python3.11-openlane/lib/python3.11/site-packages
- /nix/store/2z0jalw27lp6zm642aqvnlydlqblhcdf-python3.11-click-8.1.7/lib/python3.11/site-packages
- /nix/store/m1a3bk12cjgk6wq445pi7xch3v2gx8ql-python3.11-cloup-3.0.2/lib/python3.11/site-packages
- /nix/store/a8z71acldic6hqdbd18sd81sqcqgygd3-python3.11-pyyaml-6.0.1/lib/python3.11/site-packages
- /nix/store/jlb8fjb88bx2adivdz8pq8cx5aj5615h-python3.11-rich-13.5.2/lib/python3.11/site-packages
- /nix/store/8x0qa1j4z2907a9pvvf9lwzs6n58i5m5-python3.11-markdown-it-py-3.0.0/lib/python3.11/site-packages
- /nix/store/69l2fjl76rad6fz5n5v38px2kiwcz5x8-python3.11-mdurl-0.1.2/lib/python3.11/site-packages
- /nix/store/ljd22jdzx6kj0hj7wsnhr71gqa4iqj88-python3.11-pygments-2.16.1/lib/python3.11/site-packages
- /nix/store/y8yq448xka665bqyd5gvdhajqdbsnyys-python3.11-setuptools-68.2.2/lib/python3.11/site-packages
- /nix/store/71js2p8zx17fqgq2m1b5f7q92ig0v7nn-python3.11-requests-2.31.0/lib/python3.11/site-packages
- /nix/store/6jj18jqyik8k06plad2hm9fwcrnhpxf3-python3.11-brotlicffi-1.1.0.0/lib/python3.11/site-packages
- /nix/store/qxsnv4322wqi9w629b572k898viw756h-python3.11-cffi-1.16.0/lib/python3.11/site-packages
- /nix/store/r0mzj4k7gzx3bp4mbnr69x6if6lxxsb1-python3.11-pycparser-2.21/lib/python3.11/site-packages
- /nix/store/hk5xz5kyhr1vaq2p65990c2fxw7mxlmp-python3.11-certifi-2023.07.22/lib/python3.11/site-packages
- /nix/store/g3kzbrnirxky2w4g3n67p01745pa8xcc-python3.11-charset-normalizer-3.2.0/lib/python3.11/site-packages
- /nix/store/g3w192qs0avwjaw776yiyaq5l0dcbwdp-python3.11-idna-3.4/lib/python3.11/site-packages
- /nix/store/71236y06cag3yb637q5jj358ci6f20ah-python3.11-urllib3-2.0.7/lib/python3.11/site-packages
- /nix/store/bnadfkpcdkmrzymnpyj8x2bdxq1f6kdw-python3.11-pcpp-1.30/lib/python3.11/site-packages
- /nix/store/i41k9kc0s446fw5vl4k05vfq3prw06hv-python3.11-volare/lib/python3.11/site-packages
- /nix/store/i46q5s4xj3700m2srcx4rd2bv2x6w51h-python3.11-httpx-0.25.0/lib/python3.11/site-packages
- /nix/store/6ckbxrfj5q372da9svdh7hnh67vbwyhc-python3.11-httpcore-0.18.0/lib/python3.11/site-packages
- /nix/store/43sv2g5lsl58md1lzidlx1g7xam2mpqp-python3.11-anyio-4.0.0/lib/python3.11/site-packages
- /nix/store/4m6453i7as66sdmkck8fiwk793lx1b29-python3.11-sniffio-1.3.0/lib/python3.11/site-packages
- /nix/store/1c9w7989rjr417rs50bxsrinjf63mz8n-python3.11-h11-0.14.0/lib/python3.11/site-packages
- /nix/store/q9c0733drxk1zv5j60hq0lz61g395dic-python3.11-rfc3986-2.0.0/lib/python3.11/site-packages
- /nix/store/i24kszh5ajb03gwhjlmb1df6sm0s0x72-python3.11-zstandard-0.21.0/lib/python3.11/site-packages
- /nix/store/608w6rc3xa1mj44ppara7pnmr6z6kbpn-python3.11-tkinter-3.11.6/lib/python3.11/site-packages
- /nix/store/k2xqs2rp3kyb0pbq1sn9v0sh05q0cmvc-python3.11-lxml-4.9.3-3/lib/python3.11/site-packages
- /nix/store/vp0ivbg65mnsjvfgyran0x1bzsf3x66l-python3.11-deprecated-1.2.14/lib/python3.11/site-packages
- /nix/store/bj6g1njs2z0ivrwlpkls9qr1ar1psjaw-python3.11-wrapt-1.14.1/lib/python3.11/site-packages
- /nix/store/cghmw4316dgv9f86y6prdybi50v1f8sn-python3.11-immutabledict-3.0.0/lib/python3.11/site-packages
- /nix/store/sqp8y9xj0fbsmmmlyk6chhpc5wq7w3gb-python3.11-libparse/lib/python3.11/site-packages
- /nix/store/8wkz5a9z1ppwjvr54375k69avhkmz4nc-python3.11-psutil-5.9.6/lib/python3.11/site-packages
- /nix/store/kn3xxzgq9bx9av42h495bvxnslyg41v1-klayout-pymod/lib/python3.11/site-packages
tkinter: True
container_info: None
nix_info:
version_string: nix (Nix) 2.23.0
channels:
nix_command: True
flakes: True
Reproduction material
did not work
Relevant log output
[nix-shell:~/opentools/openlane2]$ klayout -version
klayout: error while loading shared libraries: libgit2.so.1.1: cannot open shared object file: No such file or directory
Found the error :-) - And all good now
-
Antenna Passed ✅
-
LVS Passed ✅
-
DRC Passed ✅
[11:30:31] INFO Saving views to '/tmp/tmp4ehmkxuuopenlane2/smoke_test_design/runs/RUN_2024-06-22_11-29-39/final'… state.py:193
[11:30:31] INFO Flow complete. sequential.py:294
Classic - Stage 75 - Report Manufacturability ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75/75 0:00:51
[11:30:31] WARNING The following warnings were generated by the flow: flow.py:671
[11:30:31] WARNING [Odb.CustomIOPlacement] Overriding minimum distance 0.1 with 0.42 for pins on side N to avoid overlap. flow.py:673
[11:30:31] WARNING [OpenROAD.DetailedRouting] [DRT-0349] LEF58_ENCLOSURE with no CUTCLASS is not supported. Skipping for layer mcon (and 9 similar warnings) flow.py:673
[11:30:31] WARNING [Checker.WireLength] Threshold for Threshold-surpassing long wires is not set. The checker will be skipped. flow.py:673
[11:30:31] WARNING [OpenROAD.IRDropReport] 'VSRC_LOC_FILES' was not given a value, which may make the results of IR drop analysis inaccurate. If you are not integrating a top-level chip for manufacture, you may flow.py:673
ignore this warning, otherwise, see the documentation for 'VSRC_LOC_FILES'.
[11:30:31] INFO Smoke test passed. main.py:267
[nix-shell:~/opentools/openlane2]$
On my machine I uses a local klayout build and have set LD_LIBRARY_PATH
klayout is /home/jakobsen/opentools/klayout/bin-release/klayout
jakobsen@t14:~$ echo $LD_LIBRARY_PATH
:/home/jakobsen/opentools/klayout/bin-release
jakobsen@t14:~$ klayout -v
KLayout 0.29.0
jakobsen@t14:~$
In my nix environment - the LIB_LIBRARY_PATH is still there and klayout misses out on libgit2.so....
akobsen@t14:~$ cd opentools/openlane2/
jakobsen@t14:~/opentools/openlane2$ ls
Authors.md flake.lock nix Readme.md setup.py
Changelog.md flake.nix notebook.ipynb requirements_dev.txt shell.nix
default.nix License openlane requirements_docs.txt test
docs Makefile openlane2_env.log requirements.txt type_stubs
jakobsen@t14:~/opentools/openlane2$ nix-shell
[nix-shell:~/opentools/openlane2]$ type klayout
klayout is /nix/store/gvq51plg4ydzfxma0m46w82jbvngvnch-klayout/bin/klayout
[nix-shell:~/opentools/openlane2]$ echo $LD_LIBRARY_PATH
:/home/jakobsen/opentools/klayout/bin-release:/home/jakobsen/opentools/klayout/bin-release
[nix-shell:~/opentools/openlane2]$ klayout -v
klayout: error while loading shared libraries: libgit2.so.1.1: cannot open shared object file: No such file or directory
[nix-shell:~/opentools/openlane2]$
/J
I don't know how you're setting LD_LIBRARY_PATH, but you could set it as follows:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jakobsen/opentools/klayout/bin-release/klayout
This will make sure the right libraries can be loaded first.
Thanks for giving OpenLane 2 a try, Jørgen!
Hi Donn That is how it all ready get set from my .bashrc file:
export PATH=$PATH:/home/jakobsen/opentools/klayout/bin-release:/home/jakobsen/.cargo/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jakobsen/opentools/klayout/bin-release
In nix-shell I just get the my original LD_LIBRARY_PATH added again.
jakobsen@t14:~/opentools/openlane2$ nix-shell
[nix-shell:~/opentools/openlane2]$ echo $LD_LIBRARY_PATH
:/home/jakobsen/opentools/klayout/bin-release/klayout:/home/jakobsen/opentools/klayout/bin-release/klayout
I will try to see if I can find out why. Yes - Openlane2 looks very nice. I will try so run some of my design this way. /J
Sadly this appears to be inherent to Nix. You can add something like this to your rcfile:
if [ "$IN_NIX_SHELL" = "" ]; then
export LD_LIBRARY_PATH=…
fi