Project

General

Profile

Bug #5299

Updated by Davide Pesavento 12 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): `waflib/Utils.py`: 

 ```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 == '/': 
		 os.sep=='/': 
                 if platform.architecture()[0] == '64bit': 
			 platform.architecture()[0]=='64bit': 
                         if os.path.exists('/usr/lib64') and os.path.exists('/usr/lib64')and not os.path.exists('/usr/lib32'): 
				 return '64' 
	 return '' 
 
                                 return'64' 
         return''            
 ``` 

 This heuristic seems somewhat fragile to me. Indeed, starting from Ubuntu 23.04, the path `/usr/lib64` does exist and causes waf to set the default LIBDIR to `${PREFIX}/lib64`, which in turn triggers the change in installation behavior described above.

Back