Problem 1225 - overriding CMAKE_INSTALL_LIBDIR
Summary: overriding CMAKE_INSTALL_LIBDIR
Status: CLOSED WONTFIX
Alias: None
Product: Geant4
Classification: Unclassified
Component: cmake (show other problems)
Version: other
Hardware: PC Linux
: P5 trivial
Assignee: Ben Morgan
URL:
Depends on:
Blocks:
 
Reported: 2011-07-05 10:24 CEST by Yngve Inntjore Levinsen
Modified: 2018-05-08 14:37 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Yngve Inntjore Levinsen 2011-07-05 10:24:29 CEST
On my system, Arch Linux x86_64, when I installed the 4.9.5 beta1 version, the library files were installed in /usr/lib64 instead of /usr/lib. I don't know if this is normal on some distributions, but it is not generally correct I believe? I'd expect on a 64bit architecture that 64bit libraries are in /usr/lib, and 32bit in /usr/lib32?
Comment 1 Ben Morgan 2011-07-05 11:32:23 CEST
Unfortunately, this is an 'It Depends' problem. Some distributions use lib64, some don't, and there are further complex variations on recent Debian versions, see

http://wiki.debian.org/Multiarch/

We can investigate whether it's feasible to detect the distribution as is done for Debian already, but this relies on two things which we would need to know

1) Is Arch Linux easy to detect (/etc/arch-release?)
2) Does Arch have a stable and consistent policy for the installation directory name for libraries of each architecture? 

For now, you can set CMAKE_INSTALL_LIBDIR on the command line, e.g.

cmake -DCMAKE_INSTALL_LIBDIR=lib <other-args>

or via the curses/GUI interfaces, though it is an Advanced Option, so you would need to enable those in the interface (press 't' in curses).

Because of the above, I'm marking this as a LATER because of the multiarch issues.
If you want to see the details, the module 

cmake/Modules/Geant4InstallDirs.cmake

has all the logic in.
Comment 2 Yngve Inntjore Levinsen 2011-07-05 14:38:33 CEST
Arch Linux only supports two architectures, i686 and amd64. Libraries for the architecture you have installed on Arch linux is always in `prefix`/lib, and the only other option is then obviously 32bit libraries on amd64 machines, which goes in lib32.

/etc/arch-release is present on Arch Linux systems.
Comment 3 Ben Morgan 2018-05-08 14:37:41 CEST
CMake and the GNUInstallDirs module should now provide all needed functionality to modify install paths as required.