aswf-docker icon indicating copy to clipboard operation
aswf-docker copied to clipboard

lib vs lib64 in containers

Open jfpanisset opened this issue 3 years ago • 5 comments

Looking at the ci-vfxall image, it seems that most of the resulting DSOs end up in /usr/local/lib but a few end up in /usr/local/lib64 (OpenGL, OIIO, Ptext, OSL). On CentOS 7 systems:

32 bit DSOs: /lib -> /usr/lib 64 bit DSOs: /lib64 -> /usr/lib64

Since these containers are 64 bit only, would it make sense to have all DSOs land in /usr/local/lib64 ? Could always have a backwards compatibility link from /usr/local/lib to /usr/local/lib64

On the other hand systemd defines /lib64 as a "backwards compatibility symlink":

https://www.freedesktop.org/software/systemd/man/file-hierarchy.html#Compatibility%20Symlinks

so it's unclear what's the correct approach, but since for now these containers are somewhat CentOS 7 centric, I would suggest following the lead of CentOS 7, and having all DSOs land in /usr/local/lib64

jfpanisset avatar Jun 28 '21 23:06 jfpanisset

Hi JF,

Yep I noticed that inconsistency as well, but I'm basically just getting what cmake decided to do at install time... Some packages are following centos' desire to put libs in lib64, and others just ignore that. And taking the time to post-process all package install procedures would take a bit of effort, and could break some packages in subtle ways (e.g. USD installs are not relocatable as far as I know, so moving the dso files after install could break things...). That said if you know of a cool cmake trick to do this I'd be happy to try :)

Cheers,

Aloys

aloysbaillet avatar Jun 28 '21 23:06 aloysbaillet

For the specific case of OpenImageIO, the CMake code that decides where to install the libraries seems to come from (or at least be related to):

https://github.com/OpenImageIO/oiio/blob/master/src/build-scripts/OpenImageIO.pc.in

where libdir is derived from @CMAKE_INSTALL_LIBDIR@ which claims to default to lib, but somehow here ends up being lib64

I'll try to experiment with build_oiio.sh and see why it ends up installing in lib64 instead of lib.

jfpanisset avatar Jun 29 '21 19:06 jfpanisset

The .pc.in is just a template for how it generates a pkgconfig file describing where things were put by the install. It doesn't determine any of the logic of where things are put.

lgritz avatar Jun 29 '21 19:06 lgritz

I believe this is the key to understanding: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html

lgritz avatar Jun 29 '21 19:06 lgritz