Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reduce file size of GSL library

Tags:

c++

math

gsl

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

Could I just compile some of the sub-libs?

like image 836
alex Avatar asked Oct 19 '12 17:10

alex


1 Answers

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
like image 94
ssb Avatar answered Oct 18 '22 20:10

ssb