6

Is it a standard to have only dynamic libraries mostly without their static version? I am particularly asking about math library. In my fedora 17 (linux machine on Intel 32 processor), I have latest gcc and it has libm-2.15.so and symbolic link file libm.so but there is no libm.a.

Is libm.a missing on my system?

KawaiKx
  • 9,558
  • 19
  • 72
  • 111
  • 3
    This is likely to be very specific to your distrubtion, but my ubuntu 13.04 has libm.a located at /usr/lib/x86_64-linux-gnu/libm.a. Have you looked properly in all the possibile places libs can be stored? – goji Oct 08 '13 at 04:05
  • @Troy I did a search at the root for libm.a but no luck. is there any other way to check its presence on my system? I use fedora 17. – KawaiKx Oct 08 '13 at 04:12
  • 4
    Did you install the static libraries? `yum install glibc-static` – SheetJS Oct 08 '13 at 04:13
  • You did `find / -name "libm.a"`? I'm not really familiar with fedora so I'm not sure how best to locate what pkg should provide it. I suspect almost all linux distros would be provide libm.a tho. – goji Oct 08 '13 at 04:13
  • 2
    @Nirk That should be the answer .... :) – goji Oct 08 '13 at 04:17
  • @Nirk nicely pointed out. libm.a was missing on my system because glibc-static was not installed. thanks a lot – KawaiKx Oct 08 '13 at 04:17

3 Answers3

13

Install the static libraries:

# yum install glibc-static
SheetJS
  • 22,470
  • 12
  • 65
  • 75
1

You ask:

Is it a standard to have only dynamic libraries mostly without their static version?

In Fedora, it is indeed standard to only package dynamic libraries. From the packaging guidelines:

Packages including libraries should exclude static libs as far as possible (eg by configuring with --disable-static). Static libraries should only be included in exceptional circumstances. Applications linking against libraries should as far as possible link against shared libraries not static versions.

and later,

In general, packagers are strongly encouraged not to ship static libs unless a compelling reason exists.

... which goes on to say that when such a library is packaged, it should be in a separate subpackage with the suffix -static, as in this case glibc-static.

mattdm
  • 2,082
  • 25
  • 39
0

generally the .somand .a exist at the same time, but dll comes first.

maybe the static library is missing, you can try yum command as nirk said.

suitianshi
  • 3,300
  • 1
  • 17
  • 34