SimpleITKPythonPackage icon indicating copy to clipboard operation
SimpleITKPythonPackage copied to clipboard

Enable "hidden" visibility to reduce wheel size

Open blowekamp opened this issue 8 years ago • 2 comments

The current wheel size is nearly 50MB for 64-bit linux. This is the size limit of PyPi. With correctly specified hidden visibility flags, the size can be reduce to ~38MB.

Previous release were manually configured with:

  CMAKE_CXX_FLAGS:STRING=-fvisibility=hidden -fvisibility-inlines-hidden
  CMAKE_C_FLAGS:STRING=-fvisibility=hidden

The newer strategy has been to use the related CMake visibility presets. Correctness with the recent changes in ITK and how SimpleITK interacts with these properties needs to be tests and reviewed in the current SimpleITK master.

It is planned that explicitly setting the following would be best:

 -DCMAKE_VISIBILITY_INLINES_HIDDEN:BOOL=ON
 -DCMAKE_C_VISIBILITY_PRESET:STRING=hidden
 -DCMAKE_CXX_VISIBILITY_PRESET:STRING=hidden

This is under the assumption that the packaging only produces a single shared library.

blowekamp avatar Jan 25 '17 14:01 blowekamp

Recent commits in SimpleITK should improve hiding of symbols: SimpleITK/SimpleITK@70470a733245c95636153b7a65ca3657f89ebf0f

Need to update the package version and determine the size of the package distribution.

blowekamp avatar Feb 01 '17 19:02 blowekamp

Additionally, the Python Library was not being stripped of symbols. Pull request #19 adresses the stripping issue.

blowekamp avatar Feb 02 '17 16:02 blowekamp