@@ -42,16 +42,23 @@ def get_lib_dir():
42
42
return os .path .join (_HERE , "lib" )
43
43
44
44
45
- def get_library ():
46
- """Return the lib name needed for linking
45
+ def get_library (fullname = False ):
46
+ """Return the lib name needed for linking. If `fullname` then return the
47
+ filename of the library, otherwise return the link name.
47
48
"""
48
49
if sys .platform == "win32" :
49
50
libs = [x for x in os .listdir (get_lib_dir ()) if x .endswith (".lib" )]
50
- return os .path .splitext (libs [0 ])[0 ]
51
+ if fullname :
52
+ return libs [0 ]
53
+ else :
54
+ return os .path .splitext (libs [0 ])[0 ]
51
55
else :
52
56
libs = [x for x in os .listdir (get_lib_dir ()) if x .startswith ("libscipy_openblas" )]
53
- # remove the leading lib from libscipy_openblas*
54
- return os .path .splitext (libs [0 ])[0 ][3 :]
57
+ if fullname :
58
+ return libs [0 ]
59
+ else :
60
+ # remove the leading lib from libscipy_openblas*
61
+ return os .path .splitext (libs [0 ])[0 ][3 :]
55
62
56
63
def get_pkg_config (use_preloading = False ):
57
64
"""Return a multi-line string that, when saved to a file, can be used with
@@ -69,7 +76,7 @@ def get_pkg_config(use_preloading=False):
69
76
if use_preloading :
70
77
libs_flags = ""
71
78
else :
72
- libs_flags = f"-L ${{libdir}} -l { get_library () } "
79
+ libs_flags = f"${{libdir}}/ { get_library (fullname = True ) } -Wl,-rpath,${{libdir} }"
73
80
cflags = "-DBLAS_SYMBOL_PREFIX=scipy_ -DBLAS_SYMBOL_SUFFIX=64_ -DHAVE_BLAS_ILP64 -DOPENBLAS_ILP64_NAMING_SCHEME"
74
81
return dedent (f"""\
75
82
libdir={ get_lib_dir ()}
0 commit comments