def METHOD_NAME(conf):
	if conf.options.nlopt:
		includes_check = [conf.options.nlopt + '/include']
		libs_check = [conf.options.nlopt + '/lib']
	else:
		includes_check = ['/usr/local/include', '/usr/include']
		libs_check = ['/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu/']
		if 'RESIBOTS_DIR' in os.environ:
			includes_check = [os.environ['RESIBOTS_DIR'] + '/include'] + includes_check
			libs_check = [os.environ['RESIBOTS_DIR'] + '/lib'] + libs_check
	incl = ''
	try:
		conf.start_msg('Checking for NLOpt C++ includes (optional)')
		res = conf.find_file('nlopt.hpp', includes_check)
		incl = res[:-len('nlopt.hpp')-1]
		conf.end_msg(incl)
	except:
		conf.end_msg('Not found in %s' % str(includes_check), 'YELLOW')
		return 1
	conf.start_msg('Checking for NLOpt C++ libs (optional)')
	lib_path = ''
	lib_name = ''
	for lib in ['libnlopt_cxx.so', 'libnlopt_cxx.a', 'libnlopt_cxx.dylib', 'libnlopt.so', 'libnlopt.a', 'libnlopt.dylib']:
		try:
			res = conf.find_file(lib, libs_check)
			lib_path = res[:-len(lib)-1]
			lib_name = os.path.splitext(lib)[0][3:]
		except:
			continue
	if lib_path == '':
		conf.end_msg('Not found in %s' % str(libs_check), 'YELLOW')
		return 1
	else:
		conf.end_msg(lib_path)
		conf.env.INCLUDES_NLOPT = [incl]
		conf.env.LIBPATH_NLOPT = [lib_path]
		conf.env.DEFINES_NLOPT = ['USE_NLOPT']
		conf.env.LIB_NLOPT = [lib_name]
	return 1