From 37417ea7c521a9f4b13f2748303d680e6a02e6df Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner's Jenkins CI server Date: Wed, 28 May 2014 16:03:05 -0500 Subject: [PATCH] Mess around some more to make Py3 find wrapper library --- pyopencl/_cffi.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pyopencl/_cffi.py b/pyopencl/_cffi.py index 9c1c59e0..e58364ad 100644 --- a/pyopencl/_cffi.py +++ b/pyopencl/_cffi.py @@ -123,6 +123,19 @@ def _get_wrapcl_so_names(): if ext_suffix is not None: yield os.path.join(current_directory, "_wrapcl" + ext_suffix) + # Oh god. Chop hyphen-separated bits off the end, in the hope that + # something matches... + + root, ext = os.path.splitext(ext_suffix) + while True: + last_hyphen = root.rfind("-") + if last_hyphen == -1: + break + root = root[:last_hyphen] + yield os.path.join(current_directory, "_wrapcl" + root + ext) + + yield os.path.join(current_directory, "_wrapcl" + ext) + from distutils.sysconfig import get_config_var yield os.path.join(current_directory, "_wrapcl" + get_config_var('SO')) -- GitLab