strange install directory

Niels Möller nisse at
Fri Feb 26 18:20:45 UTC 2021

Paul Zimmermann <Paul.Zimmermann at> writes:

> on the gcc118 machine from the gcc compile farm, with gmp-6.2.1, make install
> puts the libgmp.{a,so} files in $PREFIX/lib64 instead of $PREFIX/lib. Is there
> any reason for that?

I don't know about GMP (and this is the first time I hear about
automake's genered install target using a different default than
libdir=${exec_prefix}/lib). Maybe a recent change in autoconf, automake,
(or possibly libtool)? But I've been doing somethignsimilar in Nettle
for years, and the problem case I want to avoid is this:

1. Assume we have a installed in /usr/local/lib, and that this
   is a the directory for 32-bit libraries.

2. User now builds and installs a new version of, for 64-bit
   abi, with default prefix. Say, "./configure CC='gcc -m64' && make &&
   make check && make install". If make install installs in
   /usr/local/lib, it will overwrite a working .so file with a new one
   completely breaking 32-bit programs on the system that depend on that
   32-bit library.

To avoid this kind of breakage one can apply some heuristics to tweak
the default location, depending on the api built for, OS flavor, current
structure under /usr/lib*, etc.

Does it work to override it by explicitly passing --libdir=$PREFIX/lib?


Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.

More information about the gmp-devel mailing list