MCPcopy Create free account
hub / github.com/numpy/numpy / setup_openblas

Function setup_openblas

tools/openblas_support.py:150–175  ·  view source on GitHub ↗

Download and setup an openblas library for building. If successful, the configuration script will find it automatically. Returns ------- msg : str path to extracted files on success, otherwise indicates what went wrong To determine success, do ``os.path.exists(m

(plat=get_plat(), ilp64=get_ilp64(), nightly=False)

Source from the content-addressed store, hash-verified

148
149
150def setup_openblas(plat=get_plat(), ilp64=get_ilp64(), nightly=False):
151 '''
152 Download and setup an openblas library for building. If successful,
153 the configuration script will find it automatically.
154
155 Returns
156 -------
157 msg : str
158 path to extracted files on success, otherwise indicates what went wrong
159 To determine success, do ``os.path.exists(msg)``
160 '''
161 _, tmp = mkstemp()
162 if not plat:
163 raise ValueError('unknown platform')
164 typ = download_openblas(tmp, plat, ilp64, nightly=nightly)
165 if not typ:
166 return ''
167 osname, arch = plat.split("-")
168 if osname == 'win':
169 if not typ == 'zip':
170 return f'expecting to download zipfile on windows, not {typ}'
171 return unpack_windows_zip(tmp, plat)
172 else:
173 if not typ == 'tar.gz':
174 return 'expecting to download tar.gz, not %s' % str(typ)
175 return unpack_targz(tmp)
176
177
178def unpack_windows_zip(fname, plat):

Callers 2

test_setupFunction · 0.85

Calls 6

get_platFunction · 0.85
get_ilp64Function · 0.85
download_openblasFunction · 0.85
unpack_windows_zipFunction · 0.85
unpack_targzFunction · 0.85
splitMethod · 0.45

Tested by 1

test_setupFunction · 0.68