Skip to content

Commit aa71c98

Browse files
make sure that _opencl_core can find Interface shared objects
1 parent 34a78dd commit aa71c98

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dpctl/opencl_core.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,21 @@
5959

6060
ffi_lib_name = "dpctl._opencl_core"
6161

62+
import sys
63+
IS_WIN = sys.platform in ['win32', 'cygwin']
64+
del sys
65+
6266
ffi.set_source(
6367
ffi_lib_name,
6468
"""
6569
#include "dppl_opencl_interface.h" // the C header of the library
6670
""",
6771
include_dirs=[dppl_opencl_interface_incldir],
6872
library_dirs=[dppl_opencl_interface_libdir, opencl_libdir],
73+
extra_link_args=[] if IS_WIN else ['-Wl,-rpath=$ORIGIN'],
6974
libraries=["DPPLOpenCLInterface", "OpenCL"],
7075
) # library name, for the linker
71-
76+
del IS_WIN
7277

7378
if __name__ == "__main__":
7479
ffi.compile(verbose=True)

0 commit comments

Comments
 (0)