Skip to content

Enable "hidden" visibility to reduce wheel size #15

Description

@blowekamp

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions