Skip to content

Install fewer static libraries #28890

@embray

Description

@embray

As pointed out on sage-devel, by default many SPKGs install static libraries in addition to their associated dynamic libs.

I usually ignored this as harmless, but as Marc pointed out, some of them are quite large, especially libgiac.a. Almost none of these are actually needed either at build or runtime and do not need to be installed by default in SAGE_LOCAL.

I think by default we should configure the relevant packages to not install static libs, or remove them manually if the packages' build system installs them forcibly. This could be overridden with <PKGNAME>_CONFIGURE variables if someone needs the static lib for some reason.

At least the following packages are installing static libs

$ for f in local/var/lib/sage/installed/*; do if grep '\.a\"' "$f" > /dev/null; then echo "$f" | cut -d'/' -f6; fi; done
cddlib-0.94j
cliquer-1.21.p4
e_antic-0.1.3
ecl-16.1.2.p5
eclib-20190909
ecm-7.0.4.p1
fplll-5.2.1
freetype-2.9.1
gap-4.10.2.p1
gc-7.6.4.p0
gf2x-1.2.p0
giac-1.5.0.63.p0
givaro-4.1.1
gsl-2.5
iml-1.0.4p1.p2
libatomic_ops-7.6.2
libgd-2.1.1.1.p1
libpng-1.6.29.p1
lrcalc-1.2.p1
mpc-1.1.0
mpfi-1.5.2
mpfr-4.0.1.p0
mpir-3.0.0-644faf502c56f97d9accd301965fc57d6ec70868.p0
ncurses-6.0.p0
normaliz-3.7.2
ntl-11.3.2
numpy-1.16.1
pari-2.11.1.p2
planarity-3.0.0.5.p0
ppl-1.2.p1
python2-2.7.15.p1
python3-3.7.3.p1
ratpoints-2.1.3.p5
rw-0.7.p0
singular-4.1.1p2.p0
sqlite-3290000
symmetrica-2.0.p11
yasm-1.3.0.p0
zeromq-4.2.5
zlib-1.2.11.p0

In at least a few cases, like libatomic_ops, I believe this is intentional. But in most cases it is probably unnecessary.

Additional notes:

  • cliquer: it already passes --disable-static but it installs a test file into share/ which happens to end with .a but is not a static lib as far as I can tell.

  • ecl: The .a modules installed with ECL seem to be pretty baked into its build process and I'm not sure if there's an easy way to omit them or if it's even desirable to.

  • ecm: apparently we deliberately build it as a static lib by default; not sure why. Need to investigate (performance reasons?)

  • gap: The SmallGrp package also installs some ".a" file that are not static libs; otherwise GAP is not installing any static libs (some things in gap_packages might but I haven't checked yet).

  • mpir: mpir/gmp is linked statically for at least some libraries such as ECM, and possibly some others (GP?).

  • ntl: NTL's build system makes static library installation pretty mandatory--I don't know if there's any good reason for that or not, so for now we can just leave it alone.

  • python2/3: The static lib installation (performed by the libainstall make target) is a part of Python's standard installation process and more trouble to remove than it's worth, although I don't think we explicitly need it for anything.

  • ratpoints: Has only ever supported being built as a static library, and is statically linked into Sage's ratpoints interface.

  • yasm: If I understand correctly, libyasm contains some special support functions and is intended to be linked statically.

CC: @mezzarobba @dimpase @orlitzky @jhpalmieri @videlec

Component: build

Keywords: static

Author: Erik Bray, Matthias Koeppe

Branch/Commit: c8ccab6

Reviewer: Marc Mezzarobba, John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/28890

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions