8000 Add msvcp140.dll to Windows 64 bit wheels (#24631) · scikit-learn/scikit-learn@c01919b · GitHub
[go: up one dir, main page]

Skip to content

Commit c01919b

Browse files
cmarmoglemaitre
authored andcommitted
Add msvcp140.dll to Windows 64 bit wheels (#24631)
1 parent 36958fb commit c01919b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

build_tools/github/vendor.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
VCOMP140_SRC_PATH = "C:\\Windows\\System32\\vcomp140.dll"
1818
VCRUNTIME140_SRC_PATH = "C:\\Windows\\System32\\vcruntime140.dll"
1919
VCRUNTIME140_1_SRC_PATH = "C:\\Windows\\System32\\vcruntime140_1.dll"
20+
MSVCP140_SRC_PATH = "C:\\Windows\\System32\\msvcp140.dll"
2021

2122

2223
def make_distributor_init_32_bits(
@@ -65,12 +66,13 @@ def make_distributor_init_64_bits(
6566
vcomp140_dll_filename,
6667
vcruntime140_dll_filename,
6768
vcruntime140_1_dll_filename,
69+
msvcp140_dll_filename,
6870
):
6971
"""Create a _distributor_init.py file for 64-bit architectures.
7072
7173
This file is imported first when importing the sklearn package
72-
so as to pre-load the vendored vcomp140.dll, vcruntime140.dll
73-
and vcruntime140_1.dll.
74+
so as to pre-load the vendored vcomp140.dll, vcruntime140.dll,
75+
vcruntime140_1.dll and msvcp140.dll.
7476
"""
7577
with open(distributor_init, "wt") as f:
7678
f.write(
@@ -97,13 +99,16 @@ def make_distributor_init_64_bits(
9799
vcomp140_dll_filename = op.join(libs_path, "{0}")
98100
vcruntime140_dll_filename = op.join(libs_path, "{1}")
99101
vcruntime140_1_dll_filename = op.join(libs_path, "{2}")
102+
msvcp140_dll_filename = op.join(libs_path, "{3}")
100103
WinDLL(op.abspath(vcomp140_dll_filename))
101104
WinDLL(op.abspath(vcruntime140_dll_filename))
102105
WinDLL(op.abspath(vcruntime140_1_dll_filename))
106+
WinDLL(op.abspath(msvcp140_dll_filename))
103107
""".format(
104108
vcomp140_dll_filename,
105109
vcruntime140_dll_filename,
106110
vcruntime140_1_dll_filename,
111+
msvcp140_dll_filename,
107112
)
108113
)
109114
)
@@ -120,12 +125,16 @@ def main(wheel_dirname, bitness):
120125
if not op.exists(VCRUNTIME140_1_SRC_PATH) and bitness == "64":
121126
raise ValueError(f"Could not find {VCRUNTIME140_1_SRC_PATH}.")
122127

128+
if not op.exists(MSVCP140_SRC_PATH) and bitness == "64":
129+
raise ValueError(f"Could not find {MSVCP140_SRC_PATH}.")
130+
123131
if not op.isdir(wheel_dirname):
124132
raise RuntimeError(f"Could not find {wheel_dirname} file.")
125133

126134
vcomp140_dll_filename = op.basename(VCOMP140_SRC_PATH)
127135
vcruntime140_dll_filename = op.basename(VCRUNTIME140_SRC_PATH)
128136
vcruntime140_1_dll_filename = op.basename(VCRUNTIME140_1_SRC_PATH)
137+
msvcp140_dll_filename = op.basename(MSVCP140_SRC_PATH)
129138

130139
target_folder = op.join(wheel_dirname, TARGET_FOLDER)
131140
distributor_init = op.join(wheel_dirname, DISTRIBUTOR_INIT)
@@ -144,6 +153,9 @@ def main(wheel_dirname, bitness):
144153
print(f"Copying {VCRUNTIME140_1_SRC_PATH} to {target_folder}.")
145154
shutil.copy2(VCRUNTIME140_1_SRC_PATH, target_folder)
146155

156+
print(f"Copying {MSVCP140_SRC_PATH} to {target_folder}.")
157+
shutil.copy2(MSVCP140_SRC_PATH, target_folder)
158+
147159
# Generate the _distributor_init file in the source tree
148160
print("Generating the '_distributor_init.py' file.")
149161
if bitness == "32":
@@ -156,6 +168,7 @@ def main(wheel_dirname, bitness):
156168
vcomp140_dll_filename,
157169
vcruntime140_dll_filename,
158170
vcruntime140_1_dll_filename,
171+
msvcp140_dll_filename,
159172
)
160173

161174

0 commit comments

Comments
 (0)
0