File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -53,15 +53,23 @@ def get_library():
53
53
# remove the leading lib from libscipy_openblas*
54
54
return os .path .splitext (libs [0 ])[0 ][3 :]
55
55
56
- def get_pkg_config ():
56
+ def get_pkg_config (use_preloading = False ):
57
57
"""Return a multi-line string that, when saved to a file, can be used with
58
58
pkg-config for build systems like meson
59
+
60
+ If use_preloading is True then on posix the ``Libs:`` directive will not add
61
+ ``f"-L{get_library()}" so that at runtime this module must be imported before
62
+ the target module
59
63
"""
60
64
if sys .platform == "win32" :
61
65
extralib = "-defaultlib:advapi32 -lgfortran -lquadmath"
66
+ libs_flags = f"-L${{libdir}} -l{ get_library ()} "
62
67
else :
63
68
extralib = f"-lm -lpthread -lgfortran -lquadmath -L${{libdir}} -l{ get_library ()} "
64
- libs_flags = f"-L${{libdir}} -l{ get_library ()} "
69
+ if use_preloading :
70
+ libs_flags = ""
71
+ else :
72
+ libs_flags = f"-L${{libdir}} -l{ get_library ()} "
65
73
cflags = "-DBLAS_SYMBOL_PREFIX=scipy_ -DBLAS_SYMBOL_SUFFIX=64_ -DHAVE_BLAS_ILP64 -DOPENBLAS_ILP64_NAMING_SCHEME"
66
74
return dedent (f"""\
67
75
libdir={ get_lib_dir ()}
@@ -111,7 +119,7 @@ def get_openblas_config():
111
119
else :
112
120
# Get openblas*
113
121
libnames = [x for x in os .listdir (lib_dir ) if x .startswith ("libscipy" )]
114
-
122
+
115
123
dll = ctypes .CDLL (os .path .join (lib_dir , libnames [0 ]), ctypes .RTLD_GLOBAL )
116
124
openblas_config = dll .scipy_openblas_get_config64_
117
125
openblas_config .restype = ctypes .c_char_p
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
8
8
9
9
[project ]
10
10
name = " scipy_openblas64"
11
- version = " 0.3.26.0.1 "
11
+ version = " 0.3.26.0.2 "
12
12
requires-python = " >=3.7"
13
13
description = " Provides OpenBLAS for python packaging"
14
14
readme = " README.md"
You can’t perform that action at this time.
0 commit comments