import ctypes
from ctypes.util import find_library
ompl = find_library('ompl')
ompl_app = find_library('ompl_app')
if ompl:
	ctypes.CDLL(ompl, ctypes.RTLD_GLOBAL)
if ompl_app:
	ctypes.CDLL(ompl_app, ctypes.RTLD_GLOBAL)

import ctypes
from ctypes.util import find_library

for lib in ['ompl', 'ompl_app']:
	libname = find_library(lib)
	if libname:
		ctypes.CDLL(libname, ctypes.RTLD_GLOBAL)
	else:
		# find_library can't seem to find the libraries on Linux,
		# even if the libs are in the current directory or
		# if LD_LIBRARY_PATH is set to the directory where the libs
		# reside. The call below still succeeds, though.
		ctypes.CDLL('lib'+lib+'.so', ctypes.RTLD_GLOBAL)

work around broken ctypes.util.find_library on Linux