ANTsX / ANTs

Advanced Normalization Tools (ANTs)
Apache License 2.0
1.18k stars 381 forks source link

Build/Install Defaults & Binaries -- Static vs Shared #1587

Open gdevenyi opened 1 year ago

gdevenyi commented 1 year ago

The current default build process is BUILD_SHARED_LIBS=OFF which means ANTs binaries are statically built. Despite this, make install will still install all the libraries, which makes the install huge.

For docker containers, binaries, etc, we should either use the shared build (library paths should be handled by RPATH) or not install the libraries during static install.

cookpa commented 1 year ago

The Dockerfile does use the shared builds, but I don't think it uses RPATH, I have to set LD_LIBRARY_PATH. This breaks shared Mac OS builds, because the OS does not respect LD_LIBRARY_PATH for security reasons.

I don't know if not installing the libraries could affect other ANTsX software, but would need to verify that before making any changes. Perhaps it could be an option, I believe we have a "libs only" option already, I could add "binaries only".

cookpa commented 3 months ago

I was looking at this randomly and noticed that it's mostly not the libs making the distribution large

1.9G    ./bin
273M    ./lib

Might be worth trying to trim executable size by removing unneeded imports

gdevenyi commented 2 months ago

Related, https://github.com/ANTsX/ANTsPy/pull/346