간혹 개발 서버를 재 설치 이후에 컴파일을 하면 아래와 같이 math 라이브러리를 못 찾는 다는 오류가 뜹니다
/usr/bin/ld: cannot find -lm
이럴 때는 glibc-static.x86_64 패키지를 설치 해주면 오류를 해결 할 수 있습니다
Redhat 계열은 아래와 같이 yum으로 간단히 설치 가능합니다
# yum install glibc-static.x86_64
Loaded plugins: fastestmirror, priorities, refresh-packagekit, security
Loading mirror speeds from cached hostfile
epel/metalink | 5.2 kB 00:00
* base: ftp.daum.net
* epel: ftp.kddilabs.jp
* extras: ftp.daum.net
* updates: ftp.neowiz.com
PlexRepo | 951 B 00:00
base | 3.7 kB 00:00
epel | 3.9 kB 00:00
epel/primary_db | 5.6 MB 00:01
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 4.5 MB 00:01
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package glibc-static.x86_64 0:2.12-1.107.el6_4.4 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
glibc-static x86_64 2.12-1.107.el6_4.4 updates 1.4 M
Transaction Summary
================================================================================
Install 1 Package(s)
Total download size: 1.4 M
Installed size: 6.5 M
Is this ok [y/N]: y
Downloading Packages:
glibc-static-2.12-1.107.el6_4.4.x86_64.rpm | 1.4 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : glibc-static-2.12-1.107.el6_4.4.x86_64 1/1
Verifying : glibc-static-2.12-1.107.el6_4.4.x86_64 1/1
Installed:
glibc-static.x86_64 0:2.12-1.107.el6_4.4
Complete!
출처 : http://software.intel.com/en-us/articles/error-ld-cannot-find-lm