This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,10 @@ install:
119
119
build_script :
120
120
- cd numpy
121
121
- git checkout %BUILD_COMMIT%
122
+ # Create _distributor_init.py
123
+ - cd ..
124
+ - python -c "import openblas_support; openblas_support.make_init('numpy')"
125
+ - cd numpy
122
126
# Append license text relevant for the built wheel
123
127
- type ..\LICENSE_win32.txt >> LICENSE.txt
124
128
- ps : |
Original file line number Diff line number Diff line change 1
1
* .pyc
2
2
* ~
3
+ * .swp
3
4
tmp_for_test /
4
5
working /
5
6
downloads /
Original file line number Diff line number Diff line change
1
+ import os
2
+ import textwrap
3
+
4
+ def make_init (dirname ):
5
+ '''
6
+ Create a _distributor_init.py file for OpenBlas
7
+ '''
8
+ with open (os .path .join (dirname , '_distributor_init.py' ), 'wt' ) as fid :
9
+ fid .write (textwrap .dedent ("""
10
+ '''
11
+ Helper to preload windows dlls to prevent dll not found errors.
12
+ Once a DLL is preloaded, its namespace is made available to any
13
+ subsequent DLL. This file originated in the numpy-wheels repo,
14
+ and is created as part of the scripts that build the wheel.
15
+ '''
16
+ import os
17
+ from ctypes import WinDLL
18
+ import glob
19
+ if os.name == 'nt':
20
+ # convention for storing / loading the DLL from
21
+ # numpy/.libs/, if present
22
+ try:
23
+ basedir = os.path.dirname(os.path.dirname(__file__))
24
+ except:
25
+ pass
26
+ else:
27
+ libs_dir = os.path.abspath(os.path.join(basedir, '.libs'))
28
+ DLL_filenames = []
29
+ if os.path.isdir(libs_path):
30
+ for filename in glob.glob(os.path.join(libs_dir,
31
+ '*openblas*dll')):
32
+ # NOTE: would it change behavior to load ALL
33
+ # DLLs at this path vs. the name restriction?
34
+ WinDLL(os.path.abspath(filename))
35
+ DLL_filenames.append(filename)
36
+ if len(DLL_filenames) > 1:
37
+ import warnings
38
+ warnings.warn("loaded more than 1 DLL from .libs:\\ n%s" %
39
+ "\\ n".join(DLL_filenames),
40
+ stacklevel=1)
41
+ """ ))
42
+
You can’t perform that action at this time.
0 commit comments