realpath has to be applied to both local_lib and filename