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)
| 148 | |
| 149 | |
| 150 | def 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 | |
| 178 | def unpack_windows_zip(fname, plat): |