# Libtree

**URL:** <https://forum.crystal-lang.org/t/libtree/6916>\
**Category:** Crystal Contrib\
**Created:** [June 10, 2024, 1:55pm UTC](https://forum.crystal-lang.org/t/libtree/6916 "2024-06-10T13:55:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![straight-shoota](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/straight-shoota/32/36_2.png) [@straight-shoota](https://forum.crystal-lang.org/u/straight-shoota)\
**Post date:** [June 10, 2024, 1:55pm UTC](https://forum.crystal-lang.org/t/libtree/6916/1 "2024-06-10T13:55:45Z")

</div>

[libtree](https://github.com/haampie/libtree) is a useful tool to figure out which dynamic libraries a binary executable depends on.  
It’s similar to `ldd`, but prints a tree view indicating dependency nesting. It also shows how shared libraries have been found.

For example, this is the output for a build of the Crystal compiler (at version 1.11.1, with LLVM 14):

```console
$ libtree .build/crystal
.build/crystal
├── libpcre2-8.so.0 [runpath]
├── libgc.so.1 [runpath]
├── libevent-2.1.so.7 [runpath]
├── libLLVM-14.so.1 [ld.so.conf]
│ ├── libffi.so.8 [ld.so.conf]
│ ├── libtinfo.so.6 [ld.so.conf]
│ ├── libz.so.1 [ld.so.conf]
│ ├── libxml2.so.2 [ld.so.conf]
│ │ ├── libicuuc.so.70 [ld.so.conf]
│ │ │ └── libicudata.so.70 [ld.so.conf]
│ │ ├── liblzma.so.5 [ld.so.conf]
│ │ └── libz.so.1 [ld.so.conf]
│ └── libedit.so.2 [ld.so.conf]
│ ├── libtinfo.so.6 [ld.so.conf]
│ └── libbsd.so.0 [ld.so.conf]
│ └── libmd.so.0 [ld.so.conf]
└── librt.so.1 [ld.so.conf]

```

via [hacker news](https://news.ycombinator.com/item?id=40626969)
