-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch ldflags and libs in GCC_compile under windows #947
Conversation
Does anyone know how to fix the unreachable code error from mypy? That code only runs on windows, and mypy doesn’t complain when I run it on windows. |
It looks like mypy is failing because of this bug |
In general, it looks like Mypy is taking the value of Anyway, you can add a |
The failing test ( |
Yeah, that looks like a bad, unseeded test. |
Codecov Report
@@ Coverage Diff @@
## main #947 +/- ##
==========================================
+ Coverage 78.92% 78.98% +0.06%
==========================================
Files 152 152
Lines 47701 47795 +94
Branches 10862 10888 +26
==========================================
+ Hits 37649 37753 +104
+ Misses 7550 7542 -8
+ Partials 2502 2500 -2
|
Looking forward to this PR! Was just scratching my head about this on Windows. Thanks @lucianopaz |
Codecov seems to be linking the old commit instead of the new one |
Closes #944
On windows systems, the dll or lib libraries don't follow gcc's library naming convention, which means that their file name doesn't have the lib prefix (e.g. libmkl_core.dll). For this reason, gcc's library search fails to find these dynamic link libraries or static libs. An undesired consequence was that aesara (and old theano) was not able to set the correct blas__ldflags to link with mkl, even if the library had been correctly installed.
This PR introduces two GCC_compiler static methods that patch the libs or ldflags that are used during compilation. The static methods specifically target dll and lib files. They search for the library files in the provided library directories, and if a dll or lib is found, the ldflag is set to the absolute path that points to the dll or lib file. As a sidenote, dlls are preferred over libs.
As a consequence, the normal unix-like ldflags will be patched to work in windows as they do in unix. Thanks to this, aesara is now able to set the correct ldflags in windows to link to mkl installations.