본문 바로가기

Ubuntu

기본 Library PATH의 설정

우분투에서 컴파일 또는 프로그램 실행시 기본으로 확인하는 Library PATH는 다음과 같다.

 

1. 기본 시스템 디렉토리들

• /lib
• /usr/lib
• /lib/x86_64-linux-gnu (on 64-bit systems)
• /usr/lib/x86_64-linux-gnu (on 64-bit systems)

 

2. /etc/ld.so.conf 아래 configuration 파일들

예를 들어, 이런 것 들이 추가될 것이다.

/etc/ld.so.conf.d$ ls
000_cuda.conf  988_cuda-12.conf  fakeroot-x86_64-linux-gnu.conf  gds-12-4.conf  i386-linux-gnu.conf  libc.conf  x86_64-linux-gnu.conf

$ cat 000_cuda.conf
/usr/local/cuda/targets/x86_64-linux/lib

 

3. 위에 추가로, usr/local/lib 의 디렉토리를 참조하며,

기본이 아닌, 특정한 목적으로 library path를 지정하기 위해서는 2번의 /etc/ld.so.conf 아래 configuration 파일을 추가 후

sudo ldconfig를 실행하는 방법을 사용할 수 있겠다.

 

4. Temporary path

환경변수 LD_LIBRARY_PATH를 지정하여 임시로 path를 지정할 수 있다. Module과 함께 사용하는 것도 방법인 듯 하다.

export LD_LIBRARY_PATH=/path/to/my/libs:$LD_LIBRARY_PATH

'Ubuntu' 카테고리의 다른 글

Directories 2  (0) 2025.01.16
ldconfig  (0) 2024.12.13
파일 또는 디렉토리 존재여부 확인 방법  (0) 2024.12.11
TMUX를 이용한 프로그램 실행  (0) 2024.05.16
Source Compile로 설치된 프로그램의 Dock등록방법  (0) 2023.12.24