7

Is there a way to reduce the file size of the compiled GSL library?

Could I just compile some of the sub-libs?

Peter O.
  • 28,965
  • 14
  • 72
  • 87
alex
  • 310
  • 1
  • 6
  • how many libs do you need? you could just take the libs you need? – pyCthon Oct 19 '12 at 17:51
  • This question is really interesting. There is a similar question already in stackoverflow, it may answer your question: http://stackoverflow.com/questions/4119726/extracting-small-parts-of-large-library-fx-boost I am looking forward to seeing experienced programmers' answers. – jespestana Oct 19 '12 at 18:13
  • 3
    A way to reduce the size of your **executables** is described [here](http://wiki.wxwidgets.org/Reducing_Executable_Size). It increases the size of your library though and doesn't tell you how to filter out those parts of the library you are not interested in. – Ali Oct 19 '12 at 18:32

1 Answers1

1

I can think of these ways in which you can get around this -

  • A very simple but very effective way to do this is by using dynamic linking. Statically linking code to either your libraries or executables makes them substantially larger. This discussion will probably give you a clearer picture. GSL is built as a dynamic library, so in most cases, you actually have very little of the GSL object files in your own executable files.
  • Use compiler optimisations - Strip the binaries using the -s and -Os flag while compiling(using GCC) or use strip --strip-all
Community
  • 1
  • 1
ssb
  • 6,980
  • 10
  • 32
  • 57