Project

General

Profile

Bug #5299

Updated by Davide Pesavento 10 months ago

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`](https://gitlab.com/ita1024/waf/-/blob/waf-2.0.26/waflib/Utils.py?ref_type=tags#L859): 

 ```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.

Back