[Insight-developers] Stripping Libraries on OSX

Bradley Lowekamp blowekamp at mail.nih.gov
Mon Mar 3 10:16:21 EST 2014


Hello,

On Linux I can just add the "-s" c/cxx flag to produce libraries with a minimal number of symbols. However on OSX gcc/gcc-llvm/clang does not produce stripped libraries. Is the an easy way to produce stripped libraries.

Specifically, for SimpleITK, the generated shared libraries for languages are large. The resulting library for this build[1] is used for release, and is compiled with x86_64 and i386(i686) architectures support. The resulting library is 363MB for python, but after "strip -arch all -x -u lib/_SimpleITK.so" is run the library is only 279MB for a resulting savings of 84MB. This results in improved load times when just using SimpleITK.

I could add a CMake flag and a post build custom command for the library to run strip on it, but I am wondering is there is an easier or better way?

Thanks,
Brad

[1] http://open.cdash.org/viewNotes.php?buildid=3240200


More information about the Insight-developers mailing list