# Libtree: 라이브러리 발견 여부를 트리 형태로 설명하는 Ldd

> Clean Markdown view of GeekNews topic #15273. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=15273](https://news.hada.io/topic?id=15273)
- GeekNews Markdown: [https://news.hada.io/topic/15273.md](https://news.hada.io/topic/15273.md)
- Type: GN+
- Author: [neo](https://news.hada.io/@neo)
- Published: 2024-06-10T20:33:33+09:00
- Updated: 2024-06-10T20:33:33+09:00
- Original source: [github.com/haampie](https://github.com/haampie/libtree)
- Points: 3
- Comments: 1

## Topic Body

### libtree 도구

#### 기능
- `ldd` 명령어를 트리 형태로 변환함
- 공유 라이브러리가 어떻게 발견되었는지 또는 왜 찾을 수 없는지 설명함

#### 출력
- 기본적으로 특정 표준 종속성은 표시되지 않음
- 더 자세한 출력을 위해 다음 명령어 사용 가능:
  - `libtree -v`: 기본적으로 생략된 라이브러리 표시
  - `libtree -vv`: 생략된 라이브러리의 종속성 표시
  - `libtree -vvv`: 이미 발견된 라이브러리의 종속성 표시
- `--path` 또는 `-p` 플래그를 사용하여 soname 대신 경로 표시:
  - 예: `libtree -p $(which tar)`
- `--max-depth` 플래그를 사용하여 재귀 깊이 제한 가능

#### 설치
- **v3.1.1** 버전의 사전 빌드 바이너리:
  - aarch64 (linux): `c5d4fbcd4e3fb46f02c028532f60fcf1c92f7c6aad5b07a991c67550c2554862`
  - armv6l (linux): `16f5a7503a095bd88ebc5e21ec4ba8337c5d9712cac355bf89399c9e6beef661`
  - armv7l (linux): `17f493621e7cc651e2bddef207c1554a64a114e1c907dbe5b79ff0e97180b29e`
  - i686 (linux): `230a163c20f4a88a983d8647a9aa793317be6556e2c6a79e8a6295389e651ef5`
  - x86_64 (linux): `49218482f89648972ea4ef38cf986e85268efd1ce8f27fe14b23124bca009e6f`
- Fedora / RHEL / CentOS:
  - `$ dnf install epel-release` (RHEL 및 파생 제품의 경우 EPEL 먼저 활성화)
  - `$ dnf install libtree-ldd`
- Ubuntu 22.04+:
  - `$ apt-get install libtree`
- GNU Guix:
  - `$ guix install libtree`

#### 소스에서 빌드
- `libtree`는 c99를 이해하는 C 컴파일러 필요
  - `git clone https://github.com/haampie/libtree.git`
  - `cd libtree`
  - `make` (추천: `LDFLAGS=-static`)
  - 빠른 설치 방법:
    - `curl -Lfs https://raw.githubusercontent.com/haampie/libtree/master/libtree.c | ${CC:-cc} -o libtree -x c - -std=c99 -D_FILE_OFFSET_BITS=64`

### GN⁺의 의견
- **libtree**는 공유 라이브러리의 종속성을 시각적으로 이해하는 데 유용함. 이는 디버깅과 시스템 관리에 큰 도움이 됨.
- **libtree**는 다양한 리눅스 배포판에서 쉽게 설치할 수 있어 접근성이 높음.
- 소스에서 직접 빌드할 수 있어 커스터마이징이 가능함.
- 이 도구는 특히 복잡한 프로젝트에서 라이브러리 종속성을 관리하는 데 유용함.
- 비슷한 기능을 제공하는 도구로는 `ldd`와 `readelf`가 있지만, **libtree**는 트리 구조로 시각화해 더 직관적임.

## Comments



### Comment 26137

- Author: kayws426
- Created: 2024-06-11T17:19:23+09:00
- Points: 1

좋아보이네요!!
