Skip to content

BLD: put openblas library in local directory on windows - #16101

Merged
charris merged 3 commits into
numpy:masterfrom
mattip:azure-windows
Apr 29, 2020
Merged

charris merged 3 commits into
numpy:masterfrom
mattip:azure-windows

Conversation

@mattip

@mattip mattip commented Apr 28, 2020 •

Copy link
Copy Markdown
Member

Something changed in the image used for windows on azure: python is on C: and the checkout is done in D:. This causes mingw to fail to link with the openblas library if it is put in the "known path" <python-dir>/libs that the openblas discovery mechanism searches. Instead, use an environment variable $OPENBLAS to point to a local directory and copy the library there.

This code is copiedbased on code from numpy-wheels.

@mattip

mattip commented Apr 28, 2020

Copy link
Copy Markdown
Member Author

Hmm, that didn't work: openblas_info searched the directory but did not find the file

@WarrenWeckesser

Copy link
Copy Markdown
Member

It looks like you still need to install urllib3. It is needed in tools/openblas_support.py.

Comment thread azure-steps-windows.yml Resolved
Comment thread azure-steps-windows.yml Resolved
@mattip
mattip force-pushed the azure-windows branch 2 times, most recently from 8f4669f to c692cf3 Compare April 28, 2020 21:17
Comment thread azure-steps-windows.yml Resolved
@mattip

mattip commented Apr 28, 2020

Copy link
Copy Markdown
Member Author

I needed to change to powershell to add the windows-formatted name of the directory as an environmental variable. The windows build uses pip wheel not python setup.py install, which by default does an isolated build somewhere in %TEMP% (I think, am not sure 100%), so I cannot be sure the relative path will be correct.

I also noticed one of the build steps had a small problem so I tweaked it to succeed.

Comment thread azure-steps-windows.yml Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not really part of the openblas handling, this will disable all the fancy "copy to tmp directory, exec(setup.py)" things that pip now does when calling pip wheel. The former slows things down, the latter breaks our setup.py (it cannot find parse_setuppy_commands)

Comment thread azure-steps-windows.yml Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was broken

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why download numpy==1.14?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I recall correctly, this was added to test that numpy will still load properly even if there are two fortran dlls in the .lib directory on windows. The real test is in the next step

Comment thread azure-steps-windows.yml Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need to add OPENBLAS_SUFFIX (line 20, 21) seems to me to be a bug in the packaging of the openblas-lib. It knows about 64bit builds, and should package the library appropriately.

@WarrenWeckesser

Copy link
Copy Markdown
Member

FYI: I tried making some changes similar to these for the SciPy tests: scipy/scipy#11965

@mattip

mattip commented Apr 29, 2020

Copy link
Copy Markdown
Member Author

Azure tests now passing, I think this is ready for review

@mattip

mattip commented Apr 29, 2020

Copy link
Copy Markdown
Member Author

Fixes #16107

@charris
charris merged commit 4cd9871 into numpy:master Apr 29, 2020
@charris

charris commented Apr 29, 2020

Copy link
Copy Markdown
Member

This may not be the end of the story, but we need to get CI working again so in it goes. I've also marked it for possible backport for the 1.18.4 release if needed. Thanks Matti.

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Apr 29, 2020
@charris charris added this to the 1.18.4 release milestone Apr 29, 2020
@charris

charris commented Apr 29, 2020

Copy link
Copy Markdown
Member

These changes on the windows end are annoying, it would be nice if we got some prior warning.

@tylerjereddy

Copy link
Copy Markdown
Contributor

Perhaps partly my fault--I think there was a warning in the Azure docs somewhere about depending on absolute paths with drive letters, but it was easier to do at the time.

charris pushed a commit to charris/numpy that referenced this pull request Apr 29, 2020
* BLD: put openblas library in local directory on windows

* TST: fix broken pip install on windows

* BLD: handle 64-bit windows BLAS
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label May 19, 2020
@charris charris removed this from the 1.18.4 release milestone May 19, 2020
@mattip
mattip deleted the azure-windows branch April 8, 2021 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants