Project

General

Profile

Actions

Bug #5299

closed

waf uses a different default LIBDIR in Ubuntu 23.04 and later (lib vs. lib64)

Added by Davide Pesavento about 1 year ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Category:
Build
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Tags:

Description

In Ubuntu 23.04 and later, running sudo ./waf install will install libndn-cxx.so and libndn-cxx.pc under /usr/local/lib64 instead of /usr/local/lib as in prior Ubuntu versions. This results in things no longer working out of the box, i.e., users need to manually set LD_LIBRARY_PATH, PKG_CONFIG_PATH, etc. for ndn-cxx to be automatically detected by other packages.

Based on my preliminary investigation, the root cause can be found in the lib64() function in waflib/Utils.py:

def lib64():
    """
    Guess the default ``/usr/lib`` extension for 64-bit applications

    :return: '64' or ''
    :rtype: string
    """
    # default settings for /usr/lib
    if os.sep == '/':
        if platform.architecture()[0] == '64bit':
            if os.path.exists('/usr/lib64') and not os.path.exists('/usr/lib32'):
                return '64'
    return ''

This heuristic seems somewhat fragile to me. Indeed, starting from Ubuntu 23.04, the path /usr/lib64 does exist (EDIT: this is not the key difference, see #note-2) and causes waf to set the default LIBDIR to ${PREFIX}/lib64, which in turn triggers the change in installation behavior described above.

Actions

Also available in: Atom PDF