-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
BLD: numpy compile with mingw32 on windows using official python3.6 binary #8690
Conversation
pygsl on windows. I overloaded _fix_lib_args: This requires to call the parent class as the temporary build directory is used by numpy for some static libraries (e.g. npymath) to build numpy. This path is added to the link pathes by one of the parent classes. The comparison of the linked and run msvc / vcruntime library check was not traced down. The compiled numpy was tested on windows and worked to a large extend. The test results will be reported separately. Pygsl uses the preprossesor to check some definitions in GSL header. This worked for me after defining the preprocessor.
numpy/distutils/mingw32ccompiler.py
Outdated
@@ -53,7 +53,9 @@ def get_msvcr_replacement(): | |||
_TABLE = re.compile(r'^\s+\[([\s*[0-9]*)\] ([a-zA-Z0-9_]*)') | |||
|
|||
# the same as cygwin plus some additional parameters | |||
class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler): | |||
_parent = distutils.cygwinccompiler.CygwinCCompiler # super() useable for all | |||
# python versions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super(Mingw32Compiler, self)
works on all python versions we care about, so better to do it that way
numpy/distutils/mingw32ccompiler.py
Outdated
@@ -608,6 +638,10 @@ def check_embedded_msvcr_match_linked(msver): | |||
# embedding | |||
maj = msvc_runtime_major() | |||
if maj: | |||
if type(msver) == type(1.0) and msver == 14.0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isinstance(msver, float)
would be better here
# that did not fix this issue. | ||
# I needed this change to have the config tests run. This links to the | ||
# vcruntime in the python directory. | ||
# Can this be fixed by an appropriate environment variable? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these comments feel like they belong in the PR, not the code (perhaps due to being first person)
…inary numpy#8690 made change requests
-- python was compiled using ms c -- extension is compiled with mingw -- and the extension tries to makes ome file operations I disabled fromfile function and tofile method of multiarray using the preprocessor variable NPY_PYTHON_COMPILER_DIFFER. Then I could run the tests using run_tests.py without any crashes. This submission is to document the obtained results. Test output added as file
PS: I am using numpy as distributed from numpy project for production use. I only compiled and tested it to find if my modifications to mingw32ccompiler.py introduced any further regressions
Have you tried with current master? There have been a lot of changes related to windows builds. |
Commits should also be squashed. |
Maybe a good start at the time. 5 years on, we have cygwin tests and mingw is running mostly I think. I don't think there is anything here of interest anymore. Closing, thanks for the PR! |
Changes I found necessary to compile numpy and to configure numpy and pygsl on windows.
I overloaded _fix_lib_args: This requires to call the parent class as the
temporary build directory is used by numpy for some static libraries
(e.g. npymath) to build numpy. This path is added to the link pathes by
one of the parent classes.
The comparison of the linked and run msvc / vcruntime library check was
not traced down. The compiled numpy was tested on windows and worked to a
large extend. The test results will be reported separately.
Pygsl uses the preprossesor to check some definitions in GSL header.
This worked for me after defining the preprocessor.