Tags: lucasvr/hdf5-udf
Tags
Python: search for other names of libpython.so Some distros provide a libpython3.so symlink that points to the actual libpython${major}.${minor}.so file. Other distros, such as Ubuntu, do not. To prevent dlopen() from failing, we now attempt to load both libpython3.so and libpython3.${minor}. This fixes the problem of HDF5-UDF not finding symbols from libpython when loading the cffi module.
Fallback to /proc/self/exe if realpath(argv[0]) fails We use realpath() to identify the directory where the hdf5-udf file was installed so we can tell where the UDF template files were put. If the program name does not contain any elements to be resolved, then realpath() does not do anything, though -- and we can't tell where the template files are. This commit uses /proc/self/exe as a fallback in case realpath on argv[0] does not return the information we need.